Skip to content

Instantly share code, notes, and snippets.

@jpukg
Forked from vicentebolea/gist:4375227
Created October 15, 2015 11:30
Show Gist options
  • Save jpukg/08525d90ecbdf26e3428 to your computer and use it in GitHub Desktop.
Save jpukg/08525d90ecbdf26e3428 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