db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <to...@first.fhg.de>
Subject Re: [RFC] Using IoC for initializing the OJB runtime (OJB 1.1)
Date Tue, 26 Oct 2004 14:51:08 GMT
Leandro Rodrigo Saad Cruz wrote:

>On Tue, 2004-10-26 at 15:10 +0200, Thomas Dudziak wrote:
>  
>
>>Hi folks,
>>
>>Armin and I were chatting the other day about making the whole 
>>initialization and configuration of OJB more flexible and loose-coupled. 
>>So I ventured into the 'depths' of IoC, more specifically PicoContainer 
>>and Spring, to see whether they could help us there. As a result I came 
>>up with the concept of an ObjectFactory (see the interface below) as 
>>well as two implementations using PicoContainer and Spring's 
>>BeanFactory, respectively.
>>    
>>
>
>Nice. but could we call it ObjectContainer, or something like that ?!
>  
>
No problem, the name is not chiseled in stone :-) How about 
ComponentContainer or something to avoid confusion with object-handling 
altogether ?

>I'm asking this because I'm working on a ObjectFactory class that should
>be used to create instances of objects on RowReader, instead of using
>the ClassHelper. I'm just writing some tests to commit.
>It's use is optional, just add an attribute to your repository.xml.
>I'm working on this because we don't have a nice solution to integrate
>persistent objects into a container managed environment.
>The initialization-method is just not good enough !
>  
>
Right, didn't have the time yet to look at it in detail, but my first 
impression was that an easier way to accomplish this is to have the 
factory-class handled by the ComponentContainer too. This way, you can 
have singleton instances (the factory-method is not required to be 
static). Then there would be no need to add the useObjectFactory 
attribute and you won't have to wire this factory into OJB. A simple 
call to container.getInstance(classDesc.getFactoryClass()) - or better a 
variant of this method that creates a singleton if not yet defined - 
would suffice, wdyt ?

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message