Announcement Announcement Module
Collapse
No announcement yet.
Application Context is getting big. Any experience/tips? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Application Context is getting big. Any experience/tips?

    Hi,

    We're using Spring in a Webphere Portal 5.1 project to manage our datasources, business beans and stored procedures as well as transaction management.

    The ApplicationContext.xml file is starting to get huge.

    We're going to look at using AOP to insert advice across common beans and using "config sets" to separate config files and bring them together at run time.

    We're just wondering whether any one else has any experience of managing large XML configurations and if they could pass on any experiences.

    Any help greatly appreciated....

    Cheers, Chris.

  • #2
    I split my application context in multiple files:

    This is an example of my web.xml.
    Code:
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			/WEB-INF/applicationContext-database.xml
    			/WEB-INF/applicationContext-services.xml
    			/WEB-INF/applicationContext-acegisecurity.xml
    			/WEB-INF/applicationContext-searchengine.xml
    		</param-value>
    	</context-param>
    I guess you understand where the different files are for..

    Or is this what you mean with: config sets?

    Comment


    • #3
      Originally posted by Alarmnummer
      I split my application context in multiple files:

      This is an example of my web.xml.
      Code:
      	<context-param>
      		<param-name>contextConfigLocation</param-name>
      		<param-value>
      			/WEB-INF/applicationContext-database.xml
      			/WEB-INF/applicationContext-services.xml
      			/WEB-INF/applicationContext-acegisecurity.xml
      			/WEB-INF/applicationContext-searchengine.xml
      		</param-value>
      	</context-param>
      I guess you understand where the different files are for..

      Or is this what you mean with: config sets?
      Thanks for this. We aren't using web.xml for our Application Context. We're currently loading them from a Singleton as we're trying to achieve total separation between the presentation and model. A Config set is a term that is in the Spring Eclipse plugin when you're looking at a project's properties. I assume it does the same task....

      Comment


      • #4
        Is the <source> tag still supported?

        or is that <import>

        Look at 3.1.7 in
        context-import

        Comment


        • #5
          Originally posted by cmelikian
          Thanks for this. We aren't using web.xml for our Application Context.
          It was meant as an example to show you how I have split up my applicationcontext files.

          We're currently loading them from a Singleton as we're trying to achieve total separation between the presentation and model.
          Hmm.. you mean you want the have the presentation stuff in another applicationcontext-file than the model? You can do that by dividing the applicationcontext on more than 1 file... Or am I missing something?

          Comment


          • #6
            Originally posted by cmelikian
            Originally posted by Alarmnummer
            I split my application context in multiple files:

            This is an example of my web.xml.
            Code:
            	<context-param>
            		<param-name>contextConfigLocation</param-name>
            		<param-value>
            			/WEB-INF/applicationContext-database.xml
            			/WEB-INF/applicationContext-services.xml
            			/WEB-INF/applicationContext-acegisecurity.xml
            			/WEB-INF/applicationContext-searchengine.xml
            		</param-value>
            	</context-param>
            I guess you understand where the different files are for..

            Or is this what you mean with: config sets?
            Thanks for this. We aren't using web.xml for our Application Context. We're currently loading them from a Singleton as we're trying to achieve total separation between the presentation and model. A Config set is a term that is in the Spring Eclipse plugin when you're looking at a project's properties. I assume it does the same task....
            However you load your application context (sounds like you're using a custom singleton, although there's also the standard SingletonBeanFactoryLocator available as well), you can always specific multiple XML definition files to combine and use. Just use the appropriate constructor. Splitting up by layer of by logical area _is_ a good idea, when the size of one context definition file grows unwieldy.

            Regards,

            Comment


            • #7
              Try the <import> tag (see the DTD) it works great for me.

              Comment

              Working...
              X