-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Best way to build extensibility into hibernate schema
PostPosted: Fri Nov 07, 2003 3:20 pm 
Beginner
Beginner

Joined: Tue Sep 30, 2003 4:16 pm
Posts: 33
Here's the scenario: I have an open source library called Informa which uses Hibernate for it's persistence layer. (It's an RSS library but that doesn't matter.)

The users of my library (apps that call Informa, call them client apps) have additional information that needs to be persisted, much of it associated with existing Informa/Hibernate objects, some not.

Here are the choices I can think of:

1. Use a different, non Hibernate scheme in the client apps. The library saves its state via Hibernate and everything else is saved elsewhere. There are many problems with this, it is inelegant and hard to make work reliably.

2. Use hibernate in the client apps, but a separate hibernate schema and a separate sql db. Figure out how to make transactions across both dbs to ensure consistency. This is better but still not elegant. But it does maintain decoupling between library and client app.

3. Use hibernate and somehow store the client apps records in the same database. This would be cool but seems hard because the schema of the database somehow has to combine info from both the library and the client app.

4. Build 'extensibility' into the library's schema. Essentially allow the client app to put references to its custom objects into a field of the existing libraries objects called something like 'client info.' The client could gen up the right objects and attach them to the appropriate library object and have them be persisted right along the library objects by informa. Make sure that the attached client info objects are serializable.

Does this analysis make sense? Did I leave any out?

(4) seems the best to me, but I don't know how to build it with Hibernate.

Thanks.

Pito


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.