First time writer/Design ideas

From: Dave Lamy (
Date: Sun Mar 01 2009 - 13:38:37 EST

  • Next message: "Factory method subclassing cayenne data objects"

    Hello Cayenne luminaries--

    I've recently started getting deep in Cayenne (running 3.0 M5) and I must
    say that it's been a pleasure thus far. Not only does the API fit my mode
    of thinking and design much better than The ORM That Shall Not Be Named, but
    the mailing lists have actually been full of useful and helpful info,
    contrasted to the condescension of self-indulging intelligentsia found on
    other forums. So kudos to you all.

    An synopsis of my project goals:

    We are writing a data management/service framework that will, in time,
    hopefully be 100% metadata driven. Cayenne has a major part to play in this
    framework.. our first cut is essentially just driving our data layer
    metadata concepts to a Cayenne model. To get things off the ground we are
    actually working "backwards".. driving our metadata objects from the Cayenne
    model. This is working fine, but I am nearly ready to go the other way.

    So Question #1:
    What pitfalls/concerns would you voice regarding a completely programmatic
    Configuration/DataMap buildup? The plan is for the entire cayenne model,
    data nodes and all, to be built up in code during system init (hot model
    deploys are for another day).

    Now for the more interesting part. The goal is for this meta model to be
    definable/relatable across data sources, even to the extent that the source
    is not an RDBMS. A great initial example is our Alfresco integration:
    users can define data classes that should be stored in Alfresco, content +
    meta. Those classes could then be related to a class that is stored in our
    internal, Cayenne-managed DB. FKs would be stored across the sources for
    "joins", etc. The data source would be defined in our meta config in such a
    way that the various find/save service methods are exposed in a uniform
    way. In my dreamland I could search for a Cayenne-managed entity ("Person")
    via a nested property ("pictures.mimeType") where Picture was an
    Alfresco-managed entity and mimeType was a property defined/stored there,
    but that is clearly a challenge without DB joins..

    So Question #2:
    Is it possible to work with/customize Cayenne in such a way that I could
    make use of many of the ORM concepts (dirty-object management, caching, etc)
    but inject code in the correct places to do customized find/persist
    routines? What are the current limitations of cross-DataNode cayenne model
    support? The alternative I suppose would be for us to write a layer above
    Cayenne that delegated down to the appropriate data source manager
    (CayenneManager vs AlfrescoManager or whatever) but that idea isn't exactly

    Not looking for anyone to solve all my problems :-), but any advice/guidance
    is greatly appreciated.


    This archive was generated by hypermail 2.0.0 : Sun Mar 01 2009 - 13:39:11 EST