By default, associations are generated automatically from the field type
Person : Address for example or Person : [ Address ] with the type enclosed in square brackets for a collection
However, it is sometimes necessary to add additional information, such as the minimum and maximum number of items in a list.
This is particularly true if you want to produce a more advanced UML-type model.
To do this, Akwatype has these attributes that you can use when a field is of a complex type.
- associationName
- Name of the association between this field and another entity
- associationType
- Type of the association (Association, Aggregation, Composition)
- minItems
- Minimum number of items allowed in a collection field
- maxItems
- Maximum number of items allowed in a collection field
- reverse
- Name of a field in the type of the current field that points back to the type containing the current field
You may also need to use the option Advanced link display option of the Data Explorer to display all the additionnal information
Example
Types
type Engine { serialNumber:String description:String horsepower :Integer }
type wheel{ id:String size:Integer model:String }
type Chassis { serialNumber:String description:String plateforme:String }
type Person { id:String name:String firstName:String cars:[Car]{ associationName: "own" } }
type Car { Vin: String brand: String engine:Engine{ associationType: "Composition" associationName: "powered by" minItems: 1, maxItems: 1 } weels:[wheel]{ associationType: "Aggregation" associationName: "has" minItems: 3, maxItems: 4
} chassis : Chassis{ associationType: "Composition" associationName: "Build on" minItems: 1, maxItems: 1 } owner:Person{ reverse: cars minItems: 1 } }