Re: DataContext XML serialization

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Dec 07 2004 - 15:23:25 EST

  • Next message: Andrus Adamchik: "Re: DataContext subclassing [was: Re: Setting a user stamp on objects]"

    Yes, DataContext can be serialized and passed around... It supports Java
    serialization already, and some sort of brute-force XML serialization can
    be implemented as well... I am not sure that's the best way to handle
    compatibility with WebRowSet though...

    I am not intimately familiar with the whole javax.sql.rowset.* API, but it
    looks like implementing WebRowSet compatibility may have some synergy with
    the distributed DataContext feature that we plan for 1.2, and in general
    make Cayenne open to use with any remote clients. So I am very interested
    in continuing this discussion here.

    First a few question - Is client going to use its own implementation of
    WebRowSet interface and just read the incoming standard XML? Could you
    elaborate on the client architecture, in particular how the initial query
    to obtain a RowSet is done?

    Now a few notes.... RowSet is a tabular abstraction of data. ORM is a tree
    (or rather a graph) of objects. So transfering a full DataContext to the
    client just to have a single table of values maybe an overkill (now if you
    can change the requirements and forget about WebRowSet and just use
    Cayenne on the client, that's another story...). WebRowSet is better
    represented in Cayenne as a DataRow query -
    http://objectstyle.org/cayenne/userguide/perform/data-rows.html - than a
    full-blown DataContext. Looks like that's what you'll have to serialize
    and pass around. This can be done with some sort of adapter to a
    server-side DataContext. If you want to write such adapter, please keep us
    posted on the progress (maybe on cayene-devel list)...

    Thanks
    Andrus

    > Hi,
    >
    > From the TSS article:
    >
    > | DataContext is "disconnected" and uses Cayenne
    > | runtime for connectivity, [...]
    > | DataContext is serializable, together with all
    > | its objects, and can span multiple transactions.
    >
    > I got the need of serializing a DataContext in XML, send it to a client
    > that understands the format of a WebRowSet, modify it there, send it
    > back, reconstruct it in object form and apply the changes to the
    > database.
    >
    > 1) Is that possible at all?
    > 2) I understand that the XML serialization part is out of scope for
    > cayenne, so what would you use for it? XMLBeans, JSX, ...
    >
    > Thanks in advance from a newbie,
    >
    > Pepe Pérez.



    This archive was generated by hypermail 2.0.0 : Tue Dec 07 2004 - 15:23:29 EST