A small question regarding application architecture:
I have a python script working as a daemon.
Inside, I have many objects, all inherited from one class (let it be called its "essence")
I also have one main object, let it be "topsys"
Entities are identified by a pair (id, type (= class, roughly)), and they are connected in many evil ways. They are also created and deleted all the time, and they need to access other objects.
So, I need a view of the repository, basically a dictionary of dictionaries (one for each type) containing all entities.
And the question is which is better: attach this dictionary to "topsys" as an object or an object of a class, as a property of a class? I would choose the second one (so entities should not know about the existence of "topsys"), but I donβt feel good about using properties directly in classes. Or maybe there is another way?
source share