Now then, implementing it requires overriding every non-private member of the base component class which could get annoying if there are many of them and/or if they change frequently due to heavy development. This annoyance could be alleviated by code injection done by the compiler in response to a new Decorator attribute:
class Component
def foo
pass
def bar(i as int)
pass
def baz(s as String, i as int) as String
return s[i].toString
class ComponentDecorator inherits Component has Decorator
var _component as Component has Decorator
cue init(component as Component)
base.init
_component = component
Due to seeing the Decorator attribute on the class and on the var, the compiler would generate these:
class ComponentDecorator inherits Component has Decorator
# auto-generated:
def foo
_component.foo
def bar(i as int)
_component.bar(i)
def baz(s as String, i as int) as String
return _component.baz(s, i)
If you provided an implementation of any of the methods yourself, it would be skipped.
This would work the same whether the base component was an interface or a class.
Thoughts?