Re-usable objects definitions

To facilitate the work of data modelers, Hackolade has introduced a handy feature: the ability to create once object definitions that can be re-used in multiple places. A library of definitions standardizes content and insures consistency. This dictionary also simplifies the work of data modelers so maintenance can be performed in one place and be automatically propagated to all places where the definition is referenced.

Definitions can be maintained at 3 distinct levels: internal, model, and external.

External definitions let you reference another Hackolade model or part of another model. In order for changes to a referenced 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 collection of the same model, whereas it will be limited to its own collection if it is created locally (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.

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.  geoJSON structures are also good candidates for definitions.

A reference can later be replaced by its attributes to branch away from the definition. 

Internal definitions are provided mostly for JSON Schema compatibility.  But model and external definitions are the most useful, with external definitions being used when needed across multiple models.

 

Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Miguel Ballesteros

    This is a handy feature at design time. However, when forward-engineering schema files, model references are kept as references, and those cannot be found anywhere in any of the generated schema files.

            "description": {
                    "$ref": "#model/definitions/localizableString"
             },

    If I try to find the re-usable object definition "localizableString", it is not present on any of the generated schema files. Also, there's no option to export "Rendered" re-usabe objects, hoping with a feature like this that those references are replaced by the actual object structure and therefore used right away in any other JSON-validator library/application.

    Any options I'm missing in the app?

  • 0
    Avatar
    Pascal

    Hello Miguel,

     

    Thank you for your comment.  Indeed, the feature is there specifically to help data modelers.  If you do Tools >  Forward-Engineering > JSON Schema, the references are displayed as is.  We could provide an option to render the definition instead of displaying the reference.  I'll add this to the backlog.

     

     

Please sign in to leave a comment.