You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by William Mee <wi...@ivistar.de> on 2002/12/02 15:46:14 UTC

Abstracting the persistence layer (was: Use of ODMG transactions)

Hi Thomas,

I would also be keen to abstract the persistence layer in the application
I'm working on. I've never worked with TopLink, so I'm not familiar with the
API. Can you post the interfaces you're using?

Thanks,

Will

On Mon, Dec 02, 2002 at 03:40:54PM +0100, William Mee wrote:
> In fact we are doing this in my companies business frameworks. We 
> support TopLink and OJB as strategic persistence layers. (There is also 
> a LDAP implementation)
> A customer may choose to use either OJB or TopLink.
> 
> We provide a very thin abstraction layer above the persistence layers.
> 1. There is a Session interface used to connect to the backend datastore 
> with username and password.
> 2. there is a Transaction (or unit-of-work) interface with methods for 
> beginning, commiting and aborting transactions, methods to register 
> objects to the transaction and a methods to perform Queries.
> 3. A query API with an AST representation of queries. (We are using the 
> OJB Query package here). A good choice could be to use SODA 
> (http://www.odbms.org) as abstract query syntax!
> 
> All you have to do to plug in a concrete persistence layer is to
> 1. provide a SessionImpl,
> 2. provide a TransactionImpl
> 3. provide a Translator that translates the AST queries representation 
> into the query representation of the concrete persistence layer.
> Building this translator for TopLink was *very* easy, as the TL 
> expressionbuilder is quite similar to OJB queries.

-- 
William Mee

IVISTAR Kommunikationssysteme AG (www.ivistar.de)
Ehrenbergstraße 19
10245 Berlin, Germany
Tel: +49-(0)30-44678224
Fax: +49-(0)30-44678223