Code generation from UML Classdiagram

I assume you’re asking for the difference between association and aggregation.

Association can be seen as “object A has object B.” Typically, this would be in the form of a member in code. This specification is quite simple and can sometimes be too vague, which is why we also have aggregation and composition.

Aggregation can be seen as “a collection of class B forms object A.” For example, a group of employees make up certain department. Keep in mind this is different from composition where the association here is stronger. For example, I see composition as “a collection of class B forms object A and needs A to stay alive.” For example, going back to the department/employee example, we can have departments composing a store. For me, the easy way to see this is if the store was destroyed, then its departments are destroyed along with it whereas if the department is destroyed, the employees remain (assuming they don’t get immediately fired but even then, we would have a record of the employee so in terms of software data, the employee remains).

I hope this helps. I also found this web page that may explain it better than I have: http://ootips.org/uml-hasa.html