<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Charleston Claver</title>
	<atom:link href="http://thegame28.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thegame28.wordpress.com</link>
	<description>Sooner or Later, those who succeed are those who think they can..</description>
	<lastBuildDate>Mon, 25 Jan 2010 02:06:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='thegame28.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Charleston Claver</title>
		<link>http://thegame28.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://thegame28.wordpress.com/osd.xml" title="Charleston Claver" />
	<atom:link rel='hub' href='http://thegame28.wordpress.com/?pushpress=hub'/>
		<item>
		<title></title>
		<link>http://thegame28.wordpress.com/2010/01/25/197/</link>
		<comments>http://thegame28.wordpress.com/2010/01/25/197/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 02:06:12 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=197</guid>
		<description><![CDATA[Note: This chart is not adjusted for inflation. The figures represent the total amount of money a movie has taken globally over its lifetime. &#160;&#160;&#160;&#160;&#160;&#160; Released&#160;&#160;&#160;&#160;&#160;&#160; Film Name&#160;&#160;&#160;&#160;&#160;&#160; Total Box Office 1 1997 Titanic $1,842,879,955 2 2009 Avatar $1,840,797,418 3 2003 Lord of the Rings: Return of the King $1,133,027,325 4 2006 Pirates of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=197&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="left">
<b>Note:</b><br />
This chart is <i>not</i> adjusted for inflation. The figures represent the total amount of money a movie has taken globally over its lifetime.
</p>
<table cellspacing="0">
<thead>
<tr>
<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>Released&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>Film Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>Total Box Office</th>
</tr>
</thead>
<tbody>
<tr>
<td align="right">1</td>
<td align="center">1997</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1997/TITAN.php">Titanic</a></b></td>
<td align="right">$1,842,879,955</td>
</tr>
<tr>
<td align="right">2</td>
<td align="center">2009</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2009/AVATR.php">Avatar</a></b></td>
<td align="right">$1,840,797,418</td>
</tr>
<tr>
<td align="right">3</td>
<td align="center">2003</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2003/LRDR3.php">Lord of the Rings: Return of the King<br />
</a></b></td>
<td align="right">$1,133,027,325</td>
</tr>
<tr>
<td align="right">4</td>
<td align="center">2006</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2006/PIRT2.php">Pirates of the Caribbean: Dead Man&#8217;s Chest<br />
</a></b></td>
<td align="right">$1,065,659,812</td>
</tr>
<tr>
<td align="right">5</td>
<td align="center">2008</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2008/BATM2.php">The Dark Knight<br />
</a></b></td>
<td align="right">$1,022,345,358</td>
</tr>
<tr>
<td align="right">6</td>
<td align="center">2001</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2001/HPOTT.php">Harry Potter and the Sorcerer&#8217;s Stone<br />
</a></b></td>
<td align="right">$976,457,891</td>
</tr>
<tr>
<td align="right">7</td>
<td align="center">2007</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2007/PIRT3.php">Pirates of the Caribbean: At World&#8217;s End<br />
</a></b></td>
<td align="right">$960,996,492</td>
</tr>
<tr>
<td align="right">8</td>
<td align="center">2007</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2007/HPOT5.php">Harry Potter and the Order of the Phoenix<br />
</a></b></td>
<td align="right">$938,468,864</td>
</tr>
<tr>
<td align="right">9</td>
<td align="center">2009</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2009/HPOT6.php">Harry Potter and the Half-Blood Prince<br />
</a></b></td>
<td align="right">$934,559,990</td>
</tr>
<tr>
<td align="right">10</td>
<td align="center">2002</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2002/LRDR2.php">The Lord of the Rings: The Two Towers<br />
</a></b></td>
<td align="right">$926,284,377</td>
</tr>
<tr>
<td align="right">11</td>
<td align="center">1999</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1999/STRWR.php">Star Wars Ep. I: The Phantom Menace<br />
</a></b></td>
<td align="right">$924,288,297</td>
</tr>
<tr>
<td align="right">12</td>
<td align="center">1993</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1993/0JRSS.php">Jurassic Park<br />
</a></b></td>
<td align="right">$923,067,947</td>
</tr>
<tr>
<td align="right">13</td>
<td align="center">2004</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2004/SHRK2.php">Shrek 2<br />
</a></b></td>
<td align="right">$919,838,758</td>
</tr>
<tr>
<td align="right">14</td>
<td align="center">2005</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2005/HPOT4.php">Harry Potter and the Goblet of Fire<br />
</a></b></td>
<td align="right">$896,013,036</td>
</tr>
<tr>
<td align="right">15</td>
<td align="center">2007</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2007/SPID3.php">Spider-Man 3<br />
</a></b></td>
<td align="right">$890,871,626</td>
</tr>
<tr>
<td align="right">16</td>
<td align="center">2009</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2009/ICEA3.php">Ice Age: Dawn of the Dinosaurs<br />
</a></b></td>
<td align="right">$884,491,349</td>
</tr>
<tr>
<td align="right">17</td>
<td align="center">2002</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2002/HPOT2.php">Harry Potter and the Chamber of Secrets<br />
</a></b></td>
<td align="right">$878,987,880</td>
</tr>
<tr>
<td align="right">18</td>
<td align="center">2001</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2001/LRDRN.php">Lord of the Rings: Fellowship of the Ring<br />
</a></b></td>
<td align="right">$868,621,686</td>
</tr>
<tr>
<td align="right">19</td>
<td align="center">2003</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2003/FNEMO.php">Finding Nemo<br />
</a></b></td>
<td align="right">$866,592,978</td>
</tr>
<tr>
<td align="right">20</td>
<td align="center">2005</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2005/STAR3.php">Star Wars Ep. III: Revenge of the Sith<br />
</a></b></td>
<td align="right">$848,998,877</td>
</tr>
<tr>
<td align="right">21</td>
<td align="center">2009</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2009/TFRM2.php">Transformers: Revenge of the Fallen<br />
</a></b></td>
<td align="right">$833,231,012</td>
</tr>
<tr>
<td align="right">22</td>
<td align="center">2002</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2002/SPIDR.php">Spider-Man<br />
</a></b></td>
<td align="right">$821,708,551</td>
</tr>
<tr>
<td align="right">23</td>
<td align="center">1996</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1996/0ID4.php">Independence Day<br />
</a></b></td>
<td align="right">$817,400,878</td>
</tr>
<tr>
<td align="right">24</td>
<td align="center">2007</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2007/SHRK3.php">Shrek the Third<br />
</a></b></td>
<td align="right">$798,958,162</td>
</tr>
<tr>
<td align="right">25</td>
<td align="center">1977</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1977/0STRW.php">Star Wars Ep. IV: A New Hope<br />
</a></b></td>
<td align="right">$797,900,000</td>
</tr>
<tr>
<td align="right">26</td>
<td align="center">2004</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2004/HPOT3.php">Harry Potter and the Prisoner of Azkaban<br />
</a></b></td>
<td align="right">$795,538,952</td>
</tr>
<tr>
<td align="right">27</td>
<td align="center">1982</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1982/0ET.php">ET: The Extra-Terrestrial<br />
</a></b></td>
<td align="right">$792,910,554</td>
</tr>
<tr>
<td align="right">28</td>
<td align="center">1997</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1997/LSTWD.php">The Lost World: Jurassic Park<br />
</a></b></td>
<td align="right">$786,686,679</td>
</tr>
<tr>
<td align="right">29</td>
<td align="center">2008</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2008/INDI4.php">Indiana Jones &amp; Kingdom of Crystal Skull<br />
</a></b></td>
<td align="right">$786,558,765</td>
</tr>
<tr>
<td align="right">30</td>
<td align="center">1994</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1994/0LNKN.php">The Lion King<br />
</a></b></td>
<td align="right">$783,839,505</td>
</tr>
<tr>
<td align="right">31</td>
<td align="center">2004</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2004/SPID2.php">Spider-Man 2<br />
</a></b></td>
<td align="right">$783,705,001</td>
</tr>
<tr>
<td align="right">32</td>
<td align="center">2009</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2009/2012S.php">2012<br />
</a></b></td>
<td align="right">$765,467,722</td>
</tr>
<tr>
<td align="right">33</td>
<td align="center">2006</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2006/DVINC.php">The Da Vinci Code<br />
</a></b></td>
<td align="right">$757,236,138</td>
</tr>
<tr>
<td align="right">34</td>
<td align="center">2005</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2005/LWWRB.php">The Chronicles of Narnia:<br />
</a></b></td>
<td align="right">$748,806,957</td>
</tr>
<tr>
<td align="right">35</td>
<td align="center">2003</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2003/MTRX2.php">The Matrix Reloaded<br />
</a></b></td>
<td align="right">$738,576,929</td>
</tr>
<tr>
<td align="right">36</td>
<td align="center">2009</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2009/UP.php">Up<br />
</a></b></td>
<td align="right">$727,079,556</td>
</tr>
<tr>
<td align="right">37</td>
<td align="center">2007</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2007/TFORM.php">Transformers<br />
</a></b></td>
<td align="right">$708,272,592</td>
</tr>
<tr>
<td align="right">38</td>
<td align="center">2009</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2009/TWLI2.php">The Twilight Saga: New Moon<br />
</a></b></td>
<td align="right">$699,187,450</td>
</tr>
<tr>
<td align="right">39</td>
<td align="center">1994</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1994/0FORS.php">Forrest Gump<br />
</a></b></td>
<td align="right">$679,400,525</td>
</tr>
<tr>
<td align="right">40</td>
<td align="center">1999</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/1999/SIXSN.php">The Sixth Sense<br />
</a></b></td>
<td align="right">$672,806,292</td>
</tr>
<tr>
<td align="right">41</td>
<td align="center">2002</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2002/STAR2.php">Star Wars Ep. II: Attack of the Clones<br />
</a></b></td>
<td align="right">$656,695,615</td>
</tr>
<tr>
<td align="right">42</td>
<td align="center">2003</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2003/PIRAT.php">Pirates of the Caribbean: Black Pearl<br />
</a></b></td>
<td align="right">$655,011,224</td>
</tr>
<tr>
<td align="right">43</td>
<td align="center">2006</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2006/ICEA2.php">Ice Age: The Meltdown<br />
</a></b></td>
<td align="right">$651,899,282</td>
</tr>
<tr>
<td align="right">44</td>
<td align="center">2004</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2004/NCRDB.php">The Incredibles<br />
</a></b></td>
<td align="right">$635,564,642</td>
</tr>
<tr>
<td align="right">45</td>
<td align="center">2008</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2008/PANDA.php">Kung Fu Panda<br />
</a></b></td>
<td align="right">$631,910,531</td>
</tr>
<tr>
<td align="right">46</td>
<td align="center">2007</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2007/RATUL.php">Ratatouille<br />
</a></b></td>
<td align="right">$624,445,654</td>
</tr>
<tr>
<td align="right">47</td>
<td align="center">2008</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2008/HANCK.php">Hancock<br />
</a></b></td>
<td align="right">$624,346,274</td>
</tr>
<tr>
<td align="right">48</td>
<td align="center">2004</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2004/PASON.php">The Passion of the Christ<br />
</a></b></td>
<td align="right">$611,899,420</td>
</tr>
<tr>
<td align="right">49</td>
<td align="center">2008</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2008/MAMIA.php">Mamma Mia!<br />
</a></b></td>
<td align="right">$602,500,560</td>
</tr>
<tr>
<td align="right">50</td>
<td align="center">2008</td>
<td align="left"><b><a href="http://www.the-numbers.com/movies/2008/MADG2.php">Madagascar: Escape 2 Africa<br />
</a></b></td>
<td align="right">$599,761,756</td>
</tr>
</tbody>
</table>
<p><strong><br />
Source:</strong> <a href="http://www.the-numbers.com/movies/international/records.php">http://www.the-numbers.com/movies/international/records.php</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=197&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2010/01/25/197/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
		<item>
		<title>Pacman Song for Floyd</title>
		<link>http://thegame28.wordpress.com/2009/12/09/pacman-song-for-floyd/</link>
		<comments>http://thegame28.wordpress.com/2009/12/09/pacman-song-for-floyd/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 05:02:22 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/2009/12/09/pacman-song-for-floyd/</guid>
		<description><![CDATA[This appeared in the &#8220;Examiner&#8221;, a newspaper in the USA . made to taunt Mayweather so as to force him to fight PACMAN. I think Pinoy ang nagpadala nito sa Examiner. Sing to the tune of &#8220;Sometimes When We Touch&#8221; by Dan Hill, a sung by Pacman in Jimmy Kimmell Live. Enjoy singing. Subject: Pacman&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=196&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This appeared in the &#8220;Examiner&#8221;, a newspaper in the USA . made to taunt Mayweather so as to force him to fight PACMAN. I think Pinoy ang nagpadala nito sa Examiner.  Sing to the tune of &#8220;Sometimes When We Touch&#8221; by Dan Hill, a sung by Pacman in Jimmy Kimmell Live. Enjoy singing.</p>
<p>Subject:  Pacman&#8217;s Song To Floyd  </p>
<p>They asked you if you&#8217;ll fight me<br />
And you choked on your reply<br />
I&#8217;d rather Arum deal with you<br />
Than mislead you with a lie</p>
<p>And who am I to judge you,<br />
On what you say or do<br />
The fans are now beginning<br />
To see the real you.. </p>
<p>And someday when we touch<br />
My LEFT will be too much<br />
That you have to close your eyes<br />
Where do you hide?</p>
<p>I wanna pound you til you&#8217;re white<br />
`Til your face breaks down and cry<br />
I wanna beat you<br />
`Til you dream and say, goodnight.</p>
<p>You think you are a strategist<br />
That you can insult my pride<br />
But through your insecurities<br />
You&#8217;re ZERO loss seemed right</p>
<p>You&#8217;re just another fighter<br />
So far from what is true<br />
An overrated boxer<br />
Who never gives his due </p>
<p>And someday when we touch<br />
My RIGHT will be too much<br />
That you have to close your eyes<br />
Where do you hide?</p>
<p>I wanna pound you til you&#8217;re white<br />
`Til your face breaks down and cry<br />
I wanna beat you<br />
`Til you dream and say, goodnight. </p>
<p>At times I&#8217;d like to break you<br />
And drive you to your knees<br />
The fans would like to watch you<br />
And see your first defeat</p>
<p>Your huggers understand you<br />
And we know how hard they try<br />
I&#8217;ve watched your Dad protect you<br />
And your Uncle loves to smile (big laugh) </p>
<p>My coach thinks your a loser<br />
Still searching for a break<br />
You think your odds are better<br />
But then the public bets AGAINST! </p>
<p>And someday when we touch<br />
My SPEED will be too much<br />
That you have to close your eyes<br />
Where can you hide?</p>
<p>I wanna pound you til you&#8217;re white<br />
`Til your face breaks down and cry<br />
I wanna beat you<br />
`Til you dream and say, goodnight! </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=196&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2009/12/09/pacman-song-for-floyd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
		<item>
		<title>Protected: Extreme Girl</title>
		<link>http://thegame28.wordpress.com/2009/09/04/my-extreme-girl/</link>
		<comments>http://thegame28.wordpress.com/2009/09/04/my-extreme-girl/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 15:11:06 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[Profiler]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=190</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=190&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post is password protected. You must visit the website and enter the password to continue reading.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=190&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2009/09/04/my-extreme-girl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone SDK &#8211; Adding image in TableView</title>
		<link>http://thegame28.wordpress.com/2009/01/15/adding-image-in-tableview/</link>
		<comments>http://thegame28.wordpress.com/2009/01/15/adding-image-in-tableview/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 07:23:10 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=133</guid>
		<description><![CDATA[In this tutorial, we will try to add image from the left side of table view just like General Settings in iPhone/iPod Touch. First &#8211; Create a string that contains source url of image file like “Image Name” and “Image Type”.Then create an Image using this String. Then upload the image to the cell. NSString [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=133&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, we will try to add image from the left side of table view just like General Settings in iPhone/iPod Touch.</p>
<p>First &#8211; Create a string that contains source url of image file like “Image Name” and “Image Type”.Then create an Image using this String. Then upload the image to the cell.</p>
<p><span style="color:#000099;">NSString *imgSource = [[NSBundle mainBundle] pathForResource:@&#8221;jigsaw&#8221; ofType:@&#8221;png&#8221;];</span><br />
<span style="color:#000099;">UIImage *img</span><span style="color:#000099;"> = [UIImage imageWithContentsOfFile: </span><span style="color:#000099;">imgSource</span><span style="color:#000099;">];</span><br />
<span style="color:#000099;">cell.image = </span><span style="color:#000099;">img</span><span style="color:#000099;">;</span></p>
<p><span style="color:#000099;"><br />
</span></p>
<p>Note : The jigsaw.png should be in your “Resources” folder in XCode.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=133&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2009/01/15/adding-image-in-tableview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
		<item>
		<title>An overview about the iPhone SDK</title>
		<link>http://thegame28.wordpress.com/2008/10/29/an-overview-about-the-iphone-sdk/</link>
		<comments>http://thegame28.wordpress.com/2008/10/29/an-overview-about-the-iphone-sdk/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 04:47:02 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=126</guid>
		<description><![CDATA[The iPhone SDK was announced officially on March 6, 2008, the first beta release was on July 11, 2008 which demanded a firmware update for all iPhone and iPod users. The SDK continued to develop with time until the Beta3 update to the 2.1 SDK was released on August 8, 2008. Here is a small [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=126&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The iPhone SDK was announced officially on March 6, 2008, the first beta release was on July 11, 2008 which demanded a firmware update for all iPhone and iPod users. The SDK continued to develop with time until the Beta3 update to the 2.1 SDK was released on August 8, 2008.</p>
<p>Here is a small timeline.</p>
<table border="1" cellspacing="0" cellpadding="0" width="447">
<tbody>
<tr>
<td valign="top"><strong><span>Date of release</span></strong></td>
<td valign="top"><strong><span>SDK Version release</span></strong></td>
<td valign="top"><strong><span>iPhone OS Version</span></strong></td>
</tr>
<tr>
<td valign="top">March 6, 2008</td>
<td valign="top">First beta</td>
<td valign="top">1.2b1</td>
</tr>
<tr>
<td valign="top">March 27, 2008</td>
<td valign="top">Beta 2</td>
<td valign="top">2.0b2</td>
</tr>
<tr>
<td valign="top">April 8, 2008</td>
<td valign="top">Beta 3</td>
<td valign="top">2.0b3</td>
</tr>
<tr>
<td valign="top">April 23, 2008</td>
<td valign="top">Beta 4</td>
<td valign="top">2.0b4</td>
</tr>
<tr>
<td valign="top">May 6, 2008</td>
<td valign="top">Beta 5</td>
<td valign="top">2.0b5</td>
</tr>
<tr>
<td valign="top">May 29, 2008</td>
<td valign="top">Beta 6</td>
<td valign="top">2.0b6</td>
</tr>
<tr>
<td valign="top">June 9, 2008</td>
<td valign="top">Beta 7</td>
<td valign="top">2.0b7</td>
</tr>
<tr>
<td valign="top">June 26, 2008</td>
<td valign="top">Beta 8</td>
<td valign="top">2.0b8</td>
</tr>
<tr>
<td valign="top">July 24, 2008</td>
<td valign="top">First Beta for OS v2.0</td>
<td valign="top">2.1</td>
</tr>
<tr>
<td valign="top">July 30, 2008</td>
<td valign="top">Beta 2 update v2.0</td>
<td valign="top">2.1</td>
</tr>
<tr>
<td valign="top">August 8, 2008</td>
<td valign="top">Beta 3 update v2.0</td>
<td valign="top">2.1</td>
</tr>
</tbody>
</table>
<p><strong>The iPhone SDK package contents</strong></p>
<p>The SDK is broken down to the following:</p>
<p><strong>Cocoa Touch</strong></p>
<p>The <strong>Cocoa Touch </strong>layer is one of the most important layers in iPhone OS. It comprises the UIKit and Foundation frameworks (UIKit.framework and Foundation.framework), which provide the basic tools and infrastructure you need to implement graphical, event-driven applications in iPhone OS.</p>
<p>It also includes several other frameworks that provide key services for accessing device features, such as the user’s contacts.</p>
<p>This framework is used to implement the core set of features.</p>
<ul>
<li>Application management</li>
<li>Graphics and windowing support</li>
<li>Event-handling support</li>
<li>User interface management</li>
<li>Objects representing the standard system views and controls</li>
<li>Support for text and web content</li>
<li>Accelerometer data</li>
<li>The built-in camera (where present)</li>
<li>The user’s photo library</li>
<li>Device-specific information</li>
</ul>
<p><strong>Media</strong></p>
<p>The graphics and media technologies in iPhone OS are geared toward creating the best multimedia experience available on a mobile device. More importantly, these technologies were designed to make it easy for you to build good-looking and -sounding applications quickly. The high-level frameworks in iPhone OS make it easy to create advanced graphics and animations quickly, while the low-level frameworks provide you with access to the tools you need to do things exactly the way you want.</p>
<ul>
<li>OpenAL</li>
<li>Audio mixing and recording</li>
<li>Video playback</li>
<li>Image file formats</li>
<li>Quatrz</li>
<li>Core Animation</li>
<li>OpenGL ES</li>
</ul>
<p><strong>Core Services</strong></p>
<p>The <strong>Core Services </strong>layer provides the fundamental system services that all applications use. Even if you do not use these technologies directly, every other technology in the system is built on top of them.</p>
<ul>
<li>Networking</li>
<li>Embedded SQLite database</li>
<li>GeoLocation</li>
<li>Threads</li>
</ul>
<p><strong>OS X Kernel</strong></p>
<p>The <strong>Core OS </strong>layer encompasses the kernel environment, drivers, and basic interfaces of the operating system. The kernel itself is based on Mach and is responsible for every aspect of the operating system. It manages the virtual memory system, threads, file system, network, and inter-process communication.</p>
<p>The drivers at this layer also provide the interface between the available hardware and the system frameworks that vend hardware features. Access to kernel and drivers is restricted to a limited set of system frameworks and applications. iPhone OS provides a set of interfaces for accessing many low-level features of the operating system.</p>
<p>Your application accesses these features through the LibSystem library. The interfaces are C-based and provide support for the following:</p>
<ul>
<li>Threading (POSIX threads)</li>
<li>Networking (BSD sockets)</li>
<li>File-system access</li>
<li>Standard I/O</li>
<li>Bonjour and DNS services</li>
<li>Locale information</li>
<li>Memory allocation</li>
</ul>
<p><strong>Develop your first iPhone application:</strong></p>
<p><strong>Things you need before going any further:</strong></p>
<ul>
<li>A “<strong><em>MAC OS X</em></strong>” platform of version 10.5.3 or later. You can get an original MAC box or you can simply get one of the hacked versions of the MAC OS, for more information click <a href="http://www.osx86project.org/">here</a>.</li>
<li>The <strong><em>iPhone SDK</em></strong> “Software Development Kit” you can get one from the iPhone developer program home page, or simply click <a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://developer.apple.com/iphone/sdk1/">here</a>.</li>
<li><strong><em>Xcode</em></strong>, the IDE “Integrated Development Environment” used to develop applications and software for MAC based platforms. Although one of Xcode’s goals is to reduce the time you spend writing code, you still devote a considerable part of your development in the text editor. To that end, the text and source editor provide many features with the aim of making your source-code editing a productive and efficient endeavor. Code folding, code completion, Edit All in Scope, Refactoring, and other features allow you to focus your attention on the right areas and to use your time as efficiently as possible. It’s packed with the iPhone installer, so no need to worry about it.</li>
<li><strong><em>Interface builder</em></strong>, this application lets you design compelling user interfaces graphically. Your work is saved as nib files that your application loads at runtime. This means that you what you design is exactly what users of your application see; you work with the actual controls that iPhone OS places on the users’ screens. It also means that you spend less effort codifying the user-interface–related aspects of your application in source code. It’s also supplied in the SDK package.</li>
</ul>
<p><strong>Other developing applications you may use:</strong></p>
<ul>
<li><strong><em>Debugger</em></strong><strong>, </strong>as you start testing your application, you may need to step through your code to the cause of unexpected behavior. Xcode’s debugging facilities provide the usual debugging features, such as breakpoints, viewing variables, and so forth. But Xcode provides these and other debugging features right in the text editor. That is, you can make a change in your code, add a breakpoint, start your application, and perform most debugging tasks in the same window.</li>
<li><strong><em>Instruments</em></strong><strong>, </strong>as you near the end of the development process, you must ensure your application uses the resources of the device on which it’s running as efficiently as possible, so that battery power is not wasted and your application does not gather system resources unnecessarily. “Instruments” shows your application’s resource usage, including memory, CPU, and network, in a graphical timeline that lets you see how your application behaves over time.</li>
</ul>
<p><strong>The MVC design pattern:</strong></p>
<p>The structure of iPhone applications is based on the <strong>Model-View-Controller (MVC) </strong>design pattern because it benefits object-oriented programs in several ways. MVC–based programs tend to be more adaptable to changing requirements—in other words, they are more easily extensible than programs that do not use MVC. Furthermore, the objects in these programs tend to be more reusable and their interfaces tend to be better defined.</p>
<p>In the MVC design pattern, the <strong>model layer </strong>consists of objects that represent the data your application manages. The objects in this layer should be organized in the way that makes the most sense for the data. External interactions with model objects occur through a well-defined set of interfaces, whose job is to ensure the integrity of the underlying data at all times.</p>
<p>The <strong>view layer </strong>defines the presentation format and appearance of the application. This layer consists of your application’s windows, views, and controls. The views can be standard system views or custom views you create. You configure these views to display the data from your model objects in an appropriate way. In addition, your view objects need to generate notifications in response to events and user interactions with that data.</p>
<p>The <strong>controller layer </strong>acts as the bridge between the model and view layers. It receives the notifications generated by the view layer and uses them to make the corresponding changes in the data model. Similarly, if the data in the data layer changes for other reasons (perhaps because of some internal computation loop), it notifies an appropriate controller object, which then updates the views.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=126&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2008/10/29/an-overview-about-the-iphone-sdk/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
		<item>
		<title>Design Patterns?</title>
		<link>http://thegame28.wordpress.com/2008/10/12/design-patterns-2/</link>
		<comments>http://thegame28.wordpress.com/2008/10/12/design-patterns-2/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 17:53:44 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=50</guid>
		<description><![CDATA[What is Design Patterns? Is a general reusable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects. History Patterns originated as an architectural [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=50&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Tahoma;">What is Design Patterns? </span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Is a general reusable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects.</span><span style="font-size:10pt;font-family:Tahoma;"> </span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Tahoma;">History</span></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Patterns originated as an architectural concept by Christopher Alexander (1977/79). In 1987, Kent Beck and Ward Cunningham began experimenting with the idea of applying patterns to programming.Presented their results at the OOPSLA conference that year. In the following years, Beck, Cunningham and others followed up on this work.</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Design patterns gained popularity in computer science after the book <span>Design Patterns: Elements of Reusable Object Oriented Software</span> was published in 1994.</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Design patterns were introduced to the software community by</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">GoF or Gang of Four:</span></p>
<ol style="margin-top:0;" type="1">
<li class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Erich Gamma </span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Richard Helm</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Ralph Johnson</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">John Vlissides</span></li>
</ol>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Tahoma;">Why Use Design Patterns?</span></strong><strong></strong></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Aren’t structural programming good enough?</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Aren’t functions are good enough?</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Tahoma;">Design Patterns are beneficial in regards of:</span></strong></p>
<p><!--[if !supportLists]--></p>
<ul>
<li><span style="font-size:10pt;font-family:Tahoma;">Maintenance </span></li>
<li><span style="font-size:10pt;font-family:Tahoma;">Documentation </span></li>
<li><span style="font-size:10pt;font-family:Tahoma;">Readability </span></li>
<li><span style="font-size:10pt;font-family:Symbol;"><span><span style="font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-family:&quot;"> </span></span></span><span style="font-size:10pt;font-family:Tahoma;">Easy when developing in large development teams </span></li>
<li><!--[if !supportLists]--><span style="font-size:10pt;font-family:Symbol;"><span><span style="font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-family:&quot;"> </span></span></span><!--[endif]--><span style="font-size:10pt;font-family:Tahoma;">Developing Code to be used by other then yourself</span></li>
</ul>
<p><!--[endif]--><!--[if !supportLists]--><!--[endif]--><!--[if !supportLists]--><!--[endif]--><!--[if !supportLists]--><!--[endif]--></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Tahoma;">System Requirements</span></strong><strong></strong></p>
<ul>
<li><!--[if !supportLists]--><span style="font-size:10pt;font-family:Symbol;"><span><span style="font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-family:&quot;"> </span></span></span><!--[endif]--><span style="font-size:10pt;font-family:Tahoma;">No specific tools are needed to use Design Patterns.</span></li>
<li><!--[if !supportLists]--><span style="font-size:10pt;font-family:Symbol;"><span><span style="font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;font-family:&quot;"> </span></span></span><!--[endif]--><span style="font-size:10pt;font-family:Tahoma;">It would probably be object-oriented language of choice.</span></li>
<li><!--[if !supportLists]--><!--[endif]--><span style="font-size:10pt;font-family:Tahoma;">Language features such as polymorphism, inheritance, classes, and objects.</span></li>
</ul>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Tahoma;">Design patterns are group in three categories <strong>Creational</strong> Patterns, <strong>Structural</strong> Patterns and <strong>Behavioral</strong> Patterns.</span></p>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Tahoma;">Creational design patterns</span></strong><span style="font-size:10pt;font-family:Tahoma;"> &#8211; are design patterns that deal with object-creational patterns and class-creational patterns, and is all about class instantiation.</span></p>
<ul>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Factory Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Abstract Factory Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Builder Pattern</span></strong><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;"> </span></strong><strong></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Prototype Pattern</span></strong><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;"> </span></strong></li>
<li><strong></strong><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Singleton Pattern</span></strong><strong></strong></li>
</ul>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Tahoma;">Structural design patterns</span></strong><span style="font-size:10pt;font-family:Tahoma;"> &#8211; are design patterns that ease the design by identifying a simple way to realize relationships between entities. </span></p>
<ul>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Adapter Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Bridge Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Composite Pattern</span></strong><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;"> </span></strong><strong></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Decorator Pattern</span></strong><strong></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Facade Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Flyweight Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Proxy Pattern</span></strong></li>
</ul>
<p class="MsoNormal"><strong><span style="font-size:10pt;font-family:Tahoma;">Behavioral design patterns</span></strong><span style="font-size:10pt;font-family:Tahoma;"> &#8211; Are those patterns that are most specifically concerned with communication between objects. </span></p>
<ul>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Observer Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Mediator Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Chain of Responsibility Pattern</span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Template Pattern</span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Interpreter Pattern</span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;"> Strategy Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Visitor Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">State Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Command Pattern </span></strong></li>
<li><strong><span style="font-size:10pt;font-family:Tahoma;color:gray;">Iterator Pattern</span></strong></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=50&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2008/10/12/design-patterns-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
		<item>
		<title>Software Developers are Brave by Nature</title>
		<link>http://thegame28.wordpress.com/2008/09/24/software-developers-are-brave-by-nature/</link>
		<comments>http://thegame28.wordpress.com/2008/09/24/software-developers-are-brave-by-nature/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 06:43:52 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=88</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=88&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://thegame28.files.wordpress.com/2008/09/sw.jpg"><img class="alignnone size-full wp-image-89" title="sw" src="http://thegame28.files.wordpress.com/2008/09/sw.jpg?w=500&#038;h=264" alt="" width="500" height="264" /></a><a id="add_image" class="thickbox" href="media-upload.php?post_id=88&amp;type=image&amp;TB_iframe=true&amp;width=640&amp;height=748"> </a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=88&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2008/09/24/software-developers-are-brave-by-nature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>

		<media:content url="http://thegame28.files.wordpress.com/2008/09/sw.jpg" medium="image">
			<media:title type="html">sw</media:title>
		</media:content>
	</item>
		<item>
		<title>Programmer or Developer?</title>
		<link>http://thegame28.wordpress.com/2008/09/23/programmer-or-developer/</link>
		<comments>http://thegame28.wordpress.com/2008/09/23/programmer-or-developer/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 08:53:33 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=75</guid>
		<description><![CDATA[A Software Programmer is someone who really knows the environment he is programming. He knows everything there is to know about the language, the API and the Framework he’s using. He can do low level optimizations because he knows in detail what the compiler does behind the scenes. He is indeed a Wizard and a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=75&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A Software Programmer is someone who really knows the environment he is programming. He knows everything there is to know about the language, the API and the Framework he’s using. He can do low level optimizations because he knows in detail what the compiler does behind the scenes. He is indeed a Wizard and a Guru of his domain. A Software Programmer usually starts with the implementation (probably because that’s what he is doing best) and work his way outwards.</p>
<p>A Software Developer on the other hand is a specialist at giving the customer (user) what he wants and what he needs. He doesn’t waste time on premature optimizations; he prioritize maintainability over performance, unless the performance is <em>proved</em> to be unacceptable; he has great testing skills, designing skills and communication skills; He is empathic, knows his <a title="Human Computer Interaction" href="http://en.wikipedia.org/wiki/Human-Computer_Interaction">HCI</a>, and cares more about the user than he cares about his code. He cares so much that he usually becomes an expert himself of the users domains. A Software Developer starts with the interface (probably because that’s what he does best) and work his way inwards.</p>
<p>A person can be both, or more of one or the other. In a team you want both kinds but they are rarely found within the same individual. I, for instance, consider myself a great developer but an intermediate programmer. One simple way to test what type you are is to ask yourself this question: Do I care more for the interface (<a title="Graphical User Interface" href="http://en.wikipedia.org/wiki/Gui">GUI</a> or Programming Interface) than I do for the implementation? If you think the implementation is unimportant as long as it does what you want, and is reasonably maintainable, then you’re probably a Software Developer. If you find the previous sentence a blasphemy, you could be a Software Programmer. Which one is it?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=75&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2008/09/23/programmer-or-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction to the Spring Framework By Rod Johnson</title>
		<link>http://thegame28.wordpress.com/2008/09/23/introduction-to-the-spring-framework-by-rod-johnson/</link>
		<comments>http://thegame28.wordpress.com/2008/09/23/introduction-to-the-spring-framework-by-rod-johnson/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 08:40:51 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=82</guid>
		<description><![CDATA[Since the first version of this article was published in October, 2003, the Spring Framework has steadily grown in popularity. It has progressed through version 1.0 final to the present 1.2, and has been adopted in a wide range of industries and projects. In this article, I’ll try to explain what Spring sets out to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=82&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="entry">
<div class="snap_preview">
<p>Since the first version of this article was published in October, 2003, the Spring Framework has steadily grown in popularity. It has progressed through version 1.0 final to the present 1.2, and has been adopted in a wide range of industries and projects. In this article, I’ll try to explain what Spring sets out to achieve, and how I believe it can help you to develop J2EE applications.</p>
<h2>Yet another framework?</h2>
<p>You may be thinking “not another framework.” Why should you read this article, or download the Spring Framework (if you haven’t already), when there are so many J2EE frameworks, or when you could build your own framework? The sustained high level of interest in the community is one indication that Spring must offer something valuable; there are also numerous technical reasons.</p>
<p>I believe that Spring is unique, for several reasons:</p>
<ul>
<li><strong>It addresses important areas that many other popular frameworks  don’t</strong>. Spring focuses around providing a way to manage your business  objects.</li>
<li><strong>Spring is both comprehensive and modular.</strong> Spring has a layered architecture, meaning that you can choose to use just about any part of it in isolation, yet its architecture is internally consistent. So you get maximum value from your learning curve. You might choose to use Spring only to simplify use of JDBC, for example, or you might choose to use Spring to manage all your business objects. And it’s easy to introduce Spring incrementally into existing projects.</li>
<li><strong>Spring is designed from the ground up to help you write code that’s easy  to test.</strong> Spring is an ideal framework for test driven projects.</li>
<li><strong>Spring is an increasingly important integration technology</strong>, its role  recognized by several large vendors.</li>
</ul>
<p>Spring is not necessarily one more framework dependency for your project. Spring is potentially a one-stop shop, addressing most infrastructure concerns of typical applications. It also goes places other frameworks don’t.</p>
<p>An open source project since February 2003, Spring has a long heritage. The open source project started from infrastructure code published with my book, <a href="http://www.wrox.com/books/0764543857.shtml" target="_blank">Expert  One-on-One J2EE Design and Development</a>, in late 2002. Expert One-on-One J2EE laid out the basic architectural thinking behind Spring. However, the architectural concepts go back to early 2000, and reflect my experience in developing infrastructure for a series of successful commercial projects.</p>
<p>Since January 2003, Spring has been hosted on SourceForge. There are now 20 developers, with the leading contributors devoted full-time to Spring development and support. The flourishing open source community has helped it evolve into far more than could have been achieved by any individual.</p>
<h2>Architectural benefits of Spring</h2>
<p>Before we get down to specifics, let’s look at some of the benefits Spring  can bring to a project:</p>
<ul>
<li>Spring can effectively organize your middle tier objects, whether or not you choose to use EJB. Spring takes care of plumbing that would be left up to you if you use only Struts or other frameworks geared to particular J2EE APIs. And while it is perhaps most valuable in the middle tier, Spring’s configuration management services can be used in any architectural layer, in whatever runtime environment.</li>
<li>Spring can eliminate the proliferation of Singletons seen on many projects. In my experience, this is a major problem, reducing testability and object orientation.</li>
<li>Spring can eliminate the need to use a variety of custom properties file formats, by handling configuration in a consistent way throughout applications and projects. Ever wondered what magic property keys or system properties a particular class looks for, and had to read the Javadoc or even source code? With Spring you simply look at the class’s JavaBean properties or constructor arguments. The use of <strong>Inversion of Control</strong> and <strong>Dependency  Injection</strong> (discussed below) helps achieve this simplification.</li>
<li>Spring can facilitate good programming practice by reducing the cost of programming to interfaces, rather than classes, almost to zero.</li>
<li>Spring is designed so that applications built with it depend on as few of its APIs as possible. Most business objects in Spring applications have no dependency on Spring.</li>
<li>Applications built using Spring are very easy to unit test.</li>
<li>Spring can make the use of EJB an implementation choice, rather than the determinant of application architecture. You can choose to implement business interfaces as POJOs or local EJBs without affecting calling code.</li>
<li>Spring helps you solve many problems without using EJB. Spring can provide an alternative to EJB that’s appropriate for many applications. For example, Spring can use AOP to deliver declarative transaction management without using an EJB container; even without a JTA implementation, if you only need to work with a single database.</li>
<li>Spring provides a consistent framework for data access, whether using JDBC or an O/R mapping product such as TopLink, Hibernate or a JDO implementation.</li>
<li>Spring provides a consistent, simple programming model in many areas, making it an ideal architectural “glue.” You can see this consistency in the Spring approach to JDBC, JMS, JavaMail, JNDI and many other important APIs.</li>
</ul>
<p><strong>Spring is essentially a technology dedicated to enabling you to build  applications using POJOs.</strong> This desirable goal requires a sophisticated  framework, which conceals much complexity from the developer.</p>
<p>Thus Spring really can enable you to implement the simplest possible solution  to your problems. And that’s worth a lot.</p>
<h2>What does Spring do?</h2>
<p>Spring provides a lot of functionality, so I’ll quickly review each major  area in turn.</p>
<p><strong>Mission statement</strong></p>
<p>Firstly, let’s be clear on Spring’s scope. Although Spring covers a lot of ground, we have a clear vision as to what it should and shouldn’t address.</p>
<p>Spring’s main aim is to make J2EE easier to use and promote good programming practice. It does this by enabling a POJO-based programming model that is applicable in a wide range of environments.</p>
<p>Spring does <strong>not</strong> reinvent the wheel. Thus you’ll find no logging packages in Spring, no connection pools, no distributed transaction coordinator. All these things are provided by open source projects (such as Commons Logging, which we use for all our log output, or Commons DBCP), or by your application server. For the same reason, we don’t provide an O/R mapping layer. There are good solutions to this problem such as TopLink, Hibernate and JDO.</p>
<p>Spring does aim to make existing technologies easier to use. For example, although we are not in the business of low-level transaction coordination, we do provide an abstraction layer over JTA or any other transaction strategy.</p>
<p>Spring doesn’t directly compete with other open source projects unless we feel we can provide something new. For example, like many developers, we have never been happy with Struts, and felt that there was room for improvement in MVC web frameworks. (With Spring MVC adoption growing rapidly, it seems that many agree with us.) In some areas, such as its lightweight IoC container and AOP framework, Spring does have direct competition, but Spring was a pioneer in those areas.</p>
<p>Spring benefits from internal consistency. All the developers are singing from the same hymn sheet, the fundamental ideas remaining faithful to those of <em>Expert One-on-One J2EE Design and Development</em>. And we’ve been able to use  some central concepts, such as Inversion of Control, across multiple areas.</p>
<p>Spring is portable between application servers. Of course ensuring portability is always a challenge, but we avoid anything platform-specific or non-standard in the developer’s view, and support users on WebLogic, Tomcat, Resin, JBoss, Jetty, Geronimo, WebSphere and other application servers. Spring’s non-invasive, POJO, approach enables us to take advantage of environment-specific features without sacrificing portability, as in the case of enhanced WebLogic transaction management functionality in Spring 1.2 that uses BEA proprietary APIs under the covers.</p>
<p><strong>Inversion of control container</strong></p>
<p>The core of Spring is the <tt>org.springframework.beans</tt> package, designed for working with JavaBeans. This package typically isn’t used directly by users, but underpins much Spring functionality.</p>
<p>The next higher layer of abstraction is the <strong>bean factory</strong>. A Spring bean factory is a generic factory that enables objects to be retrieved by name, and which can manage relationships between objects.</p>
<p>Bean factories support two modes of object:</p>
<ul>
<li><strong>Singleton</strong>: in this case, there’s one shared instance of the object with a particular name, which will be retrieved on lookup. This is the default, and most often used, mode. It’s ideal for stateless service objects.</li>
<li><strong>Prototype</strong> or non-singleton: in this case, each retrieval will result in the creation of an independent object. For example, this could be used to allow each caller to have its own distinct object reference.</li>
</ul>
<p>Because the Spring container manages relationships between objects, it can add value where necessary through services such as transparent pooling for managed POJOs, and support for hot swapping, where the container introduces a level of indirection that allows the target of a reference to be swapped at runtime without affecting callers and without loss of thread safety. One of the beauties of Dependency Injection (discussed shortly) is that all this is possible transparently, with no API involved.</p>
<p>As <tt>org.springframework.beans.factory.BeanFactory</tt> is a simple  interface, it can be implemented in different ways. The  <tt>BeanDefinitionReader</tt> interface separates the metadata format from  <tt>BeanFactory</tt> implementations themselves, so the generic  <tt>BeanFactory</tt> implementations Spring provides can be used with different  types of metadata. You could easily implement your own <tt>BeanFactory</tt> or  BeanDefinitionReader, although few users find a need to. The most commonly used  BeanFactory definitions are:</p>
<ul>
<li><tt>XmlBeanFactory</tt>. This parses a simple, intuitive XML structure defining the classes and properties of named objects. We provide a DTD to make authoring easier.</li>
<li><tt>DefaultListableBeanFactory</tt>: This provides the ability to parse bean  definitions in properties files, and create BeanFactories programmatically.</li>
</ul>
<p>Each bean definition can be a POJO (defined by class name and JavaBean initialisation properties or constructor arguments), or a <tt>FactoryBean</tt>.  The <tt>FactoryBean</tt> interface adds a level of indirection. Typically this is used to create proxied objects using AOP or other approaches: for example, proxies that add declarative transaction management. This is conceptually similar to EJB interception, but works out much simpler in practice, and is more powerful.</p>
<p>BeanFactories can optionally participate in a hierarchy, “inheriting” definitions from their ancestors. This enables the sharing of common configuration across a whole application, while individual resources such as controller servlets also have their own independent set of objects.</p>
<p>This motivation for the use of JavaBeans is described in Chapter 4 of  <em>Expert One-on-One J2EE Design and Development</em>, which is available on the  ServerSide as a free PDF (<a href="http://www.theserverside.com/articles/article.tss?l=RodJohnsonInterview" target="_blank">/articles/article.tss?l=RodJohnsonInterview</a>).</p>
<p>Through its bean factory concept, Spring is an <strong>Inversion of Control</strong> container. (I don’t much like the term <em>container</em>, as it conjures up visions of heavyweight containers such as EJB containers. A Spring BeanFactory is a container that can be created in a single line of code, and requires no special deployment steps.) Spring is most closely identified with a flavor of Inversion of Control known as <strong>Dependency Injection</strong>–a name coined by  Martin Fowler, Rod Johnson and the PicoContainer team in late 2003.</p>
<p>The concept behind Inversion of Control is often expressed in the  <strong>Hollywood Principle</strong>: “Don’t call me, I’ll call you.” IoC moves the responsibility for making things happen into the framework, and away from application code. Whereas your code calls a traditional class library, an IoC framework calls your code. Lifecycle callbacks in many APIs, such as the <tt>setSessionContext()</tt> method for session EJBs, demonstrate this  approach.</p>
<p>Dependency Injection is a form of IoC that removes explicit dependence on  container APIs; ordinary Java methods are used to <em>inject</em> dependencies such as collaborating objects or configuration values into application object instances. Where configuration is concerned this means that while in traditional container architectures such as EJB, a component might call the container to say “where’s object X, which I need to do my work”, with Dependency Injection the <em>container</em> figures out that the component needs an X object, and provides it to it at runtime. The container does this figuring out based on method signatures (usually JavaBean properties or constructors) and, possibly, configuration data such as XML.</p>
<p>The two major flavors of Dependency Injection are <strong>Setter Injection</strong> (injection via JavaBean setters); and <strong>Constructor Injection</strong> (injection via constructor arguments). Spring provides sophisticated support for both, and even allows you to mix the two when configuring the one object.</p>
<p>As well as supporting all forms of Dependency Injection, Spring also provides a range of callback events, and an API for traditional lookup where necessary. However, we recommend a pure Dependency Injection approach in general.</p>
<p>Dependency Injection has several important benefits. For example:</p>
<ul>
<li>Because components don’t need to look up collaborators at runtime, they’re much simpler to write and maintain. In Spring’s version of IoC, components express their dependency on other components via exposing JavaBean setter methods or through constructor arguments. The EJB equivalent would be a JNDI lookup, which requires the developer to write code that makes environmental assumptions.</li>
<li>For the same reasons, application code is much easier to test. For example, JavaBean properties are simple, core Java and easy to test: simply write a self-contained JUnit test method that creates the object and sets the relevant properties.</li>
<li>A good IoC implementation preserves strong typing. If you need to use a generic factory to look up collaborators, you have to cast the results to the desired type. This isn’t a major problem, but it is inelegant. With IoC you express strongly typed dependencies in your code and the framework is responsible for type casts. This means that type mismatches will be raised as errors when the framework configures the application; you don’t have to worry about class cast exceptions in your code.</li>
<li>Dependencies are explicit. For example, if an application class tries to load a properties file or connect to a database on instantiation, the environmental assumptions may not be obvious without reading the code (complicating testing and reducing deployment flexibility). With a Dependency Injection approach, dependencies are explicit, and evident in constructor or JavaBean properties.</li>
<li>Most business objects don’t depend on IoC container APIs. This makes it easy to use legacy code, and easy to use objects either inside or outside the IoC container. For example, Spring users often configure the Jakarta Commons DBCP DataSource as a Spring bean: there’s no need to write any custom code to do this. We say that an IoC container isn’t <strong>invasive</strong>: using it won’t invade your code with dependency on its APIs. Almost any POJO can become a component in a Spring bean factory. Existing JavaBeans or objects with multi-argument constructors work particularly well, but Spring also provides unique support for instantiating objects from static factory methods or even methods on other objects managed by the IoC container.</li>
</ul>
<p>This last point deserves emphasis. Dependency Injection is unlike traditional container architectures, such as EJB, in this minimization of dependency of application code on container. This means that your business objects can potentially be run in different Dependency Injection frameworks &#8211; or outside any framework &#8211; without code changes.</p>
<p>In my experience and that of Spring users, it’s hard to overemphasize the benefits that IoC–and, especially, Dependency Injection–brings to application code.</p>
<p>Dependency Injection is not a new concept, although it’s only recently made prime time in the J2EE community. There are alternative DI containers: notably, PicoContainer and HiveMind. PicoContainer is particularly lightweight and emphasizes the expression of dependencies through constructors rather than JavaBean properties. It does not use metadata outside Java code, which limits its functionality in comparison with Spring. HiveMind is conceptually more similar to Spring (also aiming at more than just IoC), although it lacks the comprehensive scope of the Spring project or the same scale of user community. EJB 3.0 will provide a basic DI capability as well.</p>
<p>Spring BeanFactories are very lightweight. Users have successfully used them inside applets, as well as standalone Swing applications. (They also work fine within an EJB container.) There are no special deployment steps and no detectable startup time associated with the container itself (although certain objects configured by the container may of course take time to initialize). This ability to instantiate a container almost instantly in any tier of an application can be very valuable.</p>
<p>The Spring BeanFactory concept is used throughout Spring, and is a key reason that Spring is so internally consistent. Spring is also unique among IoC containers in that it uses IoC as a basic concept throughout a full-featured framework.</p>
<p>Most importantly for application developers, one or more BeanFactories provide a well-defined layer of business objects. This is analogous to, but much simpler (yet more powerful), than a layer of local session beans. Unlike EJBs, the objects in this layer can be interrelated, and their relationships managed by the owning factory. Having a well-defined layer of business objects is very important to a successful architecture.</p>
<p>A Spring ApplicationContext is a subinterface of BeanFactory, which provides  support for:</p>
<ul>
<li>Message lookup, supporting internationalization</li>
<li>An eventing mechanism, allowing application objects to publish and  optionally register to be notified of events</li>
<li>Automatic recognition of special application-specific or generic bean  definitions that customize container behavior</li>
<li>Portable file and resource access</li>
</ul>
<p><strong>XmlBeanFactory example</strong></p>
<p>Spring users normally configure their applications in XML “bean definition” files. The root of a Spring XML bean definition document is a  element. The  element contains one  or more  definitions. We normally specify the class and properties of each bean definition. We must also specify the id, which will be the name that we’ll use this bean with in our code.</p>
<p>Let’s look at a simple example, which configures three application objects with relationships commonly seen in J2EE applications:</p>
<ul>
<li>A J2EE DataSource</li>
<li>A DAO that uses the DataSource</li>
<li>A business object that uses the DAO in the course of its work</li>
</ul>
<p>In the following example, we use a <tt>BasicDataSource</tt> from the Jakarta  Commons DBCP project. (<tt>ComboPooledDataSource</tt> from the C3PO project is  also an excellent option.) <tt>BasicDataSource</tt>, like many other existing classes, can easily be used in a Spring bean factory, as it offers JavaBean-style configuration. The close method that needs to be called on shutdown can be registered via Spring’s “destroy-method” attribute, to avoid the need for <tt>BasicDataSource</tt> to implement any Spring interface.</p>
<pre> &lt;bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;</pre>
<p>All the properties of <tt>BasicDataSource</tt> we’re interested in are Strings, so we specify their values with the “value” attribute. (This shortcut was introduced in Spring 1.2. It’s a convenient alternative to the  subelement, which is usable even for values that are problematic in XML attributes.) Spring uses the standard JavaBean PropertyEditor mechanism to convert String representations to other types if necessary.</p>
<p>Now we define the DAO, which has a bean reference to the DataSource. Relationships between beans are specified using the “ref” attribute or  element:</p>
<pre>  &lt;bean id="exampleDataAccessObject"  class="example.ExampleDataAccessObject"&gt;</pre>
<p>The business object has a reference to the DAO, and an int property (exampleParam). In this case, I’ve used the subelement syntax familiar to those who’ve used Spring prior to 1.2:</p>
<pre>&lt;bean id="exampleBusinessObject"  class="example.ExampleBusinessObject"&gt;

   10</pre>
<p>Relationships between objects are normally set explicitly in configuration, as in this example. We consider this to be a Good Thing in most cases. However, Spring also provides what we call “autowire” support, where it figures out the dependencies between beans. The limitation with this &#8211; as with PicoContainer &#8211; is that if there are multiple beans of a particular type it’s impossible to work out which instance a dependency of that type should be resolved to. On the positive side, unsatisfied dependencies can be caught when the factory is initialized. (Spring also offers an optional dependency check for explicit configuration, which can achieve this goal.)</p>
<p>We could use the autowire feature as follows in the above example, if we  didn’t want to code these relationships explicitly:</p>
<pre>&lt;bean id="exampleBusinessObject" class="example.ExampleBusinessObject" autowire="byType"&gt;</pre>
<p>With this usage, Spring will work out that the dataSource property of exampleBusinessObject should be set to the implementation of DataSource it finds in the present BeanFactory. It’s an error if there is none, or more than one, bean of the required type in the present BeanFactory. We still need to set the exampleParam property, as it’s not a reference.</p>
<p>Autowire support has the advantage of reducing the volume of configuration. It also means that the container can learn about application structure using reflection, so if you add an additional constructor argument of JavaBean property, it may be successfully populated without any need to change configuration. The tradeoffs around autowiring need to be evaluated carefully.</p>
<p>Externalizing relationships from Java code has an enormous benefit over hard coding it, as it’s possible to change the XML file without changing a line of Java code. For example, we could simply change the <tt>myDataSource</tt> bean definition to refer to a different bean class to use an alternative connection pool, or a test data source. We could use Spring’s JNDI location FactoryBean to get a datasource from an application server in a single alternative XML stanza, as follows. There would be no impact on Java code or any other bean definitions.</p>
<pre>&lt;bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;</pre>
<p>Now let’s look at the Java code for the example business object. Note that there are no Spring dependencies in the code listing below. Unlike an EJB container, a Spring BeanFactory is not invasive: you don’t normally need to code awareness of it into application objects.</p>
<pre>public class ExampleBusinessObject implements MyBusinessObject {

 private ExampleDataAccessObject dao; private int exampleParam;

 public void setDataAccessObject(ExampleDataAccessObject dao) {  this.dao = dao; }

 public void setExampleParam(int exampleParam) {  this.exampleParam = exampleParam; }

 public void myBusinessMethod() {  // do stuff using dao }}</pre>
<p>Note the property setters, which correspond to the XML references in the bean definition document. These are invoked by Spring before the object is used.</p>
<p>Such application beans do not need to depend on Spring: They don’t need to implement any Spring interfaces or extend Spring classes: they just need to observe JavaBeans naming convention. Reusing one outside of a Spring application context is easy, for example in a test environment. Just instantiate it with its default constructor, and set its properties manually, via <tt>setDataSource()</tt> and <tt>setExampleParam()</tt> calls. So long as you have a no-args constructor, you’re free to define other constructors taking multiple properties if you want to support programmatic construction in a single line of code.</p>
<p>Note that the JavaBean properties are not declared on the business interface callers will work with. They’re an implementation detail. We can easily “plug in” different implementing classes that have different bean properties without affecting connected objects or calling code.</p>
<p>Of course Spring XML bean factories have many more capabilities than described here, but this should give you a feel for the basic approach. As well as simple properties, and properties for which you have a JavaBeans PropertyEditor, Spring can handle lists, maps and <tt>java.util.Properties</tt>.  Other advanced container capabilities include:</p>
<ul>
<li><strong>Inner beans</strong>, in which a property element contains an anonymous bean  definition not visible at top-level scope</li>
<li><strong>Post processors</strong>: special bean definitions that customize container  behavior</li>
<li><strong>Method Injection</strong>, a form of IoC in which the container implements an abstract method or overrides a concrete method to inject a dependency. This is a more rarely used form of Dependency Injection than Setter or Constructor Injection. However, it can be useful to avoid an explicit container dependency when looking up a new object instance for each invocation, or to allow configuration to vary over time–for example, with the method implementation being backed by a SQL query in one environment and a fil system read in another.</li>
</ul>
<p>Bean factories and application contexts are often associated with a scope defined by the J2EE server or web container, such as:</p>
<ul>
<li>The Servlet context. In the Spring MVC framework, an application context is defined for each web application containing common objects. Spring provides the ability to instantiate such a context through a listener or servlet without dependence on the Spring MVC framework, so it can also be used in Struts, WebWork or other web frameworks.</li>
<li>A Servlet: Each controller servlet in the Spring MVC framework has its own application context, derived from the root (application-wide) application context. It’s also easy to accomplish this with Struts or another MVC framework.</li>
<li>EJB: Spring provides convenience superclasses for EJB that simplify EJB authoring and provide a BeanFactory loaded from an XML document in the EJB Jar file.</li>
</ul>
<p>These hooks provided by the J2EE specification generally avoid the need to  use a Singleton to bootstrap a bean factory.</p>
<p>However, it’s trivial to instantiate a BeanFactory programmatically if we wish. For example, we could create the bean factory and get a reference to the business object defined above in the following three lines of code:</p>
<pre>XmlBeanFactory bf = new XmlBeanFactory(new ClassPathResource("myFile.xml", getClass()));MyBusinessObject mbo = (MyBusinessObject) bf.getBean("exampleBusinessObject");</pre>
<p>This code will work outside an application server: it doesn’t even depend on J2EE, as the Spring IoC container is pure Java. The <strong>Spring Rich</strong> project (a framework for simplifying the development of Swing applications using Spring) demonstrates how Spring can be used outside a J2EE environment, as do Spring’s integration testing features, discussed later in this article. Dependency Injection and the related functionality is too general and valuable to be confined to a J2EE, or server-side, environment.</p>
<p><strong>JDBC abstraction and data  access exception hierarchy</strong></p>
<p>Data access is another area in which Spring shines.</p>
<p>JDBC offers fairly good abstraction from the underlying database, but is a  painful API to use. Some of the problems include:</p>
<ul>
<li>The need for verbose error handling to ensure that ResultSets, Statements and (most importantly) Connections are closed after use. This means that correct use of JDBC can quickly result in a lot of code. It’s also a common source of errors. Connection leaks can quickly bring applications down under load.</li>
<li>The relatively uninformative <tt>SQLException</tt>. JDBC does not offer an exception hierarchy, but throws SQLException in response to all errors. Finding out what actually went wrong &#8211; for example, was the problem a deadlock or invalid SQL? &#8211; involves examining the SQLState value and error code. The meaning of these values varies between databases.</li>
</ul>
<p>Spring addresses these problems in two ways:</p>
<ul>
<li>By providing APIs that move tedious and error-prone exception handling out of application code into the framework. The framework takes care of all exception handling; application code can concentrate on issuing the appropriate SQL and extracting results.</li>
<li>By providing a meaningful exception hierarchy for your application code to  work with in place of <tt>SQLException</tt>. When Spring first obtains a  connection from a <tt>DataSource</tt> it examines the metadata to determine the  database product. It uses this knowledge to map <tt>SQLExceptions</tt> to the  correct exception in its own hierarchy descended from  <tt>org.springframework.dao.DataAccessException</tt>. Thus your code can work with meaningful exceptions, and need not worry about proprietary SQLState or error codes. Spring’s data access exceptions are not JDBC-specific, so your DAOs are not necessarily tied to JDBC because of the exceptions they may throw.</li>
</ul>
<p>The following UML class diagram illustrates a part of this data access exception hierarchy, indicating its sophistication. Note that none of the exceptions shown here is JDBC-specific. There are JDBC-specific subclasses of some of these exceptions, but calling code is generally abstracted wholly away from dependence on JDBC: an essential if you wish to use truly API-agnostic DAO interfaces to hide your persistence strategy.</p>
<p>Spring provides two levels of JDBC abstraction API. The first, in the  <tt>org.springframework.jdbc.core</tt> package, uses callbacks to move control &#8211; and hence error handling and connection acquisition and release &#8211; from application code inside the framework. This is a different type of Inversion of Control, but equally valuable to that used for configuration management.</p>
<p>Spring uses a similar callback approach to address several other APIs that involve special steps to acquire and cleanup resources, such as JDO (acquiring and relinquishing a PersistenceManager), transaction management (using JTA) and JNDI. Spring classes that perform such callbacks are called <em>templates</em>.</p>
<p>For example, the Spring JdbcTemplate object can be used to perform a SQL  query and save the results in a list as follows:</p>
<pre>JdbcTemplate template = new JdbcTemplate(dataSource);List names = template.query("SELECT USER.NAME FROM USER", new RowMapper() {  public Object mapRow(ResultSet rs, int rowNum) throws SQLException;   return rs.getString(1);  } });</pre>
<p>The <tt>mapRow</tt> callback method will be invoked for each row of the  ResultSet.</p>
<p>Note that application code within the callback is free to throw  <tt>SQLException</tt>: Spring will catch any exceptions and rethrow them in its own hierarchy. The application developer can choose which exceptions, if any, to catch and handle.</p>
<p>The JdbcTemplate provides many methods to support different scenarios including prepared statements and batch updates. Simple tasks like running SQL functions can be accomplished without a callback, as follows. The example also illustrates the use of bind variables:</p>
<pre>int youngUserCount = template.queryForInt("SELECT COUNT(0) FROM USER WHERE USER.AGE &lt; ?", new Object[] { new Integer(25) });</pre>
<p>The Spring JDBC abstraction has a very low performance overhead beyond standard JDBC, even when working with huge result sets. (In one project in 2004, we profiled the performance of a financial application performing up to 1.2 million inserts per transaction. The overhead of Spring JDBC was minimal, and the use of Spring facilitated the tuning of batch sizes and other parameters.)</p>
<p>The higher level JDBC abstraction is in the  <tt>org.springframework.jdbc.object</tt> package. This is built on the core JDBC callback functionality, but provides an API in which an RDBMS operation &#8211; whether query, update or stored procedure &#8211; is modelled as a Java object. This API was partly inspired by the JDO query API, which I found intuitive and highly usable.</p>
<p>A query object to return User objects might look like this:</p>
<pre>class UserQuery extends MappingSqlQuery {

 public UserQuery(DataSource datasource) {  super(datasource, "SELECT * FROM PUB_USER_ADDRESS WHERE USER_ID = ?");  declareParameter(new SqlParameter(Types.NUMERIC));  compile(); }

 // Map a result set row to a Java object protected Object mapRow(ResultSet rs, int rownum) throws SQLException {  User user = new User();  user.setId(rs.getLong("USER_ID"));  user.setForename(rs.getString("FORENAME"));  return user; }

 public User findUser(long id) {  // Use superclass convenience method to provide strong typing  return (User) findObject(id); }}</pre>
<p>This class can be used as follows:</p>
<pre>User user = userQuery.findUser(25);</pre>
<p>Such objects are often inner classes inside DAOs. They are threadsafe, unless  the subclass does something unusual.</p>
<p>Another important class in the <tt>org.springframework.jdbc.object</tt> package is the <tt>StoredProcedure</tt> class. Spring enables a stored procedure to be proxied by a Java class with a single business method. If you like, you can define an interface that the stored procedure implements, meaning that you can free your application code from depending on the use of a stored procedure at all.</p>
<p>The Spring data access exception hierarchy is based on unchecked (runtime) exceptions. Having worked with Spring on several projects I’m more and more convinced that this was the right decision.</p>
<p>Data access exceptions not usually recoverable. For example, if we can’t connect to the database, a particular business object is unlikely to be able to work around the problem. One potential exception is optimistic locking violations, but not all applications use optimistic locking. It’s usually bad to be forced to write code to catch fatal exceptions that can’t be sensibly handled. Letting them propagate to top-level handlers like the servlet or EJB container is usually more appropriate. All Spring data access exceptions are subclasses of <tt>DataAccessException</tt>, so if we do choose to catch all  Spring data access exceptions, we can easily do so.</p>
<p>Note that if we <em>do</em> want to recover from an unchecked data access exception, we can still do so. We can write code to handle only the recoverable condition. For example, if we consider that only an optimistic locking violation is recoverable, we can write code in a Spring DAO as follows:</p>
<pre>try { // do work}catch (OptimisticLockingFailureException ex) { // I'm interested in this}</pre>
<p>If Spring data access exceptions were checked, we’d need to write the  following code. Note that we could <em>choose</em> to write this anyway:</p>
<pre>try { // do work}catch (OptimisticLockingFailureException ex) { // I'm interested in this}catch (DataAccessException ex) { // Fatal; just rethrow it}</pre>
<p>One potential objection to the first example &#8211; that the compiler can’t enforce handling the potentially recoverable exception &#8211; applies also to the second. Because we’re forced to catch the base exception (<tt>DataAccessException</tt>), the compiler won’t enforce a check for a  subclass (<tt>OptimisticLockingFailureException</tt>). So the compiler would force us to write code to handle an unrecoverable problem, but provide no help in forcing us to deal with the recoverable problem.</p>
<p>Spring’s use of unchecked data access exceptions is consistent with that of  many &#8211; probably <em>most</em> &#8211; successful persistence frameworks. (Indeed, it was partly inspired by JDO.) JDBC is one of the few data access APIs to use checked exceptions. TopLink and JDO, for example, use unchecked exceptions exclusively. Hibernate switched from checked to unchecked exceptions in version 3.</p>
<p>Spring JDBC can help you in several ways:</p>
<ul>
<li>You’ll never need to write a <tt>finally</tt> block again to use JDBC</li>
<li>Connection leaks will be a thing of the past</li>
<li>You’ll need to write less code overall, and that code will be clearly  focused on the necessary SQL</li>
<li>You’ll never need to dig through your RDBMS documentation to work out what obscure error code it returns for a bad column name. Your application won’t be dependent on RDBMS-specific error handling code.</li>
<li>Whatever persistence technology use, you’ll find it easy to implement the DAO pattern without business logic depending on any particular data access API.</li>
<li>You’ll benefit from improved portability (compared to raw JDBC) in advanced areas such as BLOB handling and invoking stored procedures that return result sets.</li>
</ul>
<p>In practice we find that all this amounts to substantial productivity gains and fewer bugs. I used to loathe writing JDBC code; now I find that I can focus on the SQL I want to execute, rather than the incidentals of JDBC resource management.</p>
<p>Spring’s JDBC abstraction can be used standalone if desired &#8211; you are not  forced to use the other parts of Spring.</p>
<p><strong>O/R mapping integration</strong></p>
<p>Of course often you want to use O/R mapping, rather than use relational data access. Your overall application framework must support this also. Thus Spring integrates out of the box with Hibernate (versions 2 and 3), JDO (versions 1 and 2), TopLink and other ORM products. Its data access architecture allows it to integrate with <em>any</em> underlying data access technology. Spring and  Hibernate are a particularly popular combination.</p>
<p>Why would you use an ORM product plus Spring, instead of the ORM product directly? Spring adds significant value in the following areas:</p>
<ul>
<li><strong>Session management</strong>. Spring offers efficient, easy, and safe handling of units of work such as Hibernate or TopLink Sessions. Related code using the ORM tool alone generally needs to use the same “Session” object for efficiency and proper transaction handling. Spring can transparently create and bind a session to the current thread, using either a declarative, AOP method interceptor approach, or by using an explicit, “template” wrapper class at the Java code level. Thus Spring solves many of the usage issues that affect many users of ORM technology.</li>
<li><strong>Resource management</strong>. Spring application contexts can handle the location and configuration of Hibernate SessionFactories, JDBC datasources, and other related resources. This makes these values easy to manage and change.</li>
<li><strong>Integrated transaction management</strong>. Spring allows you to wrap your ORM code with either a declarative, AOP method interceptor, or an explicit ‘template’ wrapper class at the Java code level. In either case, transaction semantics are handled for you, and proper transaction handling (rollback, etc.) in case of exceptions is taken care of. As we discuss later, you also get the benefit of being able to use and swap various transaction managers, without your ORM-related code being affected. As an added benefit, JDBC-related code can fully integrate transactionally with ORM code, in the case of most supported ORM tools. This is useful for handling functionality not amenable to ORM.</li>
<li><strong>Exception wrapping, as described above</strong>. Spring can wrap exceptions from the ORM layer, converting them from proprietary (possibly checked) exceptions, to a set of abstracted runtime exceptions. This allows you to handle most persistence exceptions, which are non-recoverable, only in the appropriate layers, without annoying boilerplate catches/throws, and exception declarations. You can still trap and handle exceptions anywhere you need to. Remember that JDBC exceptions (including DB specific dialects) are also converted to the same hierarchy, meaning that you can perform some operations with JDBC within a consistent programming model.</li>
<li><strong>To avoid vendor lock-in</strong>. ORM solutions have different performance other characterics, and there is no perfect one size fits all solution. Alternatively, you may find that certain functionality is just not suited to an implemention using your ORM tool. Thus it makes sense to decouple your architecture from the tool-specific implementations of your data access object interfaces. If you may ever need to switch to another implementation for reasons of functionality, performance, or any other concerns, using Spring now can make the eventual switch much easier. Spring’s abstraction of your ORM tool’s Transactions and Exceptions, along with its IoC approach which allow you to easily swap in mapper/DAO objects implementing data-access functionality, make it easy to isolate all ORM-specific code in one area of your application, without sacrificing any of the power of your ORM tool. The PetClinic sample application shipped with Spring demonstrates the portability benefits that Spring offers, through providing variants that use JDBC, Hibernate, TopLink and Apache OJB to implement the persistence layer.</li>
<li><strong>Ease of testing</strong>. Spring’s inversion of control approach makes it easy to swap the implementations and locations of resources such as Hibernate session factories, datasources, transaction managers, and mapper object implementations (if needed). This makes it much easier to isolate and test each piece of persistence-related code in isolation.</li>
</ul>
<p>Above all, Spring facilitates a mix-and-match approach to data access.  Despite the claims of some ORM vendors, ORM is <em>not</em> the solution to all problems, although it is a valuable productivity win in many cases. Spring enables a consistent architecture, and transaction strategy, even if you mix and match persistence approaches, even without using JTA.</p>
<p>In cases where ORM is not ideally suited, Spring’s simplified JDBC is not the only option: the “mapped statement” approach provided by <a href="http://www.ibatis.com/common/sqlmaps.html">iBATIS SQL Maps</a> is worth a look. It provides a high level of control over SQL, while still automating the creation of mapped objects from query results. Spring integrates with SQL Maps out of the box. Spring’s PetStore sample application illustrates iBATIS integration. <strong>Transaction management</strong></p>
<p>Abstracting a data access API is not enough; we also need to consider transaction management. JTA is the obvious solution, but it’s a cumbersome API to use directly, and as a result many J2EE developers used to feel that EJB CMT is the only rational option for transaction management. Spring has changed that.</p>
<p>Spring provides its own abstraction for transaction management. Spring uses  this to deliver:</p>
<ul>
<li>Programmatic transaction management via a callback template analogous to the JdbcTemplate, which is much easier to use than straight JTA</li>
<li>Declarative transaction management analogous to EJB CMT, but without the need for an EJB container. Actually, as we’ll see, Spring’s declarative transaction management capability is a semantically compatible superset of EJB CMT, with some unique and important benefits.</li>
</ul>
<p>Spring’s transaction abstraction is unique in that it’s not tied to JTA or any other transaction management technology. Spring uses the concept of a <strong>transaction strategy</strong> that decouples application code from the underlying  transaction infrastructure (such as JDBC).</p>
<p>Why should you care about this? Isn’t JTA the best answer for all transaction management? If you’re writing an application that uses only a single database, you don’t need the complexity of JTA. You’re not interested in XA transactions or two phase commit. You may not even need a high-end application server that provides these things. But, on the other hand, you don’t want to have to rewrite your code should you ever have to work with multiple data sources.</p>
<p>Imagine you decide to avoid the overhead of JTA by using JDBC or Hibernate transactions directly. If you ever need to work with multiple data sources, you’ll have to rip out all that transaction management code and replace it with JTA transactions. This isn’t very attractive and led most writers on J2EE, including myself, to recommend using global JTA transactions exclusively, effectively ruling out using a simple web container such as Tomcat for transactional applications. Using the Spring transaction abstraction, however, you only have to reconfigure Spring to use a JTA, rather than JDBC or Hibernate, transaction strategy and you’re done. This is a configuration change, not a code change. Thus, <strong>Spring enables you to write applications that can scale down as  well as up</strong>.</p>
<p><strong>AOP</strong></p>
<p>Since 2003 there has been much interest in applying AOP solutions to those enterprise concerns, such as transaction management, which have traditionally been addressed by EJB.</p>
<p>The first goal of Spring’s AOP support is to provide J2EE services to POJOs. Spring AOP is portable between application servers, so there’s no risk of vendor lock in. It works in either web or EJB container, and has been used successfully in WebLogic, Tomcat, JBoss, Resin, Jetty, Orion and many other application servers and web containers.</p>
<p>Spring AOP supports method interception. Key AOP concepts supported include:</p>
<ul>
<li><strong>Interception</strong>: Custom behaviour can be inserted before or after method invocations against any interface or class. This is similar to “around advice” in AspectJ terminology.</li>
<li><strong>Introduction</strong>: Specifying that an advice should cause an object to  implement additional interfaces. This can amount to mixin inheritance.</li>
<li>Static and dynamic <strong>pointcuts</strong>: Specifying the points in program execution at which interception should take place. Static pointcuts concern method signatures; dynamic pointcuts may also consider method arguments at the point where they are evaluated. Pointcuts are defined separately from interceptors, enabling a standard interceptor to be applied in different applications and code contexts.</li>
</ul>
<p>Spring supports both stateful (one instance per advised object) and stateless  interceptors (one instance for all advice).</p>
<p>Spring does <em>not</em> support field interception. This is a deliberate design decision. I have always felt that field interception violates encapsulation. I prefer to think of AOP as <em>complementing</em>, rather than conflicting with, OOP. In five or ten years time we will probably have travelled a lot farther on the AOP learning curve and feel comfortable giving AOP a seat at the top table of application design. (At that point language-based solutions such as AspectJ may be far more attractive than they are today.)</p>
<p>Spring implements AOP using dynamic proxies (where an interface exists) or CGLIB byte code generation at runtime (which enables proxying of classes). Both these approaches work in any application server, or in a standalone environment.</p>
<p>Spring was the first AOP framework to implement the AOP Alliance interfaces  (<a href="http://www.sourceforge.net/projects/aopalliance" target="_blank">www.sourceforge.net/projects/aopalliance</a>). These represent an  attempt to define interfaces allowing interoperability of interceptors between  AOP frameworks.</p>
<p>Spring integrates with AspectJ, providing the ability to seamlessly include AspectJ aspects into Spring applications . Since Spring 1.1 it has been possible to dependency inject AspectJ aspects using the Spring IoC container, just like any Java class. Thus AspectJ aspects can depend on any Spring-managed objects. The integration with the forthcoming AspectJ 5 release is still more exciting, with AspectJ set to provide the ability to dependency inject any POJO using Spring, based on an annotation-driven pointcut.</p>
<p>Because Spring advises objects at instance, rather than class loader, level, it is possible to use multiple instances of the same class with different advice, or use unadvised instances along with advised instances.</p>
<p>Perhaps the commonest use of Spring AOP is for declarative transaction management. This builds on the transaction abstraction described above, and can deliver declarative transaction management on any POJO. Depending on the transaction strategy, the underlying mechanism can be JTA, JDBC, Hibernate or any other API offering transaction management.</p>
<p>The following are the key differences from EJB CMT:</p>
<ul>
<li>Transaction management can be applied to any POJO. We recommend that business objects implement interfaces, but this is a matter of good programming practice, and is not enforced by the framework.</li>
<li>Programmatic rollback can be achieved within a transactional POJO through using the Spring transaction API. We provide static methods for this, using ThreadLocal variables, so you don’t need to propagate a context object such as an EJBContext to ensure rollback.</li>
<li>You can define <strong>rollback rules</strong> declaratively. Whereas EJB will not automatically roll back a transaction on an uncaught application exception (only on unchecked exceptions, other types of Throwable and “system” exceptions), application developers often want a transaction to roll back on any exception. Spring transaction management allows you to specify declaratively which exceptions and subclasses should cause automatic rollback. Default behaviour is as with EJB, but you can specify automatic rollback on checked, as well as unchecked exceptions. This has the important benefit of minimizing the need for programmatic rollback, which creates a dependence on the Spring transaction API (as EJB programmatic rollback does on the EJBContext).</li>
<li>Because the underlying Spring transaction abstraction supports savepoints if they are supported by the underlying transaction infrastructure, Spring’s declarative transaction management can support <strong>nested</strong> transactions, in addition to the propagation modes specified by EJB CMT (which Spring supports with identical semantics to EJB). Thus, for example, if you have doing JDBC operations on Oracle, you can use declarative nested transactions using Spring.</li>
<li>Transaction management is not tied to JTA. As explained above, Spring transaction management can work with different transaction strategies.</li>
</ul>
<p>It’s also possible to use Spring AOP to implement application-specific aspects. Whether or not you choose to do this depends on your level of comfort with AOP concepts, rather than Spring’s capabilities, but it can be very useful. Successful examples we’ve seen include:</p>
<ul>
<li>Custom security interception, where the complexity of security checks required is beyond the capability of the standard J2EE security infrastructure. (Of course, before rolling your own security infrastructure, you should check the capabilities of <a href="http://acegisecurity.sourceforge.net/">Acegi  Security for Spring</a>, a powerful, flexible security framework that integrates with Spring using AOP, and reflects Spring’s architectural approach.</li>
<li>Debugging and profiling aspects for use during development</li>
<li>Aspects that apply consistent exception handling policies in a single place</li>
<li>Interceptors that send emails to alert administrators or users of unusual  scenarios</li>
</ul>
<p>Application-specific aspects can be a powerful way of removing the need for  boilerplate code across many methods.</p>
<p>Spring AOP integrates transparently with the Spring BeanFactory concept. Code obtaining an object from a Spring BeanFactory doesn’t need to know whether or not it is advised. As with any object, the contract will be defined by the interfaces the object implements.</p>
<p>The following XML stanza illustrates how to define an AOP proxy:</p>
<pre>&lt;bean id="myTest" class="org.springframework.aop.framework.ProxyFactoryBean"&gt;

  org.springframework.beans.ITestBean

   txInterceptor   target</pre>
<p>Note that the class of the bean definition is always the AOP framework’s ProxyFactoryBean, although the type of the bean as used in references or returned by the BeanFactory getBean() method will depend on the proxy interfaces. (Multiple proxy methods are supported.) The “interceptorNames” property of the ProxyFactoryBean takes a list of String. (Bean names must be used rather than bean references, as new instances of stateful interceptors may need to be created if the proxy is a “prototype”, rather than a singleton bean definition.) The names in this list can be interceptors or pointcuts (interceptors and information about when they should apply). The “target” value in the list above automatically creates an “invoker interceptor” wrapping the target object. It is the name of a bean in the factory that implements the proxy interface. The myTest bean in this example can be used like any other bean in the bean factory. For example, other objects can reference it via elements and these references will be set by Spring IoC.</p>
<p>There are a number of ways to set up proxying more concisely, if you don’t need the full power of the AOP framework, such as using Java 5.0 annotations to drive transactional proxying without XML metadata, or the ability to use a single piece of XML to apply a consistent proxying strategy to many beans defined in a Spring factory.</p>
<p>It’s also possible to construct AOP proxies programmatically without using a  BeanFactory, although this is more rarely used:</p>
<pre>TestBean target = new TestBean();DebugInterceptor di = new DebugInterceptor();MyInterceptor mi = new MyInterceptor();ProxyFactory factory = new ProxyFactory(target);factory.addInterceptor(0, di);factory.addInterceptor(1, mi);// An "invoker interceptor" is automatically added to wrap the targetITestBean tb = (ITestBean) factory.getProxy();</pre>
<p>We believe that it’s generally best to externalize the wiring of applications  from Java code, and AOP is no exception.</p>
<p>The use of AOP as an alternative to EJB (version 2 or above) for delivering enterprise services is growing in importance. Spring has successfully demonstrated the value proposition.</p>
<p><strong>MVC web framework</strong></p>
<p>Spring includes a powerful and highly configurable MVC web framework.</p>
<p>Spring’s MVC model is most similar to that of Struts, although it is not  derived from Struts. A Spring <tt>Controller</tt> is similar to a Struts  <tt>Action</tt> in that it is a multithreaded service object, with a single instance executing on behalf of all clients. However, we believe that Spring MVC has some significant advantages over Struts. For example:</p>
<ul>
<li>Spring provides a very clean division between controllers, JavaBean models,  and views.</li>
<li>Spring’s MVC is very flexible. Unlike Struts, which forces your Action and Form objects into concrete inheritance (thus taking away your single shot at concrete inheritance in Java), Spring MVC is entirely based on interfaces. Furthermore, just about every part of the Spring MVC framework is configurable via plugging in your own interface. Of course we also provide convenience classes as an implementation option.</li>
<li>Spring, like WebWork, provides <strong>interceptors</strong> as well as controllers,  making it easy to factor out behavior common to the handling of many requests.</li>
<li>Spring MVC is truly view-agnostic. You don’t get pushed to use JSP if you don’t want to; you can use Velocity, XLST or other view technologies. If you want to use a custom view mechanism &#8211; for example, your own templating language &#8211; you can easily implement the Spring View interface to integrate it.</li>
<li>Spring Controllers are configured via IoC like any other objects. This makes them easy to test, and beautifully integrated with other objects managed by Spring.</li>
<li>Spring MVC web tiers are typically easier to test than Struts web tiers, due to the avoidance of forced concrete inheritance and explicit dependence of controllers on the dispatcher servlet.</li>
<li>The web tier becomes a thin layer on top of a business object layer. This encourages good practice. Struts and other dedicated web frameworks leave you on your own in implementing your business objects; Spring provides an integrated framework for all tiers of your application.</li>
</ul>
<p>As in Struts 1.1 and above, you can have as many dispatcher servlets as you  need in a Spring MVC application.</p>
<p>The following example shows how a simple Spring Controller can access business objects defined in the same application context. This controller performs a Google search in its handleRequest() method:</p>
<pre>public class GoogleSearchController  implements Controller {

 private IGoogleSearchPort google;

 private String googleKey;

 public void setGoogle(IGoogleSearchPort google) {  this.google = google; }

 public void setGoogleKey(String googleKey) {  this.googleKey = googleKey; }

 public ModelAndView handleRequest(    HttpServletRequest request, HttpServletResponse response)  throws ServletException, IOException {  String query = request.getParameter("query");  GoogleSearchResult result =   // Google property definitions omitted...

   // Use google business object   google.doGoogleSearch(this.googleKey, query,    start, maxResults, filter, restrict,    safeSearch, lr, ie, oe);

  return new ModelAndView("googleResults", "result", result); }}</pre>
<p>In the prototype this code is taken from, IGoogleSearchPort is a GLUE web services proxy, returned by a Spring FactoryBean. However, Spring IoC isolates this controller from the underlying web services library. The interface could equally be implemented by a plain Java object, test stub, mock object, or EJB proxy, as discussed below. This controller contains no resource lookup; nothing except code necessary to support its web interaction.</p>
<p>Spring also provides support for data binding, forms, wizards and more complex workflow. A forthcoming article in this series will discuss Spring MVC in detail.</p>
<p>If your requirements are really complex, you should consider <a href="http://opensource.atlassian.com/confluence/spring/display/WEBFLOW/Home">Spring  Web Flow</a>, a powerful framework that provides a higher level of abstraction for web flows than any traditional web MVC framework, and was discussed in a recent TSS article by its architect, Keith Donald.</p>
<p>A good introduction to the Spring MVC framework is Thomas Risberg’s Spring  MVC tutorial (<a href="http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step.html" target="_blank">http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step.html</a>).  See also “Web MVC with the Spring Framework” (<a href="http://www.springframework.org/docs/web_mvc.html" target="_blank">http://www.springframework.org/docs/web_mvc.html</a>).</p>
<p>If you’re happy with your favourite MVC framework, Spring’s layered infrastructure allows you to use the rest of Spring without our MVC layer. We have Spring users who use Spring for middle tier management and data access but use Struts, WebWork, Tapestry or JSF in the web tier.</p>
<p><strong>Implementing  EJBs</strong></p>
<p>If you choose to use EJB, Spring can provide important benefits in both EJB  implementation and client-side access to EJBs.</p>
<p>It’s now widely regarded as a best practice to refactor business logic into POJOs behind EJB facades. (Among other things, this makes it much easier to unit test business logic, as EJBs depend heavily on the container and are hard to test in isolation.) Spring provides convenient superclasses for session beans and message driven beans that make this very easy, by automatically loading a BeanFactory based on an XML document included in the EJB Jar file.</p>
<p>This means that a stateless session EJB might obtain and use a collaborator  like this:</p>
<pre>import org.springframework.ejb.support.AbstractStatelessSessionBean;

public class MyEJB extends AbstractStatelessSessionBean   implements MyBusinessInterface { private MyPOJO myPOJO;

 protected void onEjbCreate() {  this.myPOJO = getBeanFactory().getBean("myPOJO"); }

 public void myBusinessMethod() {  this.myPOJO.invokeMethod(); }}</pre>
<p>Assuming that MyPOJO is an interface, the implementing class &#8211; and any configuration it requires, such as primitive properties and further collaborators &#8211; is hidden in the XML bean factory definition.</p>
<p>We tell Spring where to load the XML document via an environment variable  definition named <tt>ejb/BeanFactoryPath</tt> in the standard ejb-jar.xml  deployment descriptor, as follows:</p>
<pre> myComponent com.test.ejb.myEjbBeanLocalHome com.mycom.MyComponentLocal com.mycom.MyComponentEJB Stateless Container

  ejb/BeanFactoryPath  java.lang.String  /myComponent-ejb-beans.xml</pre>
<p>The myComponent-ejb-beans.xml file will be loaded from the classpath: in this case, in the root of the EJB Jar file. Each EJB can specify its own XML document, so this mechanism can be used multiple times per EJB Jar file.</p>
<p>The Spring superclasses implement EJB lifecycle methods such as setSessionContext() and ejbCreate(), leaving the application developer to optionally implement the Spring onEjbCreate() method.</p>
<p>When EJB 3.0 is available in public draft, we will offer support for the use of the Spring IoC container to provide richer Dependency Injection semantics in that environment. We will also integrate the JSR-220 O/R mapping API with Spring as a supported data access API.</p>
<p><strong>Using EJBs</strong></p>
<p>Spring also makes it much easier to use, as well as implement EJBs. Many EJB  applications use the <strong>Service Locator</strong> and <strong>Business Delegate</strong> patterns. These are better than spraying JNDI lookups throughout client code, but their usual implementations have significant disadvantages. For example:</p>
<ul>
<li>Typically code using EJBs depends on Service Locator or Business Delegate  singletons, making it hard to test.</li>
<li>In the case of the Service Locator pattern used without a Business Delegate, application code still ends up having to invoke the create() method on an EJB home, and deal with the resulting exceptions. Thus it remains tied to the EJB API and the complexity of the EJB programming model.</li>
<li>Implementing the Business Delegate pattern typically results in significant code duplication, where we have to write numerous methods that simply call the same method on the EJB.</li>
</ul>
<p>For these and other reasons, traditional EJB access, as demonstrated in applications such as the Sun Adventure Builder and OTN J2EE Virtual Shopping Mall, can reduce productivity and result in significant complexity.</p>
<p>Spring steps beyond this by introducing <strong>codeless business delegates</strong>. With Spring you’ll never need to write another Service Locator, another JNDI lookup, or duplicate methods in a hand-coded Business Delegate unless you’re adding real value.</p>
<p>For example, imagine that we have a web controller that uses a local EJB.  We’ll follow best practice and use the <strong>EJB Business Methods Interface</strong> pattern, so that the EJB’s local interface extends a non EJB-specific business methods interface. (One of the main reasons to do this is to ensure that synchronization between method signatures in local interface and bean implementation class is automatic.) Let’s call this business methods interface MyComponent. Of course we’ll also need to implement the local home interface and provide a bean implementation class that implements SessionBean and the MyComponent business methods interface.</p>
<p>With Spring EJB access, the <em>only</em> Java coding we’ll need to do to hook up our web tier controller to the EJB implementation is to expose a setter method of type MyComponent on our controller. This will save the reference as an instance variable like this:</p>
<pre>private MyComponent myComponent;

public void setMyComponent(MyComponent myComponent) { this.myComponent = myComponent;}</pre>
<p>We can subsequently use this instance variable in any business method.</p>
<p>Spring does the rest of the work automatically, via XML bean definition entries like this. LocalStatelessSessionProxyFactoryBean is a generic factory bean that can be used for any EJB. The object it creates can be cast by Spring to the MyComponent type automatically.</p>
<pre>&lt;bean id="myComponent"class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean"&gt;

&lt;bean id="myController" class = "com.mycom.myController"&gt;</pre>
<p>There’s a lot of magic happening behind the scenes, courtesy of the Spring AOP framework, although you aren’t forced to work with AOP concepts to enjoy the results. The “myComponent” bean definition creates a proxy for the EJB, which implements the business method interface. The EJB local home is cached on startup, so there’s normally only a single JNDI lookup. (There is also support for retry on failure, so an EJB redeployment won’t cause the client to fail.) Each time the EJB is invoked, the proxy invokes the <tt>create()</tt> method on  the local EJB and invokes the corresponding business method on the EJB.</p>
<p>The myController bean definition sets the myController property of the  controller class to this proxy.</p>
<p>This EJB access mechanism delivers huge simplification of application code:</p>
<ul>
<li>The web tier code has no dependence on the use of EJB. If we want to replace this EJB reference with a POJO or a mock object or other test stub, we could simply change the myComponent bean definition without changing a line of Java code</li>
<li>We haven’t had to write a single line of JNDI lookup or other EJB plumbing  code as part of our application.</li>
</ul>
<p>We can also apply the same approach to remote EJBs, via the similar org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean factory bean. However, it’s trickier to conceal the RemoteExceptions on the business methods interface of a remote EJB. (Spring does let you do this, if you wish to provide a client-side service interface that matches the EJB remote interface but without the “throws RemoteException” clause in the method signatures.)</p>
<p><strong>Testing</strong></p>
<p>As you’ve probably gathered, I and the other Spring developers are firm believers in the importance of comprehensive unit testing. We believe that it’s essential that frameworks are thoroughly unit tested, and that a prime goal of framework design should be to make applications built on the framework easy to unit test.</p>
<p>Spring itself has an excellent unit test suite. We’ve found the benefits of test first development to be very real on this project. For example, it has made working as an internationally distributed team extremely efficient, and users comment that CVS snapshots tend to be stable and safe to use.</p>
<p>We believe that applications built on Spring are very easy to test, for the  following reasons:</p>
<ul>
<li>IoC facilitates unit testing</li>
<li>Applications don’t contain plumbing code directly using J2EE services such  as JNDI, which is typically hard to test</li>
<li>Spring bean factories or contexts can be set up outside a container</li>
</ul>
<p>The ability to set up a Spring bean factory outside a container offers interesting options for the development process. In several web application projects using Spring, work has started by defining the business interfaces and integration testing their implementation outside a web container. Only after business functionality is substantially complete is a thin layer added to provide a web interface.</p>
<p>Since Spring 1.1.1, Spring has provided powerful and unique support for a form of integration testing outside the deployed environment. This is not intended as a substitute for unit testing or testing against the deployed environment. However, it can significantly improve productivity.</p>
<p>The  <tt>org.springframework.test</tt> package provides valuable superclasses for integration tests using a Spring container, but not dependent on an application server or other deployed environment. Such tests can run in JUnit–even in an IDE–without any special deployment step. They will be slower to run than unit tests, but much faster to run than Cactus tests or remote tests relying on deployment to an application server. Typically it is possible to run hundreds of tests hitting a development database–usually <em>not</em> an embedded database, but the product used in production–within seconds, rather than minutes or hours. Such tests can quickly verify correct wiring of your Spring contexts, and data access using JDBC or ORM tool, such as correctness of SQL statements. For example, you can test your DAO implementation classes.</p>
<p>The enabling functionality in the <tt>org.springframework.test package</tt> includes:</p>
<ul>
<li>The ability to populate JUnit test cases via Dependency Injection. This makes it possible to reuse Spring XML configuration when testing, and eliminates the need for custom setup code for tests.</li>
<li>The ability to cache container configuration between test cases, which greatly increases performance where slow-to-initialize resources such as JDBC connection pools or Hibernate SessionFactories are concerned.</li>
<li>Infrastructure to create a transaction around each test method and roll it back at the conclusion of the test by default. This makes it possible for tests to perform any kind of data access without worrying about the effect on the environments of other tests. In my experience across several complex projects using this functionality, the productivity and speed gain of such a rollback-based approach is very significant.</li>
</ul>
<p><strong>Who’s using  Spring?</strong></p>
<p>There are many production applications using Spring. Users include investment and retail banking organizations, well-known dotcoms, global consultancies, academic institutions, government departments, defence contractors, several airlines, and scientific research organizations (including CERN).</p>
<p>Many users use all parts of Spring, but some use components in isolation. For example, a number of users begin by using our JDBC or other data access functionality.</p>
<p><strong>Roadmap</strong></p>
<p>Since the first version of this article, in October 2003, Spring has progressed through its 1.0 final release (March 2004) through version 1.l (September 2004) to 1.2 final (May 2005). We believe in a philosophy of “release early, release often,” so maintenance releases and minor enhancements are typically released every 4-6 weeks.</p>
<p>Since that time enhancements include:</p>
<ul>
<li>The introduction of a remoting framework supporting multiple protocols  including RMI and various web services protocols</li>
<li>Support for Method Injection and other IoC container enhancements such as the ability to manage objects obtained from calls to static or instance factory methods</li>
<li>Integration with more data access technologies, including TopLink and Hibernate 3 as well as Hibernate 2 in the recent 1.2 release</li>
<li>Support for declarative transaction management configured by Java 5.0 annotations (1.2), eliminating the need for XML metadata to identify transactional methods</li>
<li>Support for JMX management of Spring-managed objects (1.2).</li>
<li>Integration with Jasper Reports, the Quartz scheduler and AspectJ</li>
<li>Integration with JSF as a web layer technology</li>
</ul>
<p>We intend to continue with rapid innovation and enhancement. The next major release will be 1.3 (final release expected Q3, 2005). Planned enhancements include:</p>
<ul>
<li>XML configuration enhancements (planned for release 1.3), which will allow custom XML tags to extend the basic Spring configuration format by defining one or more objects in a single, validated tag. This not only has the potential to simplify typical configurations significantly and reduce configuration errors, but will be ideal for developers of third-party products that are based on Spring.</li>
<li>Integration of Spring Web Flow into the Spring core (planned for release  1.3)</li>
<li>Support for dynamic reconfiguration of running applications</li>
<li>Support for the writing of application objects in languages other than Java, such as Groovy, Jython or other scripting languages running on the Java platform. Such objects will benefit from the full services of the Spring IoC container and will allow dynamic reloading when the script changes, without affecting objects that were given references to them by the IoC container.</li>
</ul>
<p>As an agile project, Spring is primarily driven by user requirements. So we don’t develop features that no one has a use for, and we listen carefully to our user community.</p>
<p><a href="https://springmodules.dev.java.net/" target="_blank">Spring  Modules</a> is an associated project, led by Rob Harrop of Interface21, which extends the reach of the Spring platform to areas that are not necessarily integral to the Spring core, while still valuable to many users. This project also serves as an incubator, so some of this functionality will probably eventually migrate into the Spring core. Spring Modules presently includes areas such as integration with the Lucene search engine and OSWorkflow workflow engine, a declarative, AOP-based caching solution, and integration with the Commons Validator framework.</p>
<p>Interestingly, although the first version of this article was published six months before the release of Spring 1.0 final, almost all the code and configuration examples would still work unchanged in today’s 1.2 release. We are proud of our excellent record on backward compatibility. This demonstrates the ability of Dependency Injection and AOP to deliver a non-invasive API, and also indicates the seriousness with which we take our responsibility to the community to provide a stable framework to run vital applications.</p>
<h2>Summary</h2>
<p>Spring is a powerful framework that solves many common problems in J2EE. Many Spring features are also usable in a wide range of Java environments, beyond classic J2EE.</p>
<p>Spring provides a consistent way of managing business objects and encourages good practices such as programming to interfaces, rather than classes. The architectural basis of Spring is an Inversion of Control container based around the use of JavaBean properties. However, this is only part of the overall picture: Spring is unique in that it uses its IoC container as the basic building block in a comprehensive solution that addresses all architectural tiers.</p>
<p>Spring provides a unique data access abstraction, including a simple and productive JDBC framework that greatly improves productivity and reduces the likelihood of errors. Spring’s data access architecture also integrates with TopLink, Hibernate, JDO and other O/R mapping solutions.</p>
<p>Spring also provides a unique transaction management abstraction, which enables a consistent programming model over a variety of underlying transaction technologies, such as JTA or JDBC.</p>
<p>Spring provides an AOP framework written in standard Java, which provides declarative transaction management and other enterprise services to be applied to POJOs or &#8211; if you wish &#8211; the ability to implement your own custom aspects. This framework is powerful enough to enable many applications to dispense with the complexity of EJB, while enjoying key services traditionally associated with EJB.</p>
<p>Spring also provides a powerful and flexible MVC web framework that is  integrated into the overall IoC container.</p>
<p><strong>More information</strong></p>
<p>See the following resources for more information about Spring:</p>
<ul>
<li>Interface21 offers a Core Spring training course &#8211; <a href="http://www.springframework.com/training">http://www.springframework.com/training</a>.</li>
<li><a href="http://www.wrox.com/books/0764543857.shtml" target="_blank">Expert  One-on-One J2EE Design and Development</a> (Rod Johnson, Wrox, 2002). Although Spring has evolved and improved significantly since the book’s publication, it’s still an excellent place to go to understand Spring’s motivation.</li>
<li><a href="http://www.wrox.com/books/0764558315.shtml" target="_blank">J2EE  without EJB</a> (Rod Johnson with Juergen Hoeller, Wrox, 2004). Sequel to  <em>J2EE Design and Development</em> that discusses the rationale for Spring and  the lightweight container architecture it enables.</li>
<li>The<a href="http://static.springframework.org/spring/docs/1.2/reference/index.html" target="_blank"> Spring Reference Manual</a>. The printable form is over 240 pages as of Spring 1.2. Spring also ships with several sample applications that illustrate best practice and can be used as templates for your own applications.</li>
<li><a href="http://www.apress.com/book/bookDisplay.html?bID=405" target="_blank">Pro Spring</a>: In-depth Spring coverage by core developer Rob  Harrop.</li>
<li><a href="http://www.oreilly.com/catalog/springadn/index.html" target="_blank">Spring: A Developer’s Notebook </a>: Introduction to Spring by  Bruce Tate and Justin Gehtland.</li>
<li>Spring Framework home page: <a href="http://www.springframework.org/" target="_blank">http://www.springframework.org/</a>. This includes Javadoc and  several tutorials.</li>
<li><a href="http://forum.springframework.org/" target="_blank">Forums</a> and <a href="http://www.sourceforge.net/projects/springframework" target="_blank">downloads</a> on Sourceforge.</li>
<li>Spring-developer <a href="http://sourceforge.net/mail/?group_id=73357" target="_blank">mailing list</a>.</li>
</ul>
<p>We pride ourselves on excellent response rates and a helpful attitude to queries on the forms and mailing lists. We hope to welcome you into our community soon!</p>
<p><strong>About the Author</strong></p>
<p><strong>Rod Johnson</strong> has almost ten years experience as a Java developer and architect and has worked with J2EE since the platform emerged. He is the author of the best-selling <em>Expert One-on-One J2EE Design and Development</em> (Wrox,  2002), and <em>J2EE without EJB</em> (Wrox, 2004, with Juergen Hoeller) and has contributed to several other books on J2EE. Rod serves on two Java specification committees and is a regular conference speaker. He is CEO of <a href="http://www.interface21.com/" target="_blank">Interface21</a>, an international consultancy that leads Spring Framework development and offers expert services on the Spring Framework and J2EE in general.</p>
<p>(http://www.theserverside.com/tt/articles/content/SpringFramework/article.html)</p></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=82&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2008/09/23/introduction-to-the-spring-framework-by-rod-johnson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Payment Data from PayPal</title>
		<link>http://thegame28.wordpress.com/2008/08/18/getting-payment-data-from-paypal-2/</link>
		<comments>http://thegame28.wordpress.com/2008/08/18/getting-payment-data-from-paypal-2/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 22:16:49 +0000</pubDate>
		<dc:creator>thegame28</dc:creator>
				<category><![CDATA[eCommerce]]></category>

		<guid isPermaLink="false">http://thegame28.wordpress.com/?p=10</guid>
		<description><![CDATA[There are several ways of retrieving paypal payment data after the payment is completed. I&#8217;ve been thru a lot of confusion in development paypal process before, to use the correct technology for your choice. Sometimes the technology is mismatched with the settings you made and you get unexpected results. I hope this article will help [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=10&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="line-height:normal;"><span style="font-family:&quot;">There are several ways of retrieving paypal payment data after the payment is completed. I&#8217;ve been thru a lot of confusion in development paypal process before, to use the correct technology for your choice. Sometimes the technology is mismatched with the settings you made and you get unexpected results. I hope this article will help clear things up kids.</span></p>
<p class="MsoNormal"><span style="color:#ff6600;"><span style="font-family:&quot;color:#eb700b;">Option 1: Post to return page</span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-family:&quot;">How does it work?</span></p>
<ol type="1">
<li class="MsoNormal"><span style="font-family:&quot;">After finishing the payment on      PayPal, the customer clicks on a button.</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">PayPal posts payment data to your      URL in a HTML form.</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">You post a form (format is      described in the IPN section below) to PayPal. PayPal responds with a      single word VERIFIED or INVALID.</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">If you receive VERIFIED, you can      be confident that the form you received came from PayPal and wasn&#8217;t      tampered with. Do whatever you need to do with the form data.</span></li>
</ol>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-family:&quot;">Settings:</span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&quot;">Specify a return url in the return variable in your html form. The return url must be an absolute url.<br />
</span><span style="font-family:&quot;"><br />
<span style="color:#008000;"> &lt;input type=&#8221;hidden&#8221; name=&#8221;return&#8221;      value=&#8221;your_url_here&#8221;&gt;</span></span></li>
</ul>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&quot;">set the rm variable to 2. </span></li>
</ul>
<p><span style="color:#808080;"><span style="font-family:&quot;"> <span style="color:#008000;">&lt;input      type=&#8221;hidden&#8221; name=&#8221;rm&#8221; value=&#8221;2&#8243;&gt;</span></span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&quot;">Auto Return = Disabled in account      profile (if Auto Return = Enabled, you won&#8217;t get any data)</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">PDT = Disabled in account profile</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">IPN = Disabled in account profile</span></li>
</ul>
<p class="MsoNormal" style="line-height:normal;"><span style="font-family:&quot;">Sample script:<span style="color:red;"> <a href="http://paypaltech.com/SG2/" target="_blank"><span style="color:blue;">http://paypaltech.com/SG2/</span></a></span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-family:&quot;color:red;">I don&#8217;t recommend this</span><span style="font-family:&quot;"> as a stand-alone solution because you can&#8217;t guarantee that the customer will click on that button after the payment. Many customers simply close their browser or navigate away because they are done with their payment.</span></p>
<p class="MsoNormal"><span style="font-family:&quot;color:#eb700b;"> </span></p>
<p class="MsoNormal"><span style="color:#ff6600;"><span style="font-family:&quot;color:#eb700b;">Option 2: Payment Data Transfer (PDT)</span></span></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent:-.25in;line-height:normal;margin:0 0 .0001pt .25in;"><!--[if !supportLists]--><span><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><span style="font-family:&quot;">is a secure method to retrieve the details about a PayPal transaction so that you can display them to your customer.</span><!--[endif]--></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height:normal;margin:0 0 .0001pt .25in;"><span style="font-family:&quot;"> </span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent:-.25in;line-height:normal;margin:0 0 .0001pt .25in;"><!--[if !supportLists]--><span><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><span style="font-family:&quot;"><span> </span>It is used in combination with Website Payments Standard, so that after a customer returns to your website after paying on the PayPal site, they can instantly view a confirmation message with the details of the transaction. </span><!--[endif]--></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height:normal;margin:0 0 .0001pt .25in;"><span style="font-family:&quot;"> </span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent:-.25in;line-height:normal;margin:0 0 .0001pt .25in;"><!--[if !supportLists]--><span><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><span style="font-family:&quot;">PDT is not meant to be used with credit card or Express Checkout transactions. This page describes how PDT works and how to configure your account to use PDT.</span><!--[endif]--></p>
<p class="MsoListParagraphCxSpLast"><span style="font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-family:&quot;">How does it work?</span></p>
<ol type="1">
<li class="MsoNormal"><span style="font-family:&quot;">After finishing the payment on      PayPal, the customer is automatically redirected to your page.</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">PayPal sends a GET request      to your page. If your URL contains a query string, PayPal will append      parameters to the URL. For example:</span><span style="font-family:&quot;"> http://yoursite/yourpage?yourparam=yourvalue&amp;tx=3KK900354R868601V&amp;&#8230;..</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">You post a form to PayPal with cmd=_notify-synch,      the tx token you received in the query string and the identity      token in your account profile when you turned on PDT. </span></li>
</ol>
<p class="MsoNormal" style="text-indent:-.25in;line-height:normal;margin:0 0 .0001pt .5in;"><!--[if !supportLists]--><span style="color:#008000;"><span style="font-family:&quot;">&lt;form action=&#8221;https://www.sandbox.paypal.com/cgi-bin/webscr&#8221; method=&#8221;POST&#8221;&gt;</span></span></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:normal;margin:0 0 .0001pt .5in;"><!--[if !supportLists]--><span style="color:#008000;"><span style="font-family:&quot;"><span><span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><span style="font-family:&quot;"><span> </span>&lt;input type=&#8221;hidden&#8221; name=&#8221;cmd&#8221; value=&#8221;_notify-synch&#8221;&gt;</span></span><!--[endif]--></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:normal;margin:0 0 .0001pt .5in;"><!--[if !supportLists]--><span style="color:#008000;"><span style="font-family:&quot;"><span> </span>&lt;input type=&#8221;hidden&#8221; name=&#8221;tx&#8221; value=&#8221;3KK900354R868601V&#8221;&gt;</span></span><!--[endif]--></p>
<p class="MsoNormal" style="text-indent:-.25in;line-height:normal;margin:0 0 .0001pt .5in;"><!--[if !supportLists]--><span style="color:#008000;"><span style="font-family:&quot;"><span> </span>&lt;input type=&#8221;hidden&#8221; name=&#8221;at&#8221;</span></span><!--[endif]--></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 .0001pt .5in;"><!--[if !supportLists]--><span style="color:#008000;"><span style="font-family:&quot;"><span> </span>value=&#8221;lpeb7DhJWXz5BU43tiarWlo42x5g-Nvv0oJCORuEVsmY9JiRuVUDW2jAHUI&#8221;&gt;</span></span><!--[endif]--></p>
<p class="MsoNormal" style="line-height:normal;margin:0 0 .0001pt .5in;"><span style="color:#008000;"><span style="font-family:&quot;">&lt;/form&gt;</span></span></p>
<ol type="1">
<li class="MsoNormal"><span style="font-family:&quot;">PayPal responds with a block of      text with SUCCESS or FAIL on the top. If it&#8217;s SUCCESS, name value      pairs on separate lines follow the SUCCESS line.</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">If the response has SUCCESS on the      top, you read the rest of the lines from the response.<br />
Settings:</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">specify an url for PDT in your      account profile or in the return variable in your html form. The      url must be an absolute url.Code: </span></li>
</ol>
<p class="MsoNormal" style="line-height:normal;margin:0 0 .0001pt .5in;"><span style="color:#008000;"><span style="font-family:&quot;">&lt;input type=&#8221;hidden&#8221; name=&#8221;return&#8221; value=&#8221;your_pdt_url_here&#8221;&gt;</span></span></p>
<ol type="1">
<li class="MsoNormal"><span style="font-family:&quot;">Auto Return = Enabled in account      profile</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">PDT = Enabled in account profile</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">IPN = Disabled in account profile</span></li>
</ol>
<p class="MsoNormal" style="line-height:normal;"><span style="font-family:&quot;">Sample script: <a href="http://paypaltech.com/PDTGen/" target="_blank"><span style="color:blue;">http://paypaltech.com/PDTGen/</span></a></span></p>
<p class="MsoNormal" style="line-height:normal;"><span style="font-family:&quot;">More info: <a href="https://www.paypal.com/IntegrationCenter/ic_pdt.html" target="_blank"><span style="color:blue;">https://www.paypal.com/IntegrationCenter/ic_pdt.html</span></a></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-family:&quot;">This approach is better</span><span style="font-family:&quot;"> than Option 1 but there still may be <span style="color:red;">breakage</span> from the auto redirect after the payment is done. For example the customer could close the browser or navigate away before redirect is completed. If the redirect breaks, you won&#8217;t know about the payment. It is possible for the customer to refresh the page. So if you are inserting records to a database, you must check for duplicates. Don&#8217;t count on the PDT url being called only once. Use PDT if you must know immediately whether the payment went through, while the customer is still on your site, for example for providing immediate access to digital downloads. If you are shipping physical goods, you can wait for the IPN (see Option 3 below). Because PDT is a front end technology, you will only get data for the initial payment. You won&#8217;t get data on eCheck clearance and other events. If you want to get notified programmatically about those events, you will still have to do IPN.</span></p>
<p class="MsoNormal"><span style="font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="color:#ff6600;"><span style="font-family:&quot;color:#eb700b;">Option 3: Instant Payment Notification (IPN)</span></span></p>
<p class="MsoListParagraphCxSpFirst" style="margin-left:.25in;text-indent:-.25in;"><!--[if !supportLists]--><span><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><span style="font-family:&quot;">Allows you to automate certain aspects of your business by posting transaction details to your server whenever you receive a PayPal payment or whenever a status change occurs on a transaction. </span><!--[endif]--></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left:.25in;"><span style="font-family:&quot;"> </span></p>
<p class="MsoListParagraphCxSpLast" style="margin-left:.25in;text-indent:-.25in;"><!--[if !supportLists]--><span><span>-<span style="font-family:&quot;font-style:normal;font-variant:normal;font-weight:normal;font-size:7pt;line-height:normal;"> </span></span></span><span style="font-family:&quot;">When used with a credit card or Express Checkout transactions, IPN is not useful to get the status of a payment, but only to get asynchronous notification such as an eCheck clearing or a chargeback.</span><!--[endif]--></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-family:&quot;">How does it work?</span></p>
<ol type="1">
<li class="MsoNormal"><span style="font-family:&quot;">After finishing the payment on      PayPal, the customer is auto-redirected to your page      (&#8220;return&#8221; variable)</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">Customer returns to your page.      PayPal does NOT send any payment data there.</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">Separately</span><span style="font-family:&quot;"> in the background, you receive a      form POST from PayPal at a different URL (notify_url variable).</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">You post back a form with cmd=_notify-validate and all fields you received from PayPal. PayPal responds with a single      word VERIFIED or INVALID</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">If you receive VERIFIED, you can      be confident that the form you received came from PayPal and wasn&#8217;t      tampered with. Do whatever you need to do with the form fields.</span></li>
</ol>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-family:&quot;">Settings:</span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&quot;">Specify an auto return url in your      profile or in the return variable in your html form. The url must      be an absolute url. This is just a generic page with no PayPal processing      logic. Display something like &#8220;Thank you and your order will be      processed shortly.&#8221; Code: </span></li>
</ul>
<p class="MsoNormal" style="line-height:normal;margin:0 0 .0001pt .5in;"><span style="color:#008000;"><span style="font-family:&quot;">&lt;input type=&#8221;hidden&#8221; name=&#8221;return&#8221; value=&#8221;your_return_url_here&#8221;&gt;</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&quot;">Specify an IPN url in your profile      or in the notify_url variable in your html form. This is where you      process payment data from PayPal. The IPN url must be an absolute url. It      must also allow anonymous access from outside of your network. If you must      open your firewall to a specific host, please note the Sandbox sends IPNs      from ipn.sandbox.paypal.com. PayPal live site sends IPNs from      notify.paypal.com. Code: </span></li>
</ul>
<p class="MsoNormal" style="line-height:normal;margin:0 0 .0001pt .5in;"><span style="color:#008000;"><span style="font-family:&quot;">&lt;input type=&#8221;hidden&#8221; name=&#8221;notify_url&#8221; value=&#8221;your_ipn_url_here&#8221;&gt;</span></span></p>
<ul type="disc">
<li class="MsoNormal"><span style="font-family:&quot;">Auto Return = Enabled in account profile</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">PDT = Disabled in account profile</span></li>
<li class="MsoNormal"><span style="font-family:&quot;">IPN = Enabled in account profile</span></li>
</ul>
<p class="MsoNormal" style="line-height:normal;"><span style="font-family:&quot;">Sample script: <a href="http://paypaltech.com/SG2/" target="_blank"><span style="color:blue;">http://paypaltech.com/SG2/</span></a></span></p>
<p class="MsoNormal" style="line-height:normal;"><span style="font-family:&quot;">Test your IPN listener: <a href="http://paypaltech.com/Stephen/test/ipntest3.htm" target="_blank"><span style="color:blue;">http://paypaltech.com/Stephen/test/ipntest3.htm</span></a></span></p>
<p class="MsoNormal" style="line-height:normal;"><span style="font-family:&quot;">More info: <a href="https://www.paypal.com/IntegrationCenter/ic_ipn.html" target="_blank"><span style="color:blue;">https://www.paypal.com/IntegrationCenter/ic_ipn.html</span></a></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-family:&quot;">I recommend this approach</span><span style="font-family:&quot;"> over the 2 options above because there is less chance for breakage. It&#8217;s independent of the customer&#8217;s action. If the customer closes the browser or navigates away, you will still receive notifications from PayPal at your notify_url. IPN also has built-in retry mechanism. If there&#8217;s a problem reaching your notify_url, PayPal will re-try for several days. With either of the 2 options above, you only have one shot at getting the payment data.</span></p>
<p class="MsoNormal"><span style="font-family:&quot;"> </span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/thegame28.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/thegame28.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thegame28.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thegame28.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thegame28.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thegame28.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thegame28.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thegame28.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thegame28.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thegame28.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thegame28.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thegame28.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thegame28.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thegame28.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thegame28.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thegame28.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thegame28.wordpress.com&amp;blog=4336548&amp;post=10&amp;subd=thegame28&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thegame28.wordpress.com/2008/08/18/getting-payment-data-from-paypal-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b033495ca223a3dffa48f8dd0b7a750c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TheGame</media:title>
		</media:content>
	</item>
	</channel>
</rss>
