Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Externalizing the spring configuration

Posted on 2011-05-04
4
Medium Priority
?
335 Views
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
file


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

Accepted Solution

by:
objects earned 668 total points
ID: 35695120
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
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 664 total points
ID: 35695362
A very good explanation fof that statement with good examples comes right after that
statement in that very book:
http://translated.by/you/spring-in-action-second-edition-part-1-core-spring/original/?page=33

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 jdbc.properties 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.


0
 
LVL 20

Assisted Solution

by:Sathish David Kumar N
Sathish David  Kumar N earned 668 total points
ID: 35696209
>>>>>>
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 .
0
 

Expert Comment

by:capri9
ID: 35821380
its good
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
A solution for Fortify Path Manipulation.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

564 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