Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
Spring DI Tutorial
vaannila
follow
0
6-30-2009 8:51 PM
36 views
tags:
spring
,
di
,
tutorial
,
example
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
This dog needed a hero – and got one!
Have U ever been in Love?
I DO NOT
First U.S. Marijuana Cafe Opens in Oregon
Surf Photography
Fox News Declares Cyberwar on Liberal Blogosphere
Islamophobia: An Irrational Rage Among People Who Can Barely Spell Islamophobia
Aggression Just As Good As Sex and Drugs
Hey Dudes!: The Beatles album from a parallel dimension
Obama’s ACORN Connection Can’t Survive Inspection
visit the
Top Clips page
View the Top Clips from
June 30, 2009
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/7b732b32-efd2-445c-b140-20f33b024e90/AC143019-59E4-4D37-9F80-B94648CF7D6C/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.vaannila.com/spring/spring-tutorial/spring-tutorial.html" href="http://www.vaannila.com/spring/spring-tutorial/spring-tutorial.html" style="font-size: 11px;">www.vaannila.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.vaannila.com/spring/spring-tutorial/spring-tutorial.html"><A href="http://www.vaannila.com/spring/spring-tutorial/../spring-ioc-1.html"><STRONG>Spring IoC Tutorial</STRONG> </A> <P> Learn how the DI can be used to decouple the dependencies between different components.</P></blockquote><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content8.clipmarks.com/images/clip-icon.gif" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.vaannila.com/spring/spring-ioc-1.html" href="http://www.vaannila.com/spring/spring-ioc-1.html" style="font-size: 11px;">www.vaannila.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.vaannila.com/spring/spring-ioc-1.html"><H1>Spring IoC</H1></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.vaannila.com/spring/spring-ioc-1.html"><P>In Spring, the <EM>Inversion of Control (IoC)</EM> principle is implemented using the <EM>Dependency Injection (DI)</EM> design pattern. Let's understand dependency injection with the help of an example. First we will see a java version of the example and later we will add spring functionalities to it. As far as the example go, its pretty simple. The <EM>QuizMater</EM> interface exposes the popQuestion() method. To keep things simple, our <EM>QuizMaster</EM> will generate only one question. </P></blockquote><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content9.clipmarks.com/images/clip-icon.gif" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.vaannila.com/spring/spring-ioc-3.html" href="http://www.vaannila.com/spring/spring-ioc-3.html" style="font-size: 11px;">www.vaannila.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.vaannila.com/spring/spring-ioc-3.html"><P> Here a reference of <EM>SpringQuizMaster</EM> is injected to the <EM>QuizMaster</EM> bean. When we execute this example, "<EM>Are you new to Spring?</EM>" gets printed in the console. </P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.vaannila.com/spring/spring-ioc-3.html"><P> To make our <EM>QuizMaster</EM> ask questions related to Struts, the only change we need to do is, to change the bean reference in the <EM>ref</EM> tag. </P></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/AC143019-59E4-4D37-9F80-B94648CF7D6C/blog/" title="blog or email this clip"><img src="http://content6.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK