Skip to content

Instantly share code, notes, and snippets.

@vicentebolea
Created December 25, 2012 20:20
Show Gist options
  • Save vicentebolea/4375227 to your computer and use it in GitHub Desktop.
Save vicentebolea/4375227 to your computer and use it in GitHub Desktop.
Aggregation vs composition OOP
simple rule:
we have object A and object Z.
if we have a pointer from object A to object Z then its aggregation.(no pointing from Z to A ,since it maks a simple relation).
if object Z cannot exists in the system without object A, then its composition.
its not that hard, even more ITS NOT THAT USEFUL. why? beacuse no body uses this stuff to the fine lines, its a loose model that lets you grasp what you want from the system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment