FAQ
So changing the topic, and taking to dev...
On Feb 29, 2012, at 7:34 AM, John Huss wrote:

My entity classes use explicit fields to store data instead of a Map, so
when it tries to access the "runtimeRelationshipX" fields
So these are on the server side (not the ROP client)? Did you write your own set of ClassDescriptors?

I am working on improving the concurrency of a single DataContext (scenario being a single shared context in read-only apps), the Map structure of CayenneDataObject is one of the factors causing grief. So I am interested in discussing alternative implementations. One being field-based objects similar to ROP, another being using an Object[] instead of a Map to store mapped properties. Yet another - using a delegate for each Persistent (this will also let us drop a common superclass requirement).

Andrus

Search Discussions

  • John Huss at Feb 29, 2012 at 3:40 pm

    On Wed, Feb 29, 2012 at 1:47 AM, Andrus Adamchik wrote:

    So changing the topic, and taking to dev...
    On Feb 29, 2012, at 7:34 AM, John Huss wrote:

    My entity classes use explicit fields to store data instead of a Map, so
    when it tries to access the "runtimeRelationshipX" fields
    So these are on the server side (not the ROP client)? Did you write your
    own set of ClassDescriptors?
    Both. I use the same classes for both server and client because that is
    really necessary for my use case. It takes the ROP approach as a starting
    point and adds back in the things you usually get from the server:
    1) validation
    2) change tracking

    So I have a PersistentObject subclass called UniversalObject that adds the
    snapshotVersion (which may be unnecessary), the validation methods, and
    abstract methods for readPropertyDirectly and writePropertyDirectly.

    I have a ValueHolderDescriptorFactory subclass that allows me to use a
    subclass of SimpleAttributeProperty that takes care of
    calling getObjectContext().propertyChanged on write.

    This is hard to describe and hard to follow I'm sure. When I have time I
    can provide a minimal example if you want.

    I am working on improving the concurrency of a single DataContext
    (scenario being a single shared context in read-only apps), the Map
    structure of CayenneDataObject is one of the factors causing grief. So I am
    interested in discussing alternative implementations. One being field-based
    objects similar to ROP, another being using an Object[] instead of a Map to
    store mapped properties. Yet another - using a delegate for each Persistent
    (this will also let us drop a common superclass requirement).

    It would be nice to have a standard API for how values are written and read
    from the Objects, like DataObject. It is easier (or at least more obvious)
    to implement the interface than to try to tweak the descriptors. That
    would make it easier to try alternative approaches.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedFeb 29, '12 at 7:48a
activeFeb 29, '12 at 3:40p
posts2
users2
websitecayenne.apache.org

2 users in discussion

Andrus Adamchik: 1 post John Huss: 1 post

People

Translate

site design / logo © 2022 Grokbase