
Hi, do we have an opportunity to avoid over layering in such case:
We have a class HrmCompEventRun, for example, and want to add a new field to its macro definition. Do we have any way to do it?
*This post is locked for comments
I have the same question (0)Regarding class extensions, you can add a new field, but you can't add it to the macro. On the other hand, you could subscribe event handlers to pack() and unpack() and deal with serialization of your field in these handlers.
If you have control over instantiation of the object, you can simply create a class inheriting from another class, add member variables and override methods. If you can't influence the construction (to provide your subclass instead of the parent class) and you consider a customization, it may be worth to customize only this piece and leaving everything else to inheritance.
The advantage of class extension is that you can potentially combine several extensions in a single class.