@startuml
skinparam componentStyle uml2
package "'Customers' Aggregate" <<Rectangle>> {
class Customer <<(A,#fffab8) Aggregate Root>> {
Address address
void anotherMethod(Name name)
ReturnTypeEntity yetAnotherMethod()
}
class Address <<(E,DarkSeaGreen) Entity>> {
String name
}
class Name <<(V,DarkSeaGreen) Value Object>> {
String first
String last
}
class ReturnTypeEntity <<(E,DarkSeaGreen) Entity>> {
int i
}
}
Customer --> Address : lives at
Customer --> Name : uses
Customer --> ReturnTypeEntity : needs something
@enduml
However, maybe a rethink of the generation of relationships is in order. The References in Parameter and ReturnType that are used to generate the relations are actually dependency relations, not associations that express a deep semantic relationship. And it is debatable whether you always want to have all those dependencies in your class diagram, it can become quite cluttered. Is it possible to have a means for configuration in the CML file, so the generator can produce different variants based on what the user wants?
Maybe extending the grammar is a better idea, so users can model relationships themselves. What do you think?
Another thing that I see is that having a Reference for a collection type (e.g. - Set<@Book> books) generates an aggregation relationship (i.e. Order o-- Book : books). Shouldn't that be composition? Isn't any collection with a reference to an entity in the same aggregate composition and a reference to another aggregate aggregation?
This change is a simple way to add custom labels to the relationships that are generated in the class diagram.
This CML:
generates this PUML:
However, maybe a rethink of the generation of relationships is in order. The References in Parameter and ReturnType that are used to generate the relations are actually dependency relations, not associations that express a deep semantic relationship. And it is debatable whether you always want to have all those dependencies in your class diagram, it can become quite cluttered. Is it possible to have a means for configuration in the CML file, so the generator can produce different variants based on what the user wants?
Maybe extending the grammar is a better idea, so users can model relationships themselves. What do you think?
Another thing that I see is that having a Reference for a collection type (e.g. - Set<@Book> books) generates an aggregation relationship (i.e. Order o-- Book : books). Shouldn't that be composition? Isn't any collection with a reference to an entity in the same aggregate composition and a reference to another aggregate aggregation?