UML Can a relationship be composition AND aggregation? -


I have a situation where Class A is B and B is not present without B, but from B Can be free.

It is a composition relationship with A's perspective, but this is a holistic relationship with the perspective of B.

What do I do?

If A is made of B, then it is related to written endings on a square. Combination and aggregation ends on association, on the other hand it is possible to structure on one side and aggregation.

You can identify the structure by answering the question. Is the class B is Class B? If so, then it is on the side of class A ... Example: Is computer made of memory, CPU etc.? All computer components are in the computer's structure.

Example for aggregation: A special chair is placed in the room, it is a combination because the room is not a chair (room is made of walls, window etc.). But the chair can be in the room with the furniture.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -