Spring 2.5 introduces injection dependencies by annotation with stereotypes annotation like @Repository, @Service, etc... and the @Autowired annotation.
Here's how you define your beans the old school way :
applicationContext.xml :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="beanDAO_1" class="com.yourcompany.dao.BeanDAO_1_Impl"/>
...
<bean id="beanDAO_N" class="com.yourcompany.dao.BeanDAO_N_Impl"/>
<bean id="beanServices_1" class="com.yourcompany.services.BeanServices_1_Impl">
<property name="beanDAO_1" ref="beanDAO_1"/>
</bean>
...
<bean id="beanServices_N" class="com.yourcompany.services.BeanServices_N_Impl">
<property name="beanDAO_N" ref="beanDAO_N"/>
</bean>
</beans>
BeanDAO_1_Impl.class :
package com.yourcompany.dao.impl;
public class BeanDAO_1_Impl implements BeanDAO_1 {
...
}
BeanServices_1.class :
package com.yourcompany.services.impl;
public class BeanServices_1_Impl implements BeanServices_1 {
private BeanDAO_1 beanDAO_1;
...
public setBeanDAO_1(BeanDAO_1 beanDAO_1) {
this.beanDAO_1 = beanDAO_1;
}
}
Here's how you define your beans with spring annotations :
applicationContext.xml :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd"/>
<context:component-scan base-package="com.yourcompany.dao.impl"/>
<context:component-scan base-package="com.yourcompany.services.impl"/>
</beans>
BeanDAO_1_Impl.class :
package com.yourcompany.dao.impl;
@Repository("beanDAO_1")
public class BeanDAO_1_Impl implements BeanDAO_1 {
...
}
BeanServices_1.class :
package com.yourcompany.services.impl;
@Service("beanServices_1")
public class BeanServices_1_Impl implements BeanServices_1 {
@Autowired
private BeanDAO_1 beanDAO_1;
//No need of a setter anymore. Spring can inject the beanDAO_1
//even if it's a private properties
}
And that's how it's done... No more big XML configuration files.
Consult the spring documentation for a detailed explanation of the differences between the annotation sterotypes (@Repository, @Services, @Component ...)
Thank you men.. This is wht I want...
ReplyDeleteFantastic! Thanks a lot.
ReplyDeleteThanks. Clear and concise
ReplyDeleteThanks a lot. Now I am clear...
ReplyDeleteThanx, a simple no-nonsense example, this was what I needed! :)
ReplyDeleteThanks a lot !
ReplyDeleteCool
ReplyDeleteI am still like the old school way!
ReplyDeleteThank you very much Julien, very concise and quick to understand.
ReplyDeletethis is nice exactly what i wanted
ReplyDeleteThank you very much man. How easily you showed it
ReplyDeleteThe knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
ReplyDeleteDevops Training in Chennai
Devops Training in Bangalore
Devops Training in pune
Devops training in tambaram
Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article. thank you for sharing such a great blog with us.
ReplyDeletepython training institute in chennai
python training in Bangalore
python training in pune
python online training
Woah this blog is wonderful i like studying your posts. Keep up the great work! You understand, lots of persons are hunting around for this info, you could help them greatly.
ReplyDeleteBlueprism training in Chennai
Blueprism training in Bangalore
After seeing your article I want to say that the presentation is very good and also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.
ReplyDeleteangularjs Training in btm
angularjs Training in electronic-city
angularjs online Training
angularjs Training in marathahalli
angularjs interview questions and answers
Your blog stuffed with lot of latest technologies news. Thanks for refreshing my mind.
ReplyDeleteSelenium Training in Chennai
selenium Classes in chennai
iOS Training in Chennai
Digital Marketing Training in Chennai
hadoop big data training in chennai
best institute for big data in chennai
This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.
ReplyDeleteDevops Training in Chennai | Devops Training Institute in Chennai
I appreciate that you produced this wonderful article to help us get more knowledge about this topic. I know, it is not an easy task to write such a big article in one day, I've tried that and I've failed. But, here you are, trying the big task and finishing it off and getting good comments and ratings. That is one hell of a job done!
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Java Script online training
Share Point online training
Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
ReplyDeleteBest PHP Training Institute in Chennai|PHP Course in chennai
Best .Net Training Institute in Chennai
Big Data Hadoop Training in Chennai
Linux Training in Chennai
Cloud Computing Training in Chennai
thanks for posting this one....I found some useful information in your blog, it was awesome to read, thanks for sharing this
ReplyDeleteBEST ANGULAR JS TRAINING IN CHENNAI WITH PLACEMENT
https://www.acte.in/angular-js-training-in-chennai
https://www.acte.in/angular-js-training-in-annanagar
https://www.acte.in/angular-js-training-in-omr
https://www.acte.in/angular-js-training-in-porur
https://www.acte.in/angular-js-training-in-tambaram
https://www.acte.in/angular-js-training-in-velachery
I found useful information in this blog.
ReplyDeleteAngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery
Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing...thanks
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
ReplyDeleteWonderful post,This article have helped greatly continue writing... HIV I & II RNA PCR Quantitative-AIDS cure in India
Donate blood - Malaivel Trust AIDS cure 100% for siddha in India HIV,HSV,HbsAg Cure Treatment in India
VDRL complete cure for siddha in India HBSag complete cure for Herbal in india
HIV/AIDS Complete cure for siddha in India AIDS cure 100% for Ayurveda in India
Wonderful post,This article have helped greatly continue writing... HIV I & II RNA PCR Quantitative-AIDS cure in India
Donate blood - Malaivel Trust AIDS cure 100% for siddha in India HIV,HSV,HbsAg Cure Treatment in India
VDRL complete cure for siddha in India HBSag complete cure for Herbal in india
HIV/AIDS Complete cure for siddha in India AIDS cure 100% for Ayurveda in India
HBSag complete cure for Ayurveda in india AIDS cure 100% for Herbal in India
Amazing post !!!. Informative for people interested in Java.
ReplyDeletePython Training in Chennai | Certification | Online Course Training | Python Training in Bangalore | Certification | Online Course Training | Python Training in Hyderabad | Certification | Online Course Training | Python Training in Coimbatore | Certification | Online Course Training | Python Training in Online | Certification | Online Course Training
Thanks for sharing such a great blog
ReplyDeleteVermicompost manufacturers in Tamilnadu | Vermicompost in Tamilnadu
Vermicompost Manufacturers | Vermicompost Suppliers
Vermicompost in Coimbatore | Vermicompost manufacturers in Chennai
Vermicompost in chennai | Best Vermicompost in chennai
This is best one article so far I have read online, I would like to appreciate you for making it very simple and easy
ReplyDeleteRegards,
java training in chennai
java training in omr
aws training in chennai
aws training in omr
python training in chennai
python training in omr
selenium training in chennai
selenium training in omr
Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
ReplyDeletesap training in chennai
sap training in tambaram
azure training in chennai
azure training in tambaram
cyber security course in chennai
cyber security course in tambaram
ethical hacking course in chennai
ethical hacking course in tambaram
The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea
ReplyDeleteoracle training in chennai
oracle training in annanagar
oracle dba training in chennai
oracle dba training in annanagar
ccna training in chennai
ccna training in annanagar
seo training in chennai
seo training in annanagar
Good Post! , it was so good to read and useful to improve my knowledge as an updated one, keep blogging.After seeing your article I want to say that also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.
ReplyDeleteData Science Online Training
Good Post! it was so good to read and useful to improve my knowledge as an updated one, keep blogging. After seeing your article, I want to say that also a well-written article with some very good information which is very useful for the AWS Cloud Practitioner Online Training
ReplyDeleteVery interesting blog. Many blogs I see these days do not really provide anything that attracts others, but believe me the way you interact is literally awesome.
ReplyDeleteAngular js Training in Chennai
Angular js Training in Velachery
Angular js Training in Tambaram
Angular js Training in Porur
Angular js Training in Omr
Angular js Training in Annanagar
Nice post! Thanks for an excellent content that helps in my work area. I really loved the way it is written in a well structured and precise manner. It is very easy to understand, thus it helps much!
ReplyDeleteSelenium Training in Chennai
Selenium Training in Velachery
Selenium Training in Tambaram
Selenium Training in Porur
Selenium Training in Omr
Selenium Training in Annanagar
Your work is very good and I appreciate you and hopping for some more informative posts
ReplyDeleteIELTS Coaching in chennai
German Classes in Chennai
GRE Coaching Classes in Chennai
TOEFL Coaching in Chennai
Spoken english classes in chennai | Communication training
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleteGood to learn about DevOps at this time.
DevOps Training in Chennai
DevOps Course in Chennai
Thanks for sharing good content.
ReplyDeleteDigital marketing skills
Wow Very Nice Post I really like This Post. Please share more post.
ReplyDeletePlant Engineering Services
Offshore Engineering Services India
Fantastic blog! Thanks for sharing a very interesting post, I appreciate to blogger for an amazing post.
ReplyDeleteScan to BIM in Minnesota
Dimension Control Services in Birmingham
Plant Engineering Services in Bayern Germany
Reverse Engineering Services in Bayern Germany
cover coin hangi borsada
ReplyDeletecover coin hangi borsada
cover coin hangi borsada
xec coin hangi borsada
ray hangi borsada
tiktok jeton hilesi
tiktok jeton hilesi
tiktok jeton hilesi
tiktok jeton hilesi
Excellent article and with lots of information. I really learned a lot here. Do share more like this.
ReplyDeleteUiPath Automation
Robotic Process Automation UiPath
MMORPG OYUNLAR
ReplyDeleteInstagram takipçi satin al
Tiktok Jeton Hilesi
tiktok jeton hilesi
antalya saç ekimi
İNSTAGRAM TAKİPCİ SATIN AL
İnstagram Takipçi Satın Al
Metin Pvp
instagram takipçi satın al
Data analyst generally works on creation of reports based on company’s data driven KPI’s(generally involves descriptive analytics), whereas Data scientists understand business and domain along with the technicalities to understand what will happen in future(more on descriptive + predictive analytics both)
ReplyDeleteEtlhive is a data science institute in pune. actuelly we wanted to promote our website on your site will you please contact me discus further details
website: - www.etlhive.com
contact: - +91 8055020011
Good content. You write beautiful things.
ReplyDeletevbet
sportsbet
hacklink
vbet
sportsbet
korsan taksi
mrbahis
hacklink
taksi
elf bar
ReplyDeletebinance hesap açma
sms onay
2OBZ2
betmatik
ReplyDeletekralbet
betpark
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
mobil ödeme bahis
BAY6
betmatik
ReplyDeletekralbet
betpark
mobil ödeme bahis
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
Y0GMK8
"Thank you for sharing valuable insights about Hyderabad's BBA colleges!"
ReplyDeleteColleges in Hyderabad For BBA
salt likit
ReplyDeletesalt likit
K17
شركة تنظيف خزانات
ReplyDeleteشركة تنظيف موكيت
The technological knowledge you have shared in this essay is quite beneficial in developing new ideas. I'd like to share this as well.
ReplyDeleteBest Juniour Colleges In Hyderabad For MECa>