db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leandro Rodrigo Saad Cruz <lean...@ibnetwork.com.br>
Subject Re: wrapping OJB as an avalon component [Decomposition of OJB into components]
Date Fri, 25 Apr 2003 12:39:15 GMT
Hi Neeme.

I have two components that should be of your interest.

OJBComponent : wrapper around OJB PB api

PersistenceManager : generic persistence manager (1 impl using OJB).

I'm trying to make some components that I have available @
plexus-components. My setup is not yet done there, so I can't move my
code yet (http://plexus.codehaus.org/components/) !

Please, take a look at the interface definitions to see if this is what
you need.

Speaking about avalon components : This is something that OJB would
really benefit from. Once I proposed a refactoring of OJB code targeting
component decomposition, but this is something that I can't do alone.
Maybe its time for us (developers and contributors of OJB) to start
discussing if we can do this (decompose ojb into components) after OJB
1.0 is out.

On Wed, 2003-04-23 at 10:37, Neeme Praks wrote:
> I trying to wrap OJB as an Avalon component for use as persistence 
> engine inside avalon containers. Due to the fact that in OJB quite a bit 
> of code is dealing with component management and lifecycle and Avalon 
> containers can take care of those issues on behalf of OJB, I would like 
> to implement this component in an Avalon friendly way: by using Avalon 
> component management and lifecycle, instead of OJBs. So, here are some 
> implementation questions I have come up with...
> The main changes would be:
> * convert PersistenceBrokerFactory into an Avalon component (no evil 
> static stuff :-))
> * use Avalon configuration interfaces to load OJB properties (wrapper 
> around OJB configuration interfaces).
> * when getting a PersistenceBroker from factory, the requesting 
> component would have to supply the relevant repository.xml (as 
> inputstream, for example) and it would get back a broker that would be 
> properly configured for this particular component.
> The interface that I would like this PersistenceBrokerFactory component 
> to have is:
> package org.apache.ojb.avalon;
> import java.io.InputStream;
> public interface PersistenceBrokerFactory {
>     PersistenceBroker defaultPersistenceBroker();
>     PersistenceBroker createPersistenceBroker(InputStream repository);
> }
> When implementing this, I should check out the import 
> org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl, right?
> Then just replace some stuff like pooling with Avalon services and it 
> should work, right?
> Any comments and pointers are helpful!
> Neeme
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
Leandro Rodrigo Saad Cruz
IT - Inter Business Tecnologia e Servicos (IB)

View raw message