dimanche 3 décembre 2017

Design pattern for a situation where some objects belong to one object

I have a situation where I want to consider various object to belong to another object. Is there a design pattern to model this? The owned objects should be able to access methods of the owner.

I was considering to add the „owner“ object as a property of the other objects but I am trying to avoid having multiple copies of the owner object. Since I am working with Python I think that saving a reference is not possible.

Aucun commentaire:

Enregistrer un commentaire