3. From a Conceptual Model via a Design Model to Class Models

In a new development project, we start our analysis and modeling effort with making a conceptual information model. This type of model is also called domain model since it describes the entities of a given (real-world) problem domain, and does not model software entities.

Recall the conceptual information model for books obtained as the result of the inception phase:

Taking this conceptual model as a starting point, we have to make a number of design decisions for obtaining an information design model:

  1. What are the ranges of the properties isbn, title and year?

  2. Which property is the standard identifier (ID) attribute?

  3. Which constraints should be defined?

  4. Which methods/functions should be part of the design?

The result of this design phase is a design model like the following:

It is important to understand that such a design model provides an implementation-agnostic (platform-independent) computational design, that is, it does not use any concept or syntax of any specific programming language or technology. Therefore, the same design model can be used for deriving different platform-specific implementation models for different programming languages or technologies, such as for a Java- or PHP-based framework, or for a plain JavaScript approach.

Based on the design model, by replacing the platform-independent datatype names with JavaScript-specific datatype names, and by adding "setter" methods, we obtain the following JavaScript implementation model, which we prefer to call a JavaScript class model:

Notice that in this model, we have used the JavaScript datatypes string and number, and we have added the methods setISBN, setTitle and setYear. These “setter” methods are supposed to be used for setting a property to a new value, instead of directly assigning the value to the property.

Having a setter method for each property is a best-practice approach that allows more control over property value assignments. For instance, we could check the validity of values before they are assigned, or we could notify other modules of the app about the assignment event.

The implementation phase consists of making an implementation model for a specific technology platform, and then coding this model and testing the resulting program code. In this book, we make both JavaScript class models and Java class models, which are subsequently coded in plain JavaScript and in Java EE, respectively.

The entire transformation chain, from a conceptual model via a design model to a JavaScript class model (as a special type of implementation model), is summarized in the following figure.

Figure 5.1. From a conceptual model via a design model to a JavaScript class model

From a conceptual model via a design model to a JavaScript class model
From a conceptual model via a design model to a JavaScript class model
From a conceptual model via a design model to a JavaScript class model
From a conceptual model via a design model to a JavaScript class model
From a conceptual model via a design model to a JavaScript class model

In summary, the process of model-based development takes a conceptual model as the starting point for making a general (platform-independent) design model, from which one or more implementation models for a (set of) specific target technologies can be derived. Typically, they include a class model for an object-oriented programming language and a database model for an SQL DBMS. This process is illustrated by the following diagram:

Figure 5.2. From a conceptual model via design models to implementation models

From a conceptual model via design models to implementation models