Open shochdoerfer opened 7 years ago
Just a quick thought: As for primitive value injection we could potentially do some name matching with the parameters injected to the bean configuration method.
Didn't have much time to work on this, but I'm currently building Roave/DependencyResolver (currently private).
The idea is to have following:
What you'd do is probably expose a CLI script to generate factory snippets to be copied in the container. What you will get from Roave/DependencyResolver is a framework-agnostic dependency graph that you can traverse and modify.
Instead of sprinkling annotations in the whole code base to configure setter injection, named injection etc. we could simply add those annotations to the bean configuration method.
As discussed with @Ocramius today it would make sense for Disco to be able to support autowiring for bean instances to reduce the amount of configuration code needed and to be able to get rid of traits for structuring the configuration code.
The following configuration:
could then be simplified like this:
At a later stage we could move the methods into separate interfaces - to be able to get rid of the
abstract
keyword and ultimately get rid of the trait approach.A few problems need to be solved: