Re: Cayenne Spring Integration

From: Cris Daniluk (cris.danilu..mail.com)
Date: Wed Feb 22 2006 - 17:35:07 EST

  • Next message: Mike Kienenberger: "Re: Cayenne Spring Integration"

    I've been using the Spring module for a while now with little real
    value. I've actually been considering ripping it out, in fact, because
    it just adds yet another layer of indirection as far as I can see.

    I think Malcom's points confirm a lot of what I've suspected for a
    while now, but not felt qualified enough to say :)

    The one advantage I see to the integration is the ability to inject
    beans into the domain objects. I don't use this, but if I needed to,
    it would be considerably more annoying to request the
    ApplicationContext and retrieve the bean that way. I wouldn't ditch it
    completely, but maybe we should consider recommending that it just not
    be used?

    Malcom and Mike both made comments based on their experience with
    other MVCs. Is there any value (or need) when using Spring MVC?

    Cris

    On 2/22/06, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > Posting our private email exchange with Malcolm Edgar regarding
    > Spring integration module. I was feeling the same way about it
    > (cayenne already does a lot of what people normally expect from
    > Spring), and I am glad that someone with practical Spring knowledge
    > confirms that. I guess one area where we can still improve the
    > integration is participation in external transactions (rolling back
    > or even replacing thread DataContext when a Spring transaction is
    > rolled back due to a failure outside Cayenne).
    >
    > Andrus
    >
    >
    > On Feb 22, 2006, at 6:31 AM, Malcolm Edgar wrote:
    >
    > > Hi Andrus,
    > >
    > > I have been looking at the Cayenne Spring integration code for the
    > > last few weeks, getting it working nicely with Click. I have learned a
    > > lot in the process, and now have a much better understanding of
    > > Cayenne.
    > >
    > > The interesting thing that came out of this experience is that I dont
    > > think there is really any significant need for Cayenne Spring
    > > integration, because of the way Cayenne is designed.
    > >
    > > Spring is good an providing a easy to use API wrapper around difficult
    > > to use APIs. However the DataContext API is very good, so the
    > > CayenneTemplate does not add much/any value.
    > >
    > > Spring maps checked persistence framework exceptions in
    > > RuntimeException making the API easier to program to. However Cayenne
    > > uses unchecked exceptions to this isn't an issue.
    > >
    > > Spring can provide an open session in view filter to help deal with
    > > Hibernates lazy loading problems in web applications. Cayenne however
    > > doesn't have this issue as all registered objects are "attached" and
    > > can lazy load when rendering in web pages.
    > >
    > > Spring provides an Transaction wrapper ontop of JDBC or Hibernate
    > > calls. Cayenne transactions are already nicely encapsulated in the
    > > DataContext.
    > >
    > > Another problem with Hibernate is that operations (transactions) than
    > > span multiple requests is difficult to managed, as detached object
    > > must be reattached to the new Session. JBOSS is attempting to address
    > > this issue with Seam. This issue and the lazy loading problem with
    > > Hibernate are difficult issues for web teams to deal with.
    > >
    > > The Cayenne session based DataContext transaction provides a unit of
    > > work approach which better fits the web application space.
    > >
    > > Spring assists with injecting Session dependencies in
    > > HibernateTemplate classs. Cayenne doesn't have this issue as the
    > > thread local DataContext can be obtained directly in DAO or service
    > > layer code.
    > >
    > > I think Spring is good for service layer code, but it hasn't really
    > > got much to contribute to Cayenne; possibly configuration, but that is
    > > a pretty marginal benefit.
    > >
    > > I will be settling on Click, Spring and Cayenne for a medical practice
    > > CRM application I will slowly be building over the next year.
    > >
    > > If there is anything I can do to contribute to Cayenne please let me
    > > know. I will do my best, but I have to admit I dont have much time
    > > between a new baby, work, Click and building a CRM application out of
    > > hours.
    > >
    > > regards Malcolm Edgar
    > >
    > > p.s. - I think Cayenne is excellent. I dont think it gets anywhere
    > > near the attention it deserves. I am writing up some observations on
    > > learning Cayenne as a newbie.
    >
    >



    This archive was generated by hypermail 2.0.0 : Wed Feb 22 2006 - 17:35:09 EST