Consider the following:
class A {}
class B {
private A[] a;
}
How would I represent the relationship between A and B on a class diagram? I would use composition / aggregation if B only held a single A (as opposed to an array), but in this case I’m not sure what should be done. Your help would be much appreciated!
Changing a single reference to an array doesn’t change the meaning of composition..
It is still a
composition..By
compositionyou mean some class A, is composed of a single instance of another class B (One-to-One Mapping), or a list of instances (One-to-Many Mapping)