in reply to Re^10: Re-blessing || Re-constructing objects
in thread Re-blessing || Re-constructing objects
Won't there be shared code that accesses internal data? Or code in one class that accesses data set by the other class?
Prior to rebless the internals structures could be converted? And even if it were necessary, why would it be a problem?
What are you gaining by re-blessing then? Sounds like you want to just read the data and make a new object.
Put the code that handles print_document() in one class, then the two classes that play rebless games inherit from that. If print_document itself only uses defined accessors to access its internal state theres no problem.
If these defined accessors are written to work with different internal structures, how can they work on the same data? If someone re-blesses an existing object from one class to the other, they still have to work. All you're doing here is pushing the problem around from one method to another.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: Re-blessing || Re-constructing objects
by demerphq (Chancellor) on Apr 18, 2006 at 21:25 UTC |