Re: main and dependent objects

2012-09-13 Thread alex23
On Sep 13, 10:52 pm, andrea crotti 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

Re: main and dependent objects

2012-09-13 Thread Jean-Michel Pichavant
- Original Message - > 2012/9/13 Jean-Michel Pichavant : > > > > Nothing shocking right here imo. It looks like a classic > > parent-child implementation. > > However it seems the relation between Obj and Dependent are 1-to-1. > > Since Dependent need to access all Obj attributes, are you s

Re: main and dependent objects

2012-09-13 Thread Ulrich Eckhardt
Am 13.09.2012 14:51, schrieb andrea crotti: I am in a situation where I have a class Obj which contains many attributes, and also contains logically another object of class Dependent. This dependent_object, however, also needs to access many fields of the original class, so at the moment we did

Re: main and dependent objects

2012-09-13 Thread andrea crotti
2012/9/13 Jean-Michel Pichavant : > > Nothing shocking right here imo. It looks like a classic parent-child > implementation. > However it seems the relation between Obj and Dependent are 1-to-1. Since > Dependent need to access all Obj attributes, are you sure that Dependent and > Obj are not a

Re: main and dependent objects

2012-09-13 Thread Jean-Michel Pichavant
- Original Message - > I am in a situation where I have a class Obj which contains many > attributes, and also contains logically another object of class > Dependent. > > This dependent_object, however, also needs to access many fields of > the > original class, so at the moment we did som

main and dependent objects

2012-09-13 Thread andrea crotti
I am in a situation where I have a class Obj which contains many attributes, and also contains logically another object of class Dependent. This dependent_object, however, also needs to access many fields of the original class, so at the moment we did something like this: class Dependent: de