The new storage framework uses ComponentContext.inject() extensively. Why is that? ComponentContext.inject() should really never be used. It breaks IoC and DI patterns.

For example, in configure() of SwiftImageStoreProviderImpl it does

lifeCycle = ComponentContext.inject(SwiftImageStoreLifeCycleImpl.class);
driver = ComponentContext.inject(SwiftImageStoreDriverImpl.class);

Why not just do the below? It keeps the IoC/DI pattern and should do the same thing.

@Inject
SwiftImageStoreLifeCycleImpl lifeCycle;
@Inject
SwiftImageStoreDriverImpl driver;


Darren

Reply via email to