What I have googled so far Aggregation means that something can be part of something but doesn't need. Composition means that after parent component is destroyed, child is destroyed too.
But then I encounter following sentence in GoF book Design Patterns: "Aggregation implies that an aggregate object and its owner have identical lifetimes", which directly contradicts to what I have learned so far.
Funny is that I only found this explanation in this book and nowhere else, so who may to say that they are wrong :) I would rather say that whole google is wrong rather than this guys.
Aucun commentaire:
Enregistrer un commentaire