Make a JavaScript Class Model
Explore how to derive JavaScript class models from object-oriented designs by adding property getters and setters, implementing constraint checks, and creating serialization methods. Understand how to maintain data integrity and referential constraints in functional associations within your app's classes.
We'll cover the following...
Derive the class model
The starting point for making a JavaScript class model is an OO class model like the one shown below.
Let’s look at how to derive a JS class model from this OO class model in four steps. For each class in the OO class model, we do the following:
-
Add a
«get/set»stereotype to all non-derived, single-valued properties. This addition of this stereotype implies that those single-valued properties have implicit getters and setters. Recall that in the setter, the correspondingcheckoperation is invoked and ...