Re: Cayenne XML Names

From: Kevin Menard (kmenar..ervprise.com)
Date: Wed Dec 19 2007 - 10:07:27 EST

  • Next message: Tore Halset (JIRA): "[JIRA] Resolved: (CAY-937) Database Schema Migration does not create FK constraints."

    My only real criticism is that I would need to keep two .cayenne folders
    around if I understand your proposal.

    E.g., I have a "models" JAR that contains both my server and client classes.
    Packaged in the JAR is the cayenne.xml and data map. I don't package the
    domain node at this stage because I want the JAR to be usable by other
    projects that can specify their own connection info. So, the trio of files
    is actually split over different JARs and the class loader just happens to
    pick them all up.

    One sort of a pain in the neck part is that every time I load my project
    into the modeler, a new domain node file is auto-generated that I have to
    remove from the project so that it doesn't get packaged with the JAR.

    How would your proposal work for that sort of situation?

    -- 
    Kevin
    

    On 12/19/07 9:31 AM, "Michael Gentry" <blacknex..mail.com> wrote:

    > I know I've brought this up before, but I don't believe we really > decided on anything (or did anything), so here goes again ... > > What do you think about changing the default behavior of Cayenne and > the Modeler to look for directory wrappers for the Cayenne XML files > instead of looking for cayenne.xml? Here are the changes and > advantages as I see them: > > * Have Cayenne Modeler save the XML files (cayenne.xml, etc) into a > Cayenne wrapper directory of your naming, such as MyModel.cayenne (it > would append the .cayenne, which is the wrapper signature). You could > also have MyOtherModel.cayenne in the same directory. > > * Have Cayenne resolve all *.cayenne wrappers at the root of the > CLASSPATH upon startup. This will make it easier to support multiple > models and also utilize models in other frameworks. For legacy > support, also look for cayenne.xml if no *.cayenne wrappers are found. > (I suppose it could also add cayenne.xml regardless of if *.cayenne > wrappers are found.) It might seem like a performance hit to look for > all *.cayenne, but most things at the root of the CLASSPATH are > directories like "org" or "com", so it seems to me the scanning would > be minimal. > > * The *.cayenne wrapper directories could be "branded" with a Cayenne > logo (at least on OS X, not 100% sure about other OS's). > > * The *.cayenne wrapper can be double-clicked to launch Cayenne > Modeler (again, on OS X, hopefully on other OS's too). > > * It is easier to copy a model around in a GUI (drag and drop one > "file") instead of select multiple files. > > > There might be other advantages, too. Those are just the ones off the > top of my head. I can't think of any real negatives to this, either, > but feedback is greatly appreciated. > > Thanks, > > /dev/mrg



    This archive was generated by hypermail 2.0.0 : Wed Dec 19 2007 - 10:08:00 EST