Re: mostly shared model

From: Andrus Adamchik (
Date: Sat Nov 20 2004 - 18:35:31 EST

  • Next message: Andrus Adamchik: "[ANN] Cayenne 1.2 Milestone 1 with SQLServer/MySQL identity columns support"

    Hi Bryan,

    In the future (likely 1.2) we will have something similar to EOF
    attribute prototypes, so that you will have an ability to change some
    definitions from underneath. For now I can think of another strategy.

    - Create a separate project for the application that needs different
    - Use "File -> Import DataMap" function to create a copy of "master"
    DataMap in the new project.
    - Make the changes you need in the new DataMap.

    As you see the last step is manual. Depending on the DataMap size, how
    often it changes, and the structure of differences between the two
    versions of the DataMap, you can probably automate it with Ant a shell
    script. E.g you can globally strip 'lock-type="optimistic"', etc. So
    instead of doing the change in runtime, you do it during deployment.
    Also "cdeploy" Ant task can help in bringing things together for the
    final deployment.


    On Nov 20, 2004, at 10:46 AM, Bryan Lewis wrote:
    > I'm looking for a little advice on the preferred practice for sharing
    > a model's classes among apps while allowing differences in
    > configuration.
    > We have several apps sharing one database. I've created a single
    > "model" (one DataMap and set of classes) that's reused by all the
    > apps, which has been working great. The model is deployed as
    > model.jar, separate from the web-app wars.
    > Now I find that I need to make a small app-specific configuration:
    > one app needs to use optimistic locking while the others don't. I
    > looked for a way to do the reconfiguration from code (that is, without
    > creating multiple DataMaps) and found one option: call
    > setDeclaredLockType() on each ObjEntity. But that affects all the
    > apps using the shared model. I was starting to look at the API for
    > creating custom Configurations, but that feels like it might be the
    > hard way. I'm hoping someone else is dealing with a similar
    > situation.
    > Thanks,
    > Bryan

    This archive was generated by hypermail 2.0.0 : Sat Nov 20 2004 - 18:35:36 EST