Skip to content

Martini Data Model References

Introduction

Model references in Martini offer a streamlined approach to reusing and extending data models in services and other models. This concept is similar to extending classes in object-oriented programming, where one model can inherit properties from another. In Martini, models can reference other models, and they can also contain models as properties.

Extending Models with References

Setting up a Model Reference

To have a model extend or reference another, you need to adjust the model's properties to point to the desired parent model.

Steps to Reference a Model

  1. Open the model in the model editor.
  2. Access the Properties view. If this view is not showing the current model's properties, activate the appropriate view in the editor's toolbar.
  3. In the Properties view, locate and modify the Reference property to establish the link to the parent model.

Handling Extra Properties in Models

Martini models include a feature similar to the final keyword in Java, known as Allow Extra Properties. This property dictates whether a model can accommodate additional properties dynamically at runtime.