Re: Cayenne vs EOF: How to questions?

From: Mike Kienenberger (mkienen..laska.net)
Date: Thu Feb 10 2005 - 18:25:24 EST

  • Next message: Michael Mangus: "RE: newbie with Quick Start > Tapestry Tutorial"

    Dov Rosenberg <dov.rosenber..onviveon.com> wrote:
    > A few questions on the capabilities of Cayenne as compared to Apple EOF
    >
    > 1. Does Cayenne support flattened relationships like EOF? If so, what is
    the
    > equivalent?

    Tragically, I've never used this feature, so I can't comment much. There's
    support for them, but I don't know how it compares with EOF.

    > 2. I understand that Cayenne does not currently support EOPrototypes to
    make
    > it easier to switch between databases, what is the Cayenne preferred
    method
    > for supporting multiple databases? Seems like it has something to do with
    > DataMaps. Not sure though

    Support for something compatible to EOPrototype is on the todo list.
    Patches are always welcome :)

    Cayenne has support for importing an EOModel.
    Probably the easiest way to understand what the differences are is to import
    your EOModel and take a look at the result.

    Cayenne keeps model information in cayenne.xml, and driver information for a
    particular database in a separate file.

    If you mean using multiple databases at the same time, yep, just provide
    multiple datamap/datanodes.

    If you're talking about different databases for
    Development/Deployment/Testing/etc,
    there's a number of provided ways you can support multiple databases
    depending on when and what you're doing.
    For example, you can use an ant task as part of your deployment to swap to a
    different database driver file. Or if you're developing web apps under a
    j2ee server, you can specify to use a JNDI datasource rather than a JDBC
    datasource. Or you could write your own custom datasource implementation.

    > 3. How can I programmatically swap out my connection dictionary at
    > application startup? I.e. Allow me to store userid/password in separate
    file
    > from the cayenne.xml and update them when the app starts up.

    See above.

    > 4. Is there a hook for generating primary keys on the client side similar
    to
    > what we currently do with a DatabaseContextDelegate and our own guid
    > generator?

    Didn't ever use this on EOF, but it's fairly trivial to create your own
    primary key generation. (It must be -- I managed to implement OpenBase's PK
    Generation as a novice Cayenne user.) Worse case, you can subclass the
    DBAdaptor subclass of your choice.

    > 5. Is there any Cayenne support for doing lightweight, high volume SQL
    > processing (i.e. For batch updates)? EOF has too much overhead for large
    > amounts of sql processing in batch mode. Ideally a smarter version of
    > RawRowsForSQL that doesnąt create all the objects in an object graph.

    Yes, Cayenne does everything with batch updates by default.

    Yes, Cayenne has the ability to fetch DataRows rather than instantiating
    DataObjects. This can be specified for any query.

    -Mike



    This archive was generated by hypermail 2.0.0 : Thu Feb 10 2005 - 18:24:48 EST