in reply to Reclassifying an object
The child classes could have a method to create an instance from a given parent class instance, and you can implement it any way you like - rebless the object, or rebless its clone, and so on, plus all the checks you need to allow the transition. Thus, the "dirty" code stays in the class and doesn't pollute your users' code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reclassifying an object
by Amblikai (Scribe) on Sep 29, 2015 at 11:25 UTC | |
by choroba (Cardinal) on Sep 29, 2015 at 12:01 UTC | |
by salva (Canon) on Sep 29, 2015 at 11:49 UTC |