[OJB-developers] JNDI data stores
Brought to you by:
thma
From: Kim A. <ki...@de...> - 2002-04-26 11:55:08
|
Hi, (I've already posted this on the sourceforge forum...) I'm currently evaluating OJB for use in our current project - and I'm very impressed by the overall performance, feature set and neat design. However, we are planning to support "transparent persistence" not only with a RDBMS backend but want to use LDAP (via JNDI) as a data store. Why? Let me explain our scenario: We have a web application that has different "realms" where only authenticated users (belonging to a certain group) are granted access rights. Let's say, the company running the web application keeps all of its employees along with groups (such as "Marketing & Sales", "Public Relations", etc.) in a LDAP directory. However, the data of the company's customers is NOT kept in this directory but in a different, RDBMS-based system. The customers should have access to a certain realm within the web app and therefore must be authenticated against the RDBMS. I'm now thinking of the following algorithm to accomplish this: - I have an abstract class "User" that serves as a base class - I have the concrete classes "Employee" (that is made persistent using LDAP) and "Customer" (that is made persistent using a RDBMS) - Based on the realm I can decide whether to use "Employee" or "Customer" No problem so far as long as: 1. I implement "Employee" using the "BMP"-pattern (that is, implementing the persistence mechanism in the "Employee"-class itself) and 2. the company employee data is kept in LDAP. If I have to deploy the app in another environment, where no LDAP service exists and the employee data is kept in a RDBMS, I will have to re-implement "Employee". So I wondered if it would be possible if the persistance layer iself could do the job for me and decide in which data store to look based on its configuration for a particular environment. Unfortunately, no one seems to have implemented this already AFAIK. However, after looking through the OJB sources I found it wouldn't be that hard to "plug in" such a feature by implementing my own ojb.broker.PersistenceBroker. Sure, there would be some issues with transactions and relational logic but I think a solution can be found for this... Now my questions: Has anybody heard of some software doing this already? If not, what's your opinion about building such a thing into OJB? Anyone interested in implementing it or just discussing it with me? I'm looking forward to any comments. Regards, Kim |