struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Lentz <>
Subject Re: [OT] Searching for data access framework.
Date Mon, 05 Dec 2011 17:21:28 GMT
How about an object factory?

Interface - UserAuth
Implementation - LdapAuth implements UserAuth
Implementation - SqlAuth implements UserAuth

Factory (pseudo code):
if(ldap) {
        return(new LdapAuth);
else if(sql) {
        reutrn(new SqlAuth);

More pseudo code (this is inside your DAO):
UserAuth auth = Factory.getInstance(somecriteria);

From:   Balwinder <>
To:     Struts Users Mailing List <>
Date:   12/05/2011 12:13 PM
Subject:        Re: [OT] Searching for data access framework.

Hi Wes,

What I need is something like, if I want to access data from a database, 
i can use SQL, but if i change the source to LDAP then the access 
mechanism will change from SQL to LDAP specifics, now if the same data 
goes to flat file than again my mechanism will change, so all I need is 
some framework that if when source is changed its access mechanism 
should remain same. Hope this explains what I am looking for.

Balwinder Kumar

On 12/5/2011 10:35 PM, Wes Wannemacher wrote:
> I am not sure if I understand your question correctly, but the first
> thing that comes to mind -

> I would say to combine a disciplined approach of separation with a
> domain model layer, a business logic (transactional) layer and then
> IoC with Spring...
> If you were looking for more detail than that, we'll need some more
> details on your problem.
> -Wes
> On Mon, Dec 5, 2011 at 12:02 PM, Balwinder<> 
>> Hi All,
>> Can anyone suggest me a framework that can abstract the data call and 
>> source, if there exists any? Example if I want to authenticate a user 
>> my query shall not depend upon the data source, it could be any LDAP 
>> database or any file in a file system or anything else.
>> Thanks in advance.
>> Regards,
>> Balwinder Kumar
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message