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.
Because I want to take advantage of another benefit of OO - polymorphism?
There are many common approaches for doing the kind of thing you describe that don't require breaking encapsulation.
Yup. But sometimes adding that extra layer of indirection makes things harder to understand rather than simpler, and sometimes breaking encapsulation of implementation doesn't hurt anybody.
I agree that reblessing is usually a sign of a design gone wrong - but sometimes it is the simplest solution. And that's fine with me as long as it doesn't get in the way elsewhere.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Re-blessing || Re-constructing objects
by perrin (Chancellor) on Apr 18, 2006 at 14:26 UTC | |
by adrianh (Chancellor) on Apr 18, 2006 at 14:40 UTC |