More Related Content Similar to Tutorial Expert How-To - Add reusable Definitions (20) More from PascalDesmarets1 (12) Tutorial Expert How-To - Add reusable Definitions2. Why reusable definitions?
• To increase productivity
• To increase convenience
• To increase consistency
• To achieve higher data quality
• To achieve higher degrees of governance
• To stitch together different domain models into an umbrella model
• Create and maintain object definitions that can be reused in multiple
places
Copyright © 2016-2023 Hackolade 2
3. About definitions
• At 3 levels:
• Internal definitions: at the entity level
• Ensure JSON schema compatibility
• Noted as (i) in the ERD view
• Model definitions: at the model level
• Noted as (m) in the ERD view
• Different names in some targets:
• “User Defined Types” in some relational targets
• “Definitions” in Swagger
• “Components” in OpenAPI
• External definitions: across data models
• Noted as (e) in the ERD view
Copyright © 2016-2023 Hackolade 3
4. Convert an object into a model definition
• ERD and schema tree view updated
• Model definitions tab is updated
Copyright © 2016-2023 Hackolade 4
6. Maintain definitions
• In Model Definitions tab: changes immediately reflected wherever
referenced
Copyright © 2016-2023 Hackolade 6
7. JSON Schema Preview
• Using $ref syntax
• Referenced, Resolved and Internal
views
Copyright © 2016-2023 Hackolade 7
8. Resolved and Internal view
Copyright © 2016-2023 Hackolade 8
Resolved: the $ref pointer is replaced by the actual
structure of the definition
Internal: the model definition is converted into an internal
definition for the entity, according to the JSON Schema standard
9. Deviate from a definition
• By creating a 2nd definition that
matches new needs
• By replacing the definition with
attributes
Copyright © 2016-2023 Hackolade 9
11. External definitions
• External files:
• Hackolade data model
• JSON schema
• Swagger/OpenAPI specs
• Can be referenced in whole or in
part
• Note choice of path!
• Avoid too many recursive
references!
Copyright © 2016-2023 Hackolade 11
12. Reading material
• See Hackolade online documentation
• The Hackolade Blog
• This excellent new book:
MongoDB Data Modeling & Schema Design
• Many of the principles in the book are related to query
driven modeling based on access patterns!
• Hackolade’s on social media: LinkedIn page, Twitter page
• Download Hackolade studio for free
Copyright © 2016-2023 Hackolade 12