in reply to Re^5: Re-blessing || Re-constructing objects
in thread Re-blessing || Re-constructing objects
Then I'd ask why you wrote this code as OO, since you aren't getting a major benefit of OO: abstraction.
Dont you think thats a bit extreme? Simply because you have tight coupling doesnt mean you have sacrificed abstraction. If you can even speak of such a thing in such a way. For instance tight coupling between two classes doesnt mean that you lose any interface abstraction on the objects themselves. If A and B are tightly coupled C need not even know or care about one of them, and treat the other as simply and abstract interface.
I think it really depends on which attributes of OO you think are most important. If you think that inheritance support is the objective then I can see why tight coupling of two classes would bother you. You can't easily subclass[1]. But if you are more concerned with interface abstraction then it makes no difference. And personally ive found that interface abstraction (polymorphism) is much more commonly depended on than inheritance. If you are sane you only subclass things are designed to be subclassable in the first place. Especially in perl.
[1]: This is not strictly true. If both classes defined a sister_class property that returned the other classes name, then the tight coupling could be overriden. If you wanted to subclass either youd have to subclass both. Or you could pass the other classes name back and forth as parameters. This would mean the coupling was a lot weaker. IMO whether it made sense would depend on the circumstances.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Re-blessing || Re-constructing objects
by perrin (Chancellor) on Apr 18, 2006 at 11:07 UTC | |
by demerphq (Chancellor) on Apr 18, 2006 at 11:20 UTC | |
by perrin (Chancellor) on Apr 18, 2006 at 11:29 UTC | |
by demerphq (Chancellor) on Apr 18, 2006 at 18:45 UTC | |
by perrin (Chancellor) on Apr 18, 2006 at 20:01 UTC | |
|