Re: Cayenne and WebServices

From: Dov Rosenberg (dov.rosenber..onviveon.com)
Date: Wed Jan 11 2006 - 10:33:35 EST

  • Next message: Cris Daniluk: "Re: Cayenne and WebServices"

    I don't think inheriting from DataObject is too much of an issue - the
    biggest problem when sending objects like a DataObject over the wire is all
    of the embedded relationships. For example consider:

    SiteDO (dataobject) has a 1->M to UserDO which has a 1->M to RolesDO which
    has a 1->M to PermissionsDO

    Within the Cayenne framework (or EOF) the relationships from Site to User
    and User to Role and Role to Permission are faulted and not retrieved until
    needed or accessed.

    For a webservice that send a reference to a Site object over the wire to a
    remote process, those relationships either need to be fully resolved and
    serialized or they shouldn't be included and only accessed via separate
    method calls. For large data sets (thousands or millions of records) it is
    not possible or practical to serialize this data and embedding it within the
    stuff being sent over the wire.

    I am not familiar with Cayenne's Remote Object Persistence - will need to
    look at that.

    Ideally the Cayenne modeler would create a Bean class that represents the
    data for a DataObject and populates it without populating the relationships.

    Most remote invocations need to be lean and mean without a lot of overhead
    in order to be scalable.

    On 1/10/06 11:14 PM, "Cris Daniluk" <cris.danilu..mail.com> wrote:

    >> It doesn't look like it is possible to pass DataObjects around unless there
    >> is some type of custom serializer/deserializer available. In lieu of not
    >> being able to use DataObjects we will need to be able to create Beans for
    >> each of the DataObjects that we can then pass around.
    >>
    >
    > Well, I don't see why not... you certainly should be able to pass
    > DataObjects around, though of course they should be in a clean state
    > when they go out the wire. If you are concerned about the client-end
    > not having access to the DataObject hierarchy.. well, I wouldn't be.
    > Remember that the objects are described in the WSDL by "interface".
    > The client can generate POJO representations of the Cayenne
    > DataObjects pretty easily. See wsdl2java for more...
    >
    > ... but... maybe you need Cayenne 1.2's Remote Object Persistence :)
    >
    > Either way, without knowing anything about your architecture or
    > design, I would guess you could use the DataObjects directly, perhaps
    > with a little bit of loving to bind incoming objects to a DataContext
    > in the correct state.
    >
    >> 1. Is there a way to generate the bean classes from the Cayenne modeler?
    >
    > You can use a custom superclass template to generate Pojo-like objects
    > automatically, if you feel it is necessary.
    >
    >> 2. Is there a way to populate the bean classes from the Cayenne framework?
    >
    > I've used BeanUtils fairly successfully in the few times when I've
    > needed to do this. BeanUtils doesn't work 100% of the time, but its
    > not bad. It depends on the relationships, really.
    >>
    >> Ideally the modeler could also generate a set of plain old Java beans that
    >> could be used in the framework so that they could be populated and
    >> maintained automatically.
    >>
    >
    > Sounds like you want native pojo support. A lot of people want this,
    > but I for one don't see the big deal about having to inherit from
    > DataObject -- particularly when you look at the difficulties of not
    > doing so. Still, it would be a nice thing to have.
    >
    > Cris

    -- 
    Dov Rosenberg
    Inquira Inc
    370 Centerpointe Circle, ste 1178
    Altamonte Springs, FL 32701
    (407) 339-1177 x 102
    (407) 339-6704 (fax)
    drosenber..nquira.com
    AOL IM: dovrosenberg
    



    This archive was generated by hypermail 2.0.0 : Wed Jan 11 2006 - 10:33:38 EST