Re: ComponentContext.inject() usage in storage framework

2013-08-28 Thread Darren Shepherd
On 08/28/2013 01:41 PM, Edison Su wrote: There are cases, the object is not singleton, such as VolumeObject, but it needs to access DAO, then either we need to pass the DAOs in the VolumeObject's constructor, or through ComponentContext.inject(), or using AspectJ's @Configurable(http://static.

RE: ComponentContext.inject() usage in storage framework

2013-08-28 Thread Edison Su
x27;t be injected by IoC container by default. > -Original Message- > From: Darren Shepherd [mailto:darren.s.sheph...@gmail.com] > Sent: Wednesday, August 28, 2013 11:56 AM > To: dev@cloudstack.apache.org > Subject: ComponentContext.inject() usage in storage frame

ComponentContext.inject() usage in storage framework

2013-08-28 Thread Darren Shepherd
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(SwiftImageStoreLifeC