You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a scope has external requirements, those objects must be provided via addBean before the scope can be built. Not doing so is an error. Without DI this error would be caught by the compiler, because you wouldn't be able to instantiate your target object at all unless you passed in what it needed, but with DI dependencies come from a dynamic map. It therefore seems to make sense if a module class had a constructor that required you to pass in these beans and automatically registered them.
The text was updated successfully, but these errors were encountered:
So a note is that we still want 'default' scope modules to be service loaded (which means that they must have a default constructor).
This change this makes good sense for 'custom' scope modules. With custom scope modules they also won't ever really be service loaded. The only downside is we have this difference between custom modules and 'default' scope modules.
Now that custom modules can have no default constructor they can not be loaded via ServiceLoader. This should not matter as it really didn't make sense to service load the custom modules anyway.
Note that the 'default' scope modules still are expected to be service loaded. That does mean that we do not create a specific constructor for 'default' scope modules. External dependencies for default modules must still be provided via withBean()
When a scope has external requirements, those objects must be provided via addBean before the scope can be built. Not doing so is an error. Without DI this error would be caught by the compiler, because you wouldn't be able to instantiate your target object at all unless you passed in what it needed, but with DI dependencies come from a dynamic map. It therefore seems to make sense if a module class had a constructor that required you to pass in these beans and automatically registered them.
The text was updated successfully, but these errors were encountered: