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: [Proposal] Get rid of singletons
Date Sat, 12 Jun 2004 17:32:46 GMT
On Sat, 12 Jun 2004, Armin Waibel wrote:

> > There needs to
> > be only one static/singleton class which holds the configurations for
> > all running OJB 'instances' (e.g. when multiple instances of OJB for
> > different databases and models are running in the same or in
> > different threads).
> 
> I think this should be optional (if possible). The PB-api use a static 
> PBFImpl instance, so IMO this is the "natural" entry point to OJB.

I for one need this feature (multiple OJB's in the same thread) and
currently I have to put all models in the same repository.xml which is
at least unconvenient and for some scenarios impossible (name clashes or 
different configuration requirements).

> > Factories can then be simple objects (no need to make
> > them static).
> 
> I don't want to use static instances in PBFImpl class, all factory 
> classes should be non static objects.

+1, within the constructors they can get resources from wherever they need
to

> > The prime candidate then would be the MetadataManager.
> 
> hmm, IMO the metadata manager is a service of the kernel API (PBFImpl 
> class). But it wouldn't be a problem to invert hierarchy and let PBF a 
> service of metadata manager.

As long as something like 

PersistenceBrokerFactory.defaultPersistenceBroker()
PersistenceBrokerFactory.createPersistenceBroker(key)

works, I don't mind ;-) Put I though something like the metadata manager
(or a configuration manager ?) would be a more natural candidate because I
have several scenarios where I setup OJB dynamically which starts with
the metadata manager (connection repository etc.)

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