tree-ware / tree-ware-kotlin-core

Apache License 2.0
1 stars 0 forks source link

Archetype model #45

Open deepak-nulu opened 3 years ago

deepak-nulu commented 3 years ago

The archetype model is built from the meta-model and has all possible branches and leaves as defined in the meta-model. The field values in the archetype model are all set to null values.

Only 1 instance of this model is needed per meta-model, so one option is to create the archetype model when validating a meta-model and to store it in the meta-model itself. Another option is to have a separate function that creates the archetype model from the meta-model and to have this function called at the start of the server or client application.

Uses

  1. Generate the JSON representation of the archetype model, and use copies of that to manually create other JSON model files (and hence the name "archetype").
  2. Traverse and process the meta-model indirectly. Instead of traversing the meta-model, the archetype model can be traversed and processed. This is especially useful in the case where a regular model needs to be mapped using information in the meta-model.