The creation and management of types is essential to model a business domain accurately and consistently. In Akwatype, types are fundamental elements for structuring data, incorporating advanced description options to ensure a comprehensive representation of the domain. This page explores in detail the possibilities offered by Akwatype for describing and organizing types to build a rich and flexible data model.
Learn more about the different type in Akwatype
Defining Types and Attributes in Akwatype
In Akwatype, a type is defined by a set of attributes, each with specific characteristics. These types form the basis of the entities and ensure consistent organization of the data in the model.
Attributes and Data Types: Attributes of each type are defined with specific data types (e.g., String, Integer, Boolean, Date) to validate the information stored. This ensures data consistency and compatibility throughout the model.
Advanced Attribute Properties: In addition to the basic types, Akwatype offers specific properties for each attribute, such as maximum string length or validation rules (e.g., regex) to control data formats.
Tags and Metadata: Each type and attribute can be enriched with tags and metadata to provide additional contextual information. For example, tags can indicate whether a field is sensitive (e.g., for GDPR compliance), while metadata enables the model to be better documented.
These characteristics enable capturing all the business-specific aspects of an entity, offering a rich and precise description of types.
Advanced Description Options for Types
Akwatype offers advanced features to further enrich type descriptions and guarantee the model's modularity and flexibility:
Compound Types: In addition to simple types, Akwatype lets you create compound types that combine several attributes into a single structure, facilitating the reuse and management of complex entities.
Custom Data Types: Akwatype allows the creation of custom data types to meet specific business domain requirements. For example, an Address type could include sub-attributes such as Street, Postcode, and City.
Documentation Properties: Detailed descriptions and notes for users can be included in types and attributes. This facilitates understanding of the model and improves communication between teams.
Enums: Enums allow defining fixed lists of values for certain attributes, limiting the available choices (e.g., Active/Inactive for a status). This enhances data validation and consistency.
Custom Properties: Akwatype supports adding custom properties to types and fields, enabling project-specific metadata management, such as regulatory requirements or company-specific information.
Tags: Tags can be applied to fields and are propagated across facades, allowing fields to be marked as sensitive (e.g., @GDPR for personal data) and tracked in API and message views.
Nomenclatures: Akwatype enables entering nomenclatures used for certain fields, such as lists of stable reference values (e.g., countries, skills), simplifying graphical representations and ensuring consistent data.
These extensive features enable the creation of rich descriptions that meet a variety of needs while ensuring model clarity and standardization.
Structuring and Organizing Types in Akwatype
Akwatype allows types to be organized logically, simplifying the management of complex data models. Clear organization of types improves readability and facilitates their management throughout the project lifecycle.
Use of Type Groups: Types can be grouped into logical categories or modules (e.g., customers, products, orders), making the model easier to navigate and understand.
Modularity and Reusability: Modularly defined types can be reused in different project contexts, allowing standardization of entities and enhancing the model's flexibility to meet evolving needs.
Facades for Contextual Adaptation: Akwatype's facades enable types to be adapted to specific contexts, such as APIs or events. This ensures model consistency while offering adapted versions of types tailored to the context of use.
Consistent Documentation and Naming: Detailed descriptions and clear naming conventions should be adopted for each type and attribute. This improves accessibility for all stakeholders.
This structured organization of types allows managing data models in a consistent and scalable way, adapting to project changes without compromising clarity.
Example of a Type Description
Below is an example of a product type description:
type Product {
properties {
label: "Product description"
primaryKey: code
}
code: String {
label: "Product code"
maxLength: 50
example: "P12345"
}
name: String {
label: "Product name"
maxLength: 100
example: "Wireless Mouse"
}
description: String {
label: "Product description"
maxLength: 500
example: "A high-quality wireless mouse with ergonomic design."
}
price: Decimal {
label: "Product price"
min: 20.00
example: 29.99
}
category: Category {
label: "Product Category"
minItems: 1
}
supplier: Supplier {
reverse: products
}
stock: Integer {
label: "Stock quantity"
min: 0
example: 12
}
}
Conclusion
Akwatype offers powerful tools for the comprehensive and flexible creation and management of types. By integrating features such as tags, metadata, enums, and compound types, teams can structure data in a rigorous and adaptive way. A well-designed data model with clearly defined and documented types facilitates communication between teams and lays the foundation for a robust and scalable data architecture.