On Sep 13, 10:52 pm, andrea crotti <andrea.crott...@gmail.com> wrote:
> I am in a situation where I have a class Obj which contains many
> attributes, and also contains logically another object of class
> Dependent.
> But I'm not so sure it's a good idea, it's a bit smelly..

It's actually a well regarded technique known as composition:
http://en.wikipedia.org/wiki/Object_composition

While it has an ostensible focus on game development, I found this
article to be very good at explaining the concept:
http://gameprogrammingpatterns.com/component.html
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to