Model Summary

Let's get a quick summary of the new model.

We'll cover the following

For the sake of simplicity, we won’t include the code for all constraint validation checks shown in the JS class model in our application’s code.

Summary

Code each class of the JS class model as an ES2015 class with implicit getters and setters:

  1. Code the property checks in the form of class-level (static) methods. Take care that all constraints of a property, as specified in the JS class model, are properly coded in the property checks.
  2. For each single-valued property, code the specified getter and setter so that in each setter, the corresponding property check is invoked and the property is only set or unset if the check doesn’t detect any constraint violation.
  3. For each multi-valued property, code its add and remove operations, as well as the specified get and set operations:
    • Code the add and remove operations as instance-level methods that invoke the corresponding property checks.
    • Code the setter so that it invokes the add operation for each item of the collection to be assigned.
  4. Write the code of the serialization function toString() and the object-to-storage conversion function toRecord().
  5. Take care of deletion dependencies in the destroy method.

Get hands-on with 1400+ tech skills courses.