This question is closed. Reopen it to edit or answer.
How to derive a subclass that is a "frozen" state of another class?
1 view (last 30 days)
Suppose dynClass has lots of dependent properties calculated on the fly and/or read from private properties, based on complicated state-change-rules. I would like a statClass derived from dynClass that is essentially a snapshot of the current state of dynclass. For property values it is simple to give dynClass a to_struct() public method. But I want to call some public and protected methods of dynClass on statClass, including perhaps future ones.
Sounds easy? But what if I want to minimize changes in the complicated, legacy dynClass? I'm afraid of breaking something if I start moving too many things there! statClass however can be written from scratch.
Is this possible?