I just started learning spring.
what should be avoided while writing an ApplicationContext xml file in application development using spring so that the code will be efficient?
(what i meant is good practice that can be followed while writing ApplicationContext xml file and please don’t give me a negative vote, it is a genuine doubt)
I just started learning spring. what should be avoided while writing an ApplicationContext xml
Share
There are several things to consider below are just a few things to consider
1) Modularity – we can divide applicationContext.xml module wise and import that in main applicationContext.xml
Example : applicationContext.xml code snippest
2) Database configuration can be stored in seperated properties file and then used in applicationContext.xml using PropertyPlaceholderConfigurer
3) Bean scope should be appropriate like prototype, singleton, request, session
singleton – means single instance per spring container. It may cause problem in clustered environment.
4) Bean Dependancy Injection should be appropriate, so that it should not cause circular dependancy like A —> B —> C —> A
Many more ….