If we start introducing factories and other APIs where the user needs to override some functions, this needs to be dead simple in any language including C as well.
Right now efl_object_override has a major limitation: It can only be done once with a single array of functions. Here are my proposals:
- Allow multiple calls to efl_object_override, and replace functions as we add new ones
- Setting a function ptr to NULL means revert back to the original (parent class) implementation
- All function ptr set to NULL means no more override
- efl_class_name_get() needs to return not just "Efl.Override" but also the class name of the original object (necessary for debugging!)
The current implementation is what it is now because of fears that overriding functions may lead to undefined behaviour. Also we can not layer multiple overrides, i.e. if a function is overriden once, then we can override it a second time but then the first override becomes inaccessible (efl_super can not support that).
Unless there are good reasons not to apply my proposed changes I will implement them.