db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: [OJB 1.1] Initial version check in
Date Wed, 11 Aug 2004 10:52:12 GMT
Thomas Dudziak wrote:

> Armin Waibel wrote:
> 
>> First I have put most factories in OJB class, but to make OJB.java 
>> more clean I move them into a separate class. Seems to me a good idea 
>> to keep factories separate till you reworked the  OJB configuration.
>> Most factories used at initialization of PB instances.
>> We can move
>> - JdbcAccessFactory to PBF
>> - StatementManagerFactory to PBF
>> - IdentityFactory to PBF
>>
>> But for each PC we create a separate PBF, thus for each PC we create 
>> the factories again (if we keep them in OJB Factory class only once) 
>> and each PBF has its own factory instances.
> 
> 
> For the OJBConfigurator it doesn't matter, as long as it can reach 
> (set/get) the factories. Don't know about the integration with e.g. 
> Spring, though.
> 

hmm, seems easier to handle when keep the factories in OJB or Factory 
class. If someone use 10 PC, then OJBConfigurator has to take care of 60 
factory instances instead of 3. And PC can be removed at runtime and the 
OJBConfigurator has to take care of this too (if we move factories).


>> Maybe it will be better to rename connection-pool to 
>> connection-factory and specify the connection-factory class by a 
>> 'name' or 'class' attribute.
> 
> 
> How about merging it with the JCD ?
> 

Makes much sense! Add two new attributes to JCD
connection-factory
validationQuery
and pass the other proprietary properties as custom-attribute


>> I add a static method PBF#setOjb(...) to set the OJB instance. So user 
>> has to set this instance at startup of OJB.
> 
> 
> I think, at least for the 
> PersistenceBrokerFactory.defaultPersistenceBroker, a new static OJB 
> instance should be created if none was set. This way, the 'old' usage 
> style might work without any changes.
> 

+1


>> Sounds good. So all Factories have to know about OJB instance?
> 
> 
> If they are sole factories, then they don't need to. The OJB object and 
> the PC objects hold the created instances, so they should simply use the 
> factories to create instances. If however the factory does more than 
> simply create (and initialize) an object, then perhaps it should be 
> renamed/refactored/merged with some other object ?
> 

Nearly all factories are derived from ConfigurableFactory and need the 
class name of the implementation class and it will be great to allow 
properties setting in these factories too.

Armin


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

---------------------------------------------------------------------
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