AutomaticComponentToolkit
AutomaticComponentToolkit copied to clipboard
Component Injection should not create global variables
trafficstars
Currently, component injection on the implementation side introduces static global variables - which are not a good idea in my opinion to introduce.
My suggestion would be, that we refactor component injection on the global level, and rather make it a feature of specific objects themselves. All classes that are created as return or out value of a method of an object would automatically "inherit" the injected component.
This would make a pattern very straight-forward, where people create a global context (like an "App" object) - and then use this as starting point for all further operations.
@martinweismann: I fear this is a breaking change though. Any ideas?