Re: deployment options

From: Craig Miskell (cmiskel..lbatross.co.nz)
Date: Tue Oct 29 2002 - 14:45:35 EST

  • Next message: Andrus Adamchik: "Re: deployment options"

    > > loader/resource locating... I'm getting out of my depth here and need to
    > > do some reading :-).
    >
    > I suggest we do not mess with ClassLoaders - this can be ugly. Rather we
    > assume that module JARs are in the CLASSPATH of the application (still may
    > have some ClassLoader issues, but those are easier to solve). Then we may
    > introduce a module file extension (so a module named "xyz" will be expected
    > to have a module file called "xyz.someext"). This would allow cayenne.xml to
    > reference modules by name, and look them up via ClassLoader instead of
    > loading jars explicitly.
    Yeah, that sounds good. I haven't played with resource loading using
    classloaders before (just looked up the docos)... guess you learn
    something new every day. It would require that there be no naming
    conflicts, but then again, module names should be fairly unique anyway
    (perhaps a recommendation in the documentation to store the xyz.somext in
    the "package" with the DataObject classes so that there is even less
    chance of conflict?)

    > My concern was that JNDI is only available when you deploy in a container,
    > and is not universally used. But I guess for non_JNDI users some Ant magic
    > would allow to work around current limitations by substituting
    > "xyz.driver.xml" file with the right version for the target environment for
    > the driver-based DataNodes. I just always thought that having connection
    > info tied to the project and shared via CVS is a major hassle and a security
    > issue.
    ok, just to completely reverse my original thought (that cayenne shouldn't
    concern itself overly with providing connection info)... would it be worth
    providing some way for an application to provide connection information at
    startup, rather than specified in an cayenne specific xml file (or,
    rather, provide the *option* for the application to provide connection
    info in that manner).
      Then, for those developing simple apps that will always
    connect to the same db, the xml can be hard-coded/part of the app/in CVS
    (ugh).
      Others may have their own way of selecting which db to connect to (gui,
    command line option etc), but the user selected value may be a "name" that
    indexes into the full set of information.
      In object terms (thinking on my feet, based on little
    knowledge of code), a new DataSourceFactory that allows connection info
    the be registered at runtime? Application registers info based on user
    selection, voila.
      One other related thing: It would be really good to be able to
    dynamically specify (somehow) the Adaptor to use, or to reverse engineer
    it from the jdbc connection url. In our particular case, we intend on
    distributing the application and having it able to run on dbs from a
    number of vendors. We could have multiple versions of the data node xml
    (module), but that doesn't seem quite right to me.

    > I any event, in the future we may make it simpler by mapping named resources
    > to the connection sets *locally* in $HOME/.cayenne directory, so that users
    > could work with DataNodes from CayenneModeler, even if they are JNDI-based.
    Nice....I didn't even think about that (I hardcoded the connection info
    initially when creating the DataMaps, and then changed to JNDI once I
    figured out how to do it :-))

    Craig



    This archive was generated by hypermail 2.0.0 : Tue Oct 29 2002 - 14:45:58 EST