PackageConfiguration [Was: Runtime Error: how to find cayenne.xml]

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Feb 27 2003 - 01:00:27 EST

  • Next message: Craig Miskell: "Attributes to fetch"

    Holger,

    Historically the requirement to have a single "start" file in the known
    location to load Cayenne configuration has always been a real problem.
    So I like your idea of moving Java package concept closer to the
    "bundle" or "framework". I think this is fresh ;-). This makes
    configuration smarter. Wonder how many people do that already?

    I was implementing all those endless subsclasses of Configuration to
    make it easy at least for some environments. As you may remember,
    "cdeploy" was a latest addition to give a generic and flexible
    configuration solution. I think your PackageConfiguration may become a
    cool new way of doing things. A few random ideas to make it easier for
    end users:

    - Generate MyConfiguration from the modeler (originally I was thinking
    Bcel, but I don't like the idea of runtime class generation)

    - Make Configuration look for system property corresponding to
    configuration subclass (say "cayenne.config.class"), so no extra Java
    code is required to start an alt configuration

    - (most important) Create documentation explaning all available
    configurations, and when and how to use them. COnfusing the users is the
    last thing we want. For example:

    Config Type Steps
    ----------------------
    Default Put cayenne.xml in CLASSPATH
    Package Put cayenne.xml in the package in CLASSPATH
    ServletConfiguration Put cayenne.xml in app/WEB-INF
    ...

    Andrus

    Holger Hoffstätte wrote:

    > Soo..I really thought about what Paul wanted to achieve. Until now it
    > never occurred to me that having the config files on the top level of the
    > project would be a problem, but it really is the norm if you think
    > further.

    > There's no good reason not to have several configuration 'sets'
    > for a single application on the classpath at the same time, and picking
    > one e.g. at startup; this can be achieved by simply using packages (which
    > are nothing but namespaces, just like directories) and a single class in
    > that package (to enable package loading). This class just needs to be an
    > empty subclass of my new PackageConfiguration that I just checked into my
    > sandbox. Please have a look at it.



    This archive was generated by hypermail 2.0.0 : Thu Feb 27 2003 - 01:01:43 EST