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
Currently, Tegral DI uses a simple system for storing components: just a map from Identifier to anything they need (currently, all environments use a simple Map<Identifier<*>, Any>, where Any is the actual instance of the object we are interested in).
While this is alright, it poses a problem for advanced scenarios. For example:
Factories, or anything that is wrapped via some injected helper object. This makes it impossible to use the by scope() mechanism to retrieve them, and alternatives must be used (e.g. by scope.factory())
Services cannot really rely on the actual type of the object, the only "stable", non-hacky typing information is contained in the identifier. Yet, the identifier is not always accurate w.r.t. the actual type of the object. For example, the following structure will not actually trigger the start() function:
Currently, Tegral DI uses a simple system for storing components: just a map from Identifier to anything they need (currently, all environments use a simple
Map<Identifier<*>, Any>
, where Any is the actual instance of the object we are interested in).While this is alright, it poses a problem for advanced scenarios. For example:
by scope()
mechanism to retrieve them, and alternatives must be used (e.g.by scope.factory()
)start()
function:An alternative is supporting a standardized and more complete way to store identifiers, such as:
This is more flexible in pretty much every way.
declarations
would be part of the public API of all environments (including not extendable ones)The text was updated successfully, but these errors were encountered: