sting-ioc / sting

https://sting-ioc.github.io
Apache License 2.0
8 stars 0 forks source link

Add the ability to override existing bindings #14

Closed realityforge closed 4 years ago

realityforge commented 4 years ago

Add mechanisms for overriding bindings already added to object graph. This may be implemented by adding an override=ENABLE|DISABLE|AUTODETECT parameter which indicates whether the binding can override existing bindings. Order in includes matters in this scenario. This will default to AUTODETECT which will evaluate to DISABLE in all scenarios except when the binding is from a descriptor declared as a nested class of the injector. Overrides can either be by id or published types.

Once completed this should be added as a pro for Sting when comparing with dagger.

realityforge commented 4 years ago

After converting several applications it is unclear whether this is actually required. We have not yet needed it yet if the fragments are managed carefully. Will move it to a later release.

realityforge commented 4 years ago

After converting several projects to sting, it was found that this no longer seemed necessary if you crafted fragments carefully. Putting a hold on this change for now.

realityforge commented 4 years ago

Further experimentation seems to indicate that this is not really needed and really is just a crutch used in earlier DI systems that did not require the level of proceciseness required by sting