AutomaticComponentToolkit icon indicating copy to clipboard operation
AutomaticComponentToolkit copied to clipboard

Component Injection should not create global variables

Open alexanderoster opened this issue 5 years ago • 1 comments
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.

alexanderoster avatar Jul 28 '20 08:07 alexanderoster

@martinweismann: I fear this is a breaking change though. Any ideas?

alexanderoster avatar Jul 28 '20 08:07 alexanderoster