I have 2 classes Job and Task. These are the rules:
- Each
Jobhas a numeric identifier. - Each
Jobhas 10 correspondingTasks. - Each
Taskhas a numeric identifier. - A
Taskcannot exist without aJob.
I am trying to build Class diagram for these 2 classes. Since Task cannot live without Job so I thought this is a composition and this is how I build the Class diagram:
But now I am confused that if this association is actually dependency:
How can I know in this case if the relationship is composition or dependency?
UPDATE
I have fixed the composition (Composite Aggregation) in the Class diagram as Thomas Kilian suggested:


