Re: Testing Spring + Cayenne Integration / Architectural Doubts

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Jan 19 2005 - 12:57:50 EST

  • Next message: Reinaldo Coelho Sartorelli: "Update problem"

    André,

    If possible, please send email messages as something other than html file
    attachments :) It's hard to answer email from a web browser :)

    =?ISO-8859-1?Q?Andr=E9_Luiz_do_Nascimento_Sousa?=
    <andresous..aixaseguros.com.br> wrote:
    =================================
            I'm looking for some comments about the "problems of Hibernate". All the
    massive marketing that arounds it doesn't allow us to know its weakness.
    Could you (and anybody else) list and compare these problems?
    =================================

    I have only used ORM layers (WebObjects/Toplink/Cayenne) that were
    subclasses of a "DataObject" kind of class, so I'm no expert on POJO ORM.

    However, one thing I see right off with just POJO is that you no longer have
    any reference from your POJO to its model. My applications tend to use
    validation based on our database models.

    Second, if your data is only represented as a POJO, then it's only
    associated with the database when you perform an operation (commit/select).
     That means that a change to the database can not resync your POJO object
    back to match the database state as there's no connection between the two.

    Consider the simple case of a web app with two sessions modifying the same
    database object.
    In Cayenne, as soon as one session commits a change to the object, the other
    DataContext will update the backing store of the object as well to match
    those changes.

    Things get much more complex when you start wanting to use remote
    notification changes between applications.

    You could minimize these problems to some extent by registering them in a
    list and mapping each list entry to a database model. I'm not sure if that
    would cover all situations, but it might.

    I guess in the end, the only "cost" of supporting POJO objects would be to
    keep a separate matched DataObject for each one (That's probably what Andrus
    is calling a POJOAdaptor), then search through that list (probably a
    HashMap) to match a POJO with its Cayenne DO.

    -Mike



    This archive was generated by hypermail 2.0.0 : Wed Jan 19 2005 - 13:00:58 EST