Web Applications with Javascript or Java
eBook - ePub

Web Applications with Javascript or Java

Volume 2: Associations and Class Hierarchies

  1. 199 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Web Applications with Javascript or Java

Volume 2: Associations and Class Hierarchies

Book details
Book preview
Table of contents
Citations

About This Book

Today, web applications are the most important type of software applications. This textbook shows how to design and implement them, using a model-based engineering approach that covers general information management concepts and techniques and the two most relevant technology platforms: JavaScript and Java. The book provides an in-depth tutorial for theory-underpinned and example-based learning by doing it yourself, supported by quiz questions and practice projects. Volume 1 provides an introduction to web technologies and model-based web application engineering, discussing the information management concepts of constraint-based data validation, enumerations and special datatypes. Volume 2 discusses the advanced information management concepts of associations and inheritance in class hierarchies.

Web apps are designed using UML class diagrams and implemented with two technologies: JavaScript for front-end (and distributed NodeJS) apps, and Java (with JPA and JSF) for back-end apps. The six example apps discussed in the book can be run, and their source code downloaded, from the book's website.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Web Applications with Javascript or Java by Gerd Wagner, Mircea Diaconescu in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Tecnología de la información. We have over one million books available in our catalogue for you to explore.

Information

Part I: Associations

The three example apps that we have discussed in Volume 1, the minimal app, the validation app, and the enumeration app, have been limited to managing the data of one object type only. A real app, however, has to manage the data of several object types, which are typically related to each other in various ways. In particular, there may be associations and subtype (inheritance) relationships between object types. Handling associations and subtype relationships are advanced issues in software application engineering. They are often not sufficiently discussed in text books and not well supported by application development frameworks.
Associations are important elements of information models. Software applications have to implement them in a proper way, especially in their model layer within a model-view-controller (MVC) architecture. Unfortunately, application development frameworks do often not provide much support for dealing with associations.
There are two important distinctions, which are independent of each other:
  1. Functional versus non-functional (“many-to-many”) associations.
  2. Unidirectional versus bidirectional associations.
A functional association corresponds to what is called a function in mathematics, while a many-to-many association corresponds to what is called a relation in mathematics.
A unidirectional association corresponds to a reference property in OO modeling and programming, while a bidirectional association corresponds to a pair of mutually inverse reference properties.

1 Reference Properties and Unidirectional Associations

A property defined for an object type, or class, is called a reference property if its values are references that reference an object of another, or of the same, type. For instance, the class Committee shown in Figure 1.1 below has a reference property chair, the values of which are references to objects of type ClubMember.
An association between object types classifies relationships between objects of those types. For instance, the association Committee-has-ClubMember-as-chair, which is visualized as a connection line in the class diagram shown in Figure 1.2 below, classifies the relationships FinanceCommittee-has-PeterMiller-as-chair, RecruitmentCommittee-has-SusanSmith-as-chair and AdvisoryCommittee-has-SarahAnderson-as-chair, where the objects PeterMiller, SusanSmith and SarahAnderson are of type ClubMember, and the objects FinanceCommittee, RecruitmentCommittee and AdvisoryCommittee are of type Committee. An association as a set of relationships can be represented as a table like so:
Reference properties correspond to a special form of associations, namely to unidirectional binary associations. While a binary association does, in general, not need to be directional, a reference property represents a binary association that is directed from the property’s domain class (where it is defined) to its range class.
In general, associations are relationship types with two or more object types participating in them. An association between two object types is called binary. In this book we only discuss binary associations. For simplicity, we just say ‘association’ when we actually mean ‘binary association’.
Committee-has-ClubMember-as-chair
Finance Committee Peter Miller
Recruitment Committee Susan Smith
Advisory Committee Sarah Anderson
While individual relationships (such as FinanceCommittee-has-PeterMiller-as-chair) are important information items in business communication and in information systems, associations (such as Committee-has-ClubMember-as-chair) are important elements of information models. Consequently, software applications have to implement them in a proper way, typically as part of their model layer within a model-view-controller (MVC) architecture. Unfortunately, many application development frameworks lack the required support for dealing with associations.
In mathematics, associations have been formalized in an abstract way as sets of uniform tuples, called relations. In Entity-Relationship (ER) modeling, which is the classical information modeling approach in information systems and software engineering, objects are called entities, and associations are called relationship types. The Unified Modeling Language (UML) includes the UML Class Diagram language for information modeling. In UML, object types are called classes, relationship types are called associations, and individual relationships are called “links”. These three terminologies are summarized in the following table:
Our preferred term(s) UML ER Diagrams Mathematics
object object entity individual
object type (class) class entity type unary relation
relationship link relationship tuple
association (relationship type) association relationship type relation
functional association one-to-one, many-to-one or one-to-many relationship type function
We first discuss reference properties, which implicitly represent unidirectional binary associations in an “association-free” class model (a model without any explicit association element).

1.1 References and Reference Properties

A reference can be either human-readable or an internal object reference. Human-readable references refer to identifiers that are used in human communication, such as the unique names of astronomical bodies, the ISBN of books and the employee numbers of the employees of a company. Internal object references refer to the computer memory addresses of OOP objects, thus providing an efficient mechanism for accessing objects in the main memory of a computer.
Some languages, like SQL and XML, only support human-readable, but not internal references. In SQL, human-rea...

Table of contents

  1. Title Page
  2. Copyright
  3. Contents
  4. Dedication
  5. Foreword
  6. Part I: Associations
  7. Part II:  Inheritance in Class Hierarchies
  8. Glossary
  9. Index