Results 1 to 5 of 5

Thread: Quick Question

  1. #1

    Default Quick Question

    i have a very large ApplicationContext.xml, for our entire app.
    i want to break it up like

    applicationContext-dao.xml , has my hibernat DAO stuff with JNDI


    which is imported into the main applicationContext.xml


    how would the syntax of the applicationContext.xml look if i want to use this at a pace in the xml file..
    /^\\ Pharaoh /^\\
    http://pharaohofkush.blogspot.com/

    Jeryl Cook

  2. #2
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

  3. #3
    Join Date
    Apr 2005
    Location
    Wilhelmshaven, Germany
    Posts
    15

    Default

    You should also consider to break your xml file in vertical slices.

    So you could have:
    dataSource.xml -> Database connection, Hibernate, etc
    globalConfig.xml -> messages, PropertyPlaceholders, etc
    -servlet.xml -> DispatcherServlet

    and for every slice a *Context.xml file with all of the beans that are relevant to the slice. For example:
    userContext.xml
    orderContext.xml
    newsContext.xml
    ...
    Each of these xml files should contain the daos, service layer, web stuff, etc. I think itīs a good idea to break an application into these "application components".

  4. #4

    Default thx for response

    the break up to

    dataSource.xml -> Database connection, Hibernate, etc
    globalConfig.xml -> messages, PropertyPlaceholders, etc

    pattern is good..

    however breaking up each DAO mapping into a seperate file might not be a good pattern, even in J2ee DD they have one file for all the DAO config info.

    thanks all for the answer & info.
    /^\\ Pharaoh /^\\
    http://pharaohofkush.blogspot.com/

    Jeryl Cook

  5. #5
    Join Date
    Apr 2005
    Location
    Wilhelmshaven, Germany
    Posts
    15

    Default

    even in J2ee DD they have one file for all the DAO config info
    J2EE is one thing, OO and the application layout another. IMHO, J2EE and other technologies shouldnīt dictate your DESIGN. Even in an middle sized app with 50 DAOs in one xml file, this file quickly becomes unmanageable.

    For me, it makes a lot of sense to group the DAOs that a part of an "application component" (perhaps module is a better name) besides the service layer, etc.

    The component idea can be applied at several levels. Fine grained components such as DAOs, validators, etc and coarse grained components such as a user management, order management, etc.
    Each coarse grained component has itīs own service layer AND configuration.

    Best regards,

    Roman

Similar Threads

  1. Forgot password (e.g. secret question) using Acegi
    By lowerymb77 in forum Security
    Replies: 1
    Last Post: Oct 16th, 2005, 10:46 PM
  2. OT: quick question any java CIFS implementations?
    By Colin Yates in forum Architecture
    Replies: 2
    Last Post: Aug 2nd, 2005, 03:01 AM
  3. Quick question about subflows
    By Colin Yates in forum Web Flow
    Replies: 2
    Last Post: Jul 1st, 2005, 03:24 AM
  4. Replies: 5
    Last Post: Dec 14th, 2004, 04:22 PM
  5. Replies: 6
    Last Post: Oct 8th, 2004, 02:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •