From: Tom Sawyer Date: 2002-07-05T10:33:40+09:00 Subject: Re: self_parent what if it had a method argument to identify the class name: self_ancestor(Class) or the like? in this way you could move as far up as you needed without breaking code under refactorization. of course, precedence would have to be given to the first match in the case of a parent creating an instance of itself. ~tom On Thu, 2002-07-04 at 19:18, David Alan Black wrote: > Hi -- > > On Fri, 5 Jul 2002, Tom Sawyer wrote: > > > hi david, > > > > yes the REXML isn't really a good example, it was just a passing > > thought. you may a good point. using a "Factory" would add a > > consideration for self_parent's use. but i don't see how it could > > possibly "constrain code and code growth significantly." when one > > designs a program it is exactly that: designed. no what i'm saying? > > self_parent is just another tool. > > I can't argue with that last point, except to say I think there are > good tools and bad tools :-) But as for constraining code and code > growth: if different classes have hardcoded into them information > about how many method calls back certain objects were created, it > would make it essentially impossible to maintain and develop code > libraries -- because every time you did something like my example with > Factory, other people's code would break. > > Of course, there are software updates which break old code. But > modifying an API is different from asking people to change > "self_parent" to "self_parent.self_parent" (for example) because > you've refactored a class. > > > David > > -- > David Alan Black > home: dblack@candle.superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav > > -- ~transami "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin