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
Many features that more complex DI frameworks provide can be done in init by simply transforming the configuration.
For example, consider Spring's @Conditional annotation, which will include beans only when certain conditions are met. Common examples are the presence of a certain class on the classpath (e.g. to auto-configure adapter beans) or beans of certain types (e.g. to provide defaults).
In init, we can simply discover the configuration, then remove components whose prerequisites are not met.
How do we configure such conditions? We can use tags, and/or add custom keys to components (components are just maps). When discovering components from vars, we can access the var's metadata.
How do we configure transformers? Since discovery + starting are two separate steps, we can transform the configuration before starting the system.
Explore:
Would it be convenient to discover transformers automatically, e.g. find components that are transformers?
Maybe provide a set of curated transformers?
conditionals
order-only dependencies
CDI-style alternatives
components that take the system map itself
etc.
This could be a convenient way for devs to pick the "features" they want, and be inspired to explore their own.
The text was updated successfully, but these errors were encountered:
Many features that more complex DI frameworks provide can be done in init by simply transforming the configuration.
For example, consider Spring's
@Conditional
annotation, which will include beans only when certain conditions are met. Common examples are the presence of a certain class on the classpath (e.g. to auto-configure adapter beans) or beans of certain types (e.g. to provide defaults).In init, we can simply discover the configuration, then remove components whose prerequisites are not met.
How do we configure such conditions? We can use tags, and/or add custom keys to components (components are just maps). When discovering components from vars, we can access the var's metadata.
How do we configure transformers? Since discovery + starting are two separate steps, we can transform the configuration before starting the system.
Explore:
This could be a convenient way for devs to pick the "features" they want, and be inspired to explore their own.
The text was updated successfully, but these errors were encountered: