A good simple example of a re-usable definition is an address. This type of object may be used in many places inside a model, and in different models too. Even within one single entity, you may have, for example a billing address and a shipping address.
Definitions can be maintained at 3 distinct levels: at the entity-level (called internal definitions), at the model-level, and external. Internal definitions have limited use because they can only be reused (or referenced) within the same entity (a collection or table). But internal definitions insure JSON Schema compatibility. Model definitions can be referenced in any entity of the same Hackolade model. Finally, external definitions are Hackolade models (or JSON Schema files) that can be referenced in whole or in part, by other models.
Note: In order for changes to a referenced external model to be activated in a referencing model, the latter needs to be opened in the application.
If a definition is created at the model level, it can be referenced in any entity of the same model, whereas it will be limited to its own entity if it is created internally. It is easy to create a re-usable definition from scratch, then reference it in a collection. Or by selecting an attribute in an existing collection, and converting it to a re-usable definition, so it can be referenced elsewhere.
Note: Definitions are not carried over to the NoSQL database. They are only used in physical modeling in Hackolade. To make things easy for the data modeler, Object Browser, ERD, collection tree views, and documentation all show the referenced attributes as if they had been defined directly in the collection(s).
A good example of a useful re-usable object is an address. You may want to have a 'billing address' and a 'shipping address', both of which use the same structure.
Note: it is not intended to combine definition levels. In other words, if you have a Hackolade model with attribute structures intended to be re-used in other models, you should define these as simple attributes, not as internal or model definitions.
External references are produced using the $ref implementation described here and RFC 3986.
The reference is marked with the middle line in the tree box, showing the name of the referenced definition, followed by either (m) for model definitions, or (i) for internal definitions.
This will create the internal or model definition, and replace the attribute (and its children if any) by a reference to the definition.