Make a JavaScript Class Model

Let’s learn how to make a JS class model.

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:

  1. 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 corresponding check operation is invoked and ...