UML Class Diagram Relations

CLASS RELATIONS

Aggregation (COMPOSITION related)

Represents a has-A relation between 2 objects


Composition (COMPOSITION related)

Represents a has-A relation. But, the object being referred cannot exist without the parent.


Generalization (INHERITANCE related)

Is-A relation between 2 classes (Represented as 'Inheritance' in diagram. But called as Generalization)


Realization (INHERITANCE related)

Is-A relation between a class and an interface.



Association

1. Represents 1-1/1-Many/Many-1 relation between 2 classes. Bi-directional*
2. Represented as an arrow with role and multiplicity of the relation at the ends of the arrow.
                        

Dependency

Same as Association. But, changes made to the dependent class impact the source.

Comments

Popular posts from this blog

Distributed database design using CAP theorem

SQL Analytical Functions - Partition by (to split resultset into groups)

Easy approach to work with files in Java - Java NIO(New input output)