Open F43nd1r opened 4 years ago
I see two ways of solving this.
One would be to include something like your SpringComposite
in the Spring integration. The drawbacks here are that you'd need to do something special when using Spring and that the same implementation would have to be separately replicated for CDI as well.
The other alternative would be to make the core Composite
class use Instantiator
instead of ReflectTools
for creating the instance. This would mean that it would automatically work for both Spring and CDI users and that you wouldn't even have to inject the composite instance. The drawbacks would be that Composite
would then only be possible to instantiate when VaadinService.getCurrent()
is defined and that there's a possibility of surprises for existing applications if old composites would suddenly start behaving as Spring/CDI beans.
I would personally prefer the second option, but any built-in solution would be appreciated.
I have a class like this
which I would like to use in a composite:
This is currently not possible. My workaround is to extend Composite:
It would be nice to have this work out of the box.