You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Graham <dg...@hotmail.com> on 2002/10/04 23:28:34 UTC

[OT] RE: Persistence Framework Comparison?

I think you missed the point.  Yes, JDO lets you program to an interface 
with multiple vendors competing on implementations.  But what if you don't 
want to use JDO?

This is a layer above all persistence frameworks (JDBC, JDO, EJB, OJB, etc.) 
that your application programs to.  If you decide to change persistence 
frameworks, most of your code remains unchanged because it doesn't know 
which one you're using.

I, and others, have rolled our own but I think it would be useful for 
Jakarta Commons to provide this framework (similar to their logging api).

Dave


>From: "James Higginbotham" <jh...@betweenmarkets.com>
>Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>Subject: RE: Persistence Framework Comparison?
>Date: Fri, 4 Oct 2002 16:18:10 -0500
>
>Oh, then what you are looking for is the ODMG API for object databases,
>Sun's JDO (not Castor's JDO), or something similar. That is the purpose
>of those 2 APIs at least, abstracting object storage frameworks.
>
>James
>
> > -----Original Message-----
> > From: V. Cekvenich [mailto:vicc@users.sourceforge.net]
> > Sent: Friday, October 04, 2002 4:03 PM
> > To: struts-user@jakarta.apache.org
> > Subject: Re: Persistence Framework Comparison?
> >
> >
> > (Sorry, I can't read inline comments)
> > "I'm curious why you think there would be any glue code needed?"
> >
> > It would not be Struts centric, agree. I have said to you Craig in
> > person that I think one of the many reasons Struts was so
> > successful is
> > that it stayed above the persistence fey.
> >
> > My wish was for a persistence or a ADO interface, and
> > interface only, in
> > Jakarta or else where respected.
> >
> > When the person I responded to said words to the effect " it
> > was painful
> > to switch persistence frameworks" I said I wish there was an
> > interface.
> >
> > If there were such an interface one could switch from JDO to
> > ORB to OJB
> > to EJB to Simper to DAORowset to xyz, assuming other followed the
> > interface. Let them compete.
> >
> > Such interfaces would have to be very light weight. (Ex:
> > find(), save(),
> > commit(), getProperty(""); setProperty("", Object))
> >
> > It could be used by anyone, not just all beans! WebServices,
> > JTable, etc.
> >
> > What it allows clients to do is make it easier to switch persistence
> > layer that they outgrow or does not have good support, etc.
> >
> > Sort of like we say presentation layer should be replaceable
> > and X:tag
> > and Stxx lets you go PDF or else, same shold be on persistence. We
> > should be able to switch.
> >
> > The glue is not one of my reasons at all. But it would make Struts
> > examples better. (One Struts book out there has a getter
> > property that
> > accesses the db connection.... in the getter!! But that is
> > not a Struts
> > issue.)
> >
> > This is not just theory, my clients use a DAO interface I
> > made up, that
> > I can wrap around major persistence layers. The beans are
> > isolated from
> > how this happens, and it works.
> > (this interfaces is public in a "good practices" sample Struts app,
> > everyone knows were).
> >
> > hth,
> > V.
> >
> >
> >
> >
> >
> >
> >
> >
> > Craig R. McClanahan wrote:
> > >
> > > On Fri, 4 Oct 2002, James Higginbotham wrote:
> > >
> > >
> > >>Date: Fri, 4 Oct 2002 15:11:53 -0500
> > >>From: James Higginbotham <jh...@betweenmarkets.com>
> > >>Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> > >>To: Struts Users Mailing List <st...@jakarta.apache.org>
> > >>Subject: RE: Persistence Framework Comparison?
> > >>
> > >>
> > >>>>(I wish Struts had a non implemented persistance interface)
> > >>>
> > >>>Really?  I think Struts is quite good at what it does, and to me,
> > >>>persistence seems to outside the scope of a web application MVC
> > >>>framework.
> > >>
> > >>Agreed. Struts does what it does best - web MVC framework. What the
> > >>original author of the comments (sorry, lost in my mailbox
> > right now)
> > >>is looking for is what I would recommend happen on top of Struts.
> > >>Something that takes Struts, a proven OSS O/R framework,
> > and some glue
> > >>to make DB-driven Struts applications faster to develop.
> > >>
> > >
> > >
> > > If I ever had time to work on such a framework, I'd
> > probably do it in
> > > the Commons project at Apache, because it would be generally useful
> > > (both inside and outside of Struts).  Alas, given my work schedule,
> > > assuming I'd have time for this is probably wishful thinking :-).
> > >
> > > But, I'm curious why you think there would be any glue code
> > needed?
> > > Isn't it just a matter of using the persistence framework directly
> > > from your DAOs (or from your Actions if you don't use
> > DAOs)?  At most,
> > > I could only conceive of perhaps providing a Struts PlugIn to
> > > initialize such a framework, but maybe I'm missing something.
> > >
> > > What would definitely be useful is some example apps that
> > illustrate
> > > how apps can leverage things like this.  There are several
> > pointers in
> > > the Resources pages to such things.
> > >
> > >
> > >>Anything like that out there? Anyone working on this or have one in
> > >>the planning stages? I've been wanting to craft one myself, but
> > >>haven't had the time. But if one existed, I'd problem knock out a
> > >>couple of pet projects faster.
> > >>
> > >>James
> > >>
> > >
> > >
> > > Craig
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-> unsubscribe@jakarta.apache.org>
> > For
> > additional commands,
> > e-mail: <ma...@jakarta.apache.org>
> >
> >
>
>--
>To unsubscribe, e-mail:   
><ma...@jakarta.apache.org>
>For additional commands, e-mail: 
><ma...@jakarta.apache.org>




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [OT] RE: Persistence Framework Comparison?

Posted by Bryan Field-Elliot <br...@netmeme.org>.
On Fri, 2002-10-04 at 15:28, David Graham wrote:

This is a layer above all persistence frameworks (JDBC, JDO, EJB, OJB,
etc.) 
that your application programs to.  If you decide to change persistence 
frameworks, most of your code remains unchanged because it doesn't know 
which one you're using.



I just don't think it's feasable to design a single, one-size-fits-all 
abstraction mechanism for all persistence layers. Many persistence
systems have different tricks and different emphases which defy any
attempt to neatly abstract them all.

For example the Simper framework (which I wrote) is designed to cut
through the MVC hierarchy like a butter knife, using the same beans in
the Model (which is Simper itself), to the Controller (Struts and your
actions), to the View (which is JSP, Velocity, etc). This is a FEATURE
not a shortcoming, to reduce data copying across layers and simplify
code management.

Other differences you may find are in the realm of code generation.
People tend to think that you're either writing beans by hand, or you're
having a tool auto-generate classes for you. But this is a false
assumption: Simper was designed to avoid code generation entirely. It's
all dynamic, using DynaBeans and what I call "point-and-shoot table
configuration". You don't write classes, you don't even auto-generate
classes. You just configure them, in a way similar to how Struts 1.1
lets you dynamically configure DynaActionForms.

In short, I think trying to make a single layer which sits above all
known persistence systems will just stifle creativity in approaches.

Bryan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [OT] RE: Persistence Framework Comparison?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 4 Oct 2002, David Graham wrote:

> Date: Fri, 04 Oct 2002 15:28:34 -0600
> From: David Graham <dg...@hotmail.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: [OT] RE: Persistence Framework Comparison?
>
> I think you missed the point.  Yes, JDO lets you program to an interface
> with multiple vendors competing on implementations.  But what if you don't
> want to use JDO?
>
> This is a layer above all persistence frameworks (JDBC, JDO, EJB, OJB, etc.)
> that your application programs to.  If you decide to change persistence
> frameworks, most of your code remains unchanged because it doesn't know
> which one you're using.
>
> I, and others, have rolled our own but I think it would be useful for
> Jakarta Commons to provide this framework (similar to their logging api).
>

On this general topic, there was talk a while back on
general@jakarta.apache.org about starting up a new top-level Apache
project (db.apache.org) to collect design patterns and implementations in
the general area of database access -- and this would certainly make an
appropriate home for something like a persistence layer interface.  Things
like commons-dbcp would probably end up migrating here as well.

Sadly, I don't think there's been any substantive progress on setting up
the infrastructure, yet.

> Dave

Craig


>
>
> >From: "James Higginbotham" <jh...@betweenmarkets.com>
> >Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> >Subject: RE: Persistence Framework Comparison?
> >Date: Fri, 4 Oct 2002 16:18:10 -0500
> >
> >Oh, then what you are looking for is the ODMG API for object databases,
> >Sun's JDO (not Castor's JDO), or something similar. That is the purpose
> >of those 2 APIs at least, abstracting object storage frameworks.
> >
> >James
> >
> > > -----Original Message-----
> > > From: V. Cekvenich [mailto:vicc@users.sourceforge.net]
> > > Sent: Friday, October 04, 2002 4:03 PM
> > > To: struts-user@jakarta.apache.org
> > > Subject: Re: Persistence Framework Comparison?
> > >
> > >
> > > (Sorry, I can't read inline comments)
> > > "I'm curious why you think there would be any glue code needed?"
> > >
> > > It would not be Struts centric, agree. I have said to you Craig in
> > > person that I think one of the many reasons Struts was so
> > > successful is
> > > that it stayed above the persistence fey.
> > >
> > > My wish was for a persistence or a ADO interface, and
> > > interface only, in
> > > Jakarta or else where respected.
> > >
> > > When the person I responded to said words to the effect " it
> > > was painful
> > > to switch persistence frameworks" I said I wish there was an
> > > interface.
> > >
> > > If there were such an interface one could switch from JDO to
> > > ORB to OJB
> > > to EJB to Simper to DAORowset to xyz, assuming other followed the
> > > interface. Let them compete.
> > >
> > > Such interfaces would have to be very light weight. (Ex:
> > > find(), save(),
> > > commit(), getProperty(""); setProperty("", Object))
> > >
> > > It could be used by anyone, not just all beans! WebServices,
> > > JTable, etc.
> > >
> > > What it allows clients to do is make it easier to switch persistence
> > > layer that they outgrow or does not have good support, etc.
> > >
> > > Sort of like we say presentation layer should be replaceable
> > > and X:tag
> > > and Stxx lets you go PDF or else, same shold be on persistence. We
> > > should be able to switch.
> > >
> > > The glue is not one of my reasons at all. But it would make Struts
> > > examples better. (One Struts book out there has a getter
> > > property that
> > > accesses the db connection.... in the getter!! But that is
> > > not a Struts
> > > issue.)
> > >
> > > This is not just theory, my clients use a DAO interface I
> > > made up, that
> > > I can wrap around major persistence layers. The beans are
> > > isolated from
> > > how this happens, and it works.
> > > (this interfaces is public in a "good practices" sample Struts app,
> > > everyone knows were).
> > >
> > > hth,
> > > V.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Craig R. McClanahan wrote:
> > > >
> > > > On Fri, 4 Oct 2002, James Higginbotham wrote:
> > > >
> > > >
> > > >>Date: Fri, 4 Oct 2002 15:11:53 -0500
> > > >>From: James Higginbotham <jh...@betweenmarkets.com>
> > > >>Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> > > >>To: Struts Users Mailing List <st...@jakarta.apache.org>
> > > >>Subject: RE: Persistence Framework Comparison?
> > > >>
> > > >>
> > > >>>>(I wish Struts had a non implemented persistance interface)
> > > >>>
> > > >>>Really?  I think Struts is quite good at what it does, and to me,
> > > >>>persistence seems to outside the scope of a web application MVC
> > > >>>framework.
> > > >>
> > > >>Agreed. Struts does what it does best - web MVC framework. What the
> > > >>original author of the comments (sorry, lost in my mailbox
> > > right now)
> > > >>is looking for is what I would recommend happen on top of Struts.
> > > >>Something that takes Struts, a proven OSS O/R framework,
> > > and some glue
> > > >>to make DB-driven Struts applications faster to develop.
> > > >>
> > > >
> > > >
> > > > If I ever had time to work on such a framework, I'd
> > > probably do it in
> > > > the Commons project at Apache, because it would be generally useful
> > > > (both inside and outside of Struts).  Alas, given my work schedule,
> > > > assuming I'd have time for this is probably wishful thinking :-).
> > > >
> > > > But, I'm curious why you think there would be any glue code
> > > needed?
> > > > Isn't it just a matter of using the persistence framework directly
> > > > from your DAOs (or from your Actions if you don't use
> > > DAOs)?  At most,
> > > > I could only conceive of perhaps providing a Struts PlugIn to
> > > > initialize such a framework, but maybe I'm missing something.
> > > >
> > > > What would definitely be useful is some example apps that
> > > illustrate
> > > > how apps can leverage things like this.  There are several
> > > pointers in
> > > > the Resources pages to such things.
> > > >
> > > >
> > > >>Anything like that out there? Anyone working on this or have one in
> > > >>the planning stages? I've been wanting to craft one myself, but
> > > >>haven't had the time. But if one existed, I'd problem knock out a
> > > >>couple of pet projects faster.
> > > >>
> > > >>James
> > > >>
> > > >
> > > >
> > > > Craig
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:struts-user-> unsubscribe@jakarta.apache.org>
> > > For
> > > additional commands,
> > > e-mail: <ma...@jakarta.apache.org>
> > >
> > >
> >
> >--
> >To unsubscribe, e-mail:
> ><ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> ><ma...@jakarta.apache.org>
>
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos:
> http://photos.msn.com/support/worldwide.aspx
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>