Create indipendent library for manage read/write operation for different content

From: mr.abanjo (mr.abanj..mail.com)
Date: Mon Jun 21 2010 - 11:18:40 UTC

  • Next message: mr.abanjo: "Re: Some doubts about DataContext and memory allocation"

    Hi,
    i'm working with a lot' of web sites. Most of them must connect to the some
    databases to read / write data.
    So, for every kind of "content", i've created a library (jar) that manages
    the database's operations.
    For example, user, news, meteo ecc.. are managed in different libraries
    included in different war (one for each webapp).
    In this way, i have a single code to mantain, and if i must fix some error i
    can change the code in a single place, and all webapps get the fix when i
    recreate the war.
    Now, the problem is that i want to let the library to be indipendent from
    the webapps that use it. In the jar i put the cayenne.xml and the
    corresponding datamap, but if a webapp need to load different kind of data
    (es meteo, and news) in the war i have more than one "cayenne.xml" file.(es
    meteo_cayenne.xml, news_cayenne.xml).
    I can use different names for them but what's happen when i call:

     Configuration.initializeSharedConfiguration( fileConf );

    for each file?
    Is this the right way?

    Also i can leave the datamap in the library, and the cayenne.xml file in the
    webapp, using different "domains" declared in it. But in this way, the
    library is not completly indipendent. What i want to obtain is that the
    webapp don't know nothing about a database/cayenne (except declaring the
    jndi connection).
    There is a way to reach this objective?

    Thanks,
    Davide



    This archive was generated by hypermail 2.0.0 : Mon Jun 21 2010 - 11:19:19 UTC