towards Class config that does not fill the prototype

towards Class config that does not fill the prototype

Hi all,
I like not to be forced to write setters and getters - and hence the idea of a config object that populates its own functions. However the current implementation has a problem imho with the fact that it places non-primitive Objects (like arrays and {}) in the prototype. Problems soon arise when multiple instance of the same class are being created...

This is an attempt to provide a fix:
- only primitive, functions or null configs are put in the prototype.
- instead of using 'set/get' + configName, the setter and getters are just functions with the same name of the config. When called with an arguments, it will be the setter (returning this), without arguments, the getter. It is faster to write, and allows method chaining (see example below).
- for types other than primitive, the configs are applied only the first time the setter/getter is called. The default config is still available, but it is applied to the instance and not the Class.
- apply and updates functions work as without the fix.

You could just create an abstract component or an override to call initConfig in the constructor.

Thanks for the answer.

I am not sure I get why creating an abstract component would solve the problem of having non-primitive config object filling-up the prototype and hence shared by all class instance. But I am certainly missing something.
Nevertheless, this is what I am trying to solve here