Externalizing the spring configuration

Posted on 2011-05-04
Last Modified: 2012-05-11
I was reading folowing lines and I did not understand clearly.
Externalizing the configuration
For the most part, it is possible to configure your entire application in a single
bean wiring file. But sometimes you may find it beneficial to extract certain pieces
of that configuration into a separate property file. For example, a configuration
concern that is common to many applications is configuring a data source. In
Spring, you could configure a data source with the following XML in the bean wiring

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
Question by:gudii9
    LVL 92

    Accepted Solution

    its simply saying you don't want to put all your spring configuration into one file
    spring allows you to use as many files as you want
    so for example you can put security in one file, database access into another and your web interface config in another
    LVL 47

    Assisted Solution

    A very good explanation fof that statement with good examples comes right after that
    statement in that very book:

    It is just convenient to have certain pieces of configuration of your application in
    seprate files because they may be dependent not so much on business
    logic of your application but rather on deployment. So you mostly
    configure those parts which are indeed appliaction specific in your bean-wiring file.
    Those parts which are deployment specific, like database source,  makes sense to keep separate.

    And they also show how technically connect your main configuration (bean-wiring) file
    with those files with deployemnt specific pieces  by using propertyConfigurer bean and
    an example with file. Just read all that below in section 3.5.3 of the
    book which you are reading. This seems to be very strightforward and understandable stuiff.

    LVL 20

    Assisted Solution

    by:Sathish David Kumar N
    as per my understanding .. if you going to use ur application archi like this

    Controller -------> services ---------> DAO

    so here you no need to create all wiring in single file you can use  3 diffrent xml file for wiring .

    Expert Comment

    its good

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now