I am trying to understand the relationship between classes in Object oriented world, and came across various terms like:
Association
, Aggregation
, Composition
, Dependency
, Generalization
, Realization
, Using
(and may be there are more to the list, which I would encounter soon).
I came across the following UML diagram:
Here, we have two different Classes (and so objects), Car
and Road
, and the connector symbol connecting them (and I believe it is directed association symbol, as per MS Visio).
So this means that Car
and Road
classes are having some relationship (association). I have some doubts on this to understand this relation:
1) How would this relationship be translated to Java classes? I am having difficulty in understanding how Car
and Road
would have "some code" connecting them?
2) what does *
and 0..1
mean in this diagram? Usually I have seen these in an Entity-Relationship diagrams (in DB).
Any pointer to understand this would be of great help.