<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUQMQnc5fSp7ImA9WhRUEEs.&quot;"><id>tag:blogger.com,1999:blog-31568098</id><updated>2012-01-20T05:49:43.925-08:00</updated><category term="Performance" /><category term="Architecture" /><category term="soap" /><category term="General" /><category term="Java Gurus" /><category term="fluent api" /><category term="Design" /><category term="coding guidelines" /><category term="Java Basics" /><category term="SWING" /><category term="Search" /><category term="Java" /><category term="Interview" /><category term="Google App Engine" /><category term="Groovy" /><category term="management" /><category term="JUnit4" /><category term="Startup" /><category term="Guice" /><category term="Web" /><title>Praveen Manvi's  Technical Diary</title><subtitle type="html">Java, Content Management,Rich Internet Applications,Software Design &amp;amp; Architecture</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://praveendiary.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>43</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/PraveenManvisTechnicalDiary" /><feedburner:info uri="praveenmanvistechnicaldiary" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DkYMSXY_fCp7ImA9WhdbE0g.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-1370286751259963706</id><published>2011-09-30T07:29:00.000-07:00</published><updated>2011-10-11T10:29:48.844-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-11T10:29:48.844-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title /><content type="html">Backward and Forward compatibility with Java serialization protocol:-&lt;br /&gt;
&lt;br /&gt;
Java offers a nice protocol for storing and communicating the persisted information. In a distributed deployment environment the server code has to support both the new and old information when its anticipated the control over the deployment of different versions of the servers are not available. The code has to deal with both backward as well as forward compatibility. i.e. VERSION N should be able to read both VERSION N-1 &amp;amp; VERSION N+1 object.&lt;br /&gt;
&lt;br /&gt;
Maintaining the backward compatibility is easy. i.e. Version N code can read Version N-1 code by maintaining the version attribute. The version attribute in the read() API will make sure that the reading of new information is skipped. This is quite straight forward to achieve through “java.io.Externalizable” interface provided java where we have the full control of the context information on what we need to save. But it becomes tricky when we try to read the information created by future versions. The problem with forward compatibility is that the Java de-serialization it has to know what the new stuff that has been added &amp;amp; also should know where the information has been added.&lt;br /&gt;
&lt;br /&gt;
The solution explained below tries to solve the problem in a pure java with less overhead &amp;amp; suitable for systems that have already established using Java serialization with&amp;nbsp; ”java.io.Externalizable”&amp;nbsp; interface.&lt;br /&gt;
&lt;br /&gt;
Here the top down approach is followed for the explanation, it starts with how the usage of API should look like VERSION 0,1 &amp;amp; 2 then show how that can be achieved through code.&lt;br /&gt;
The challenge here is to read VERSION-1 (N) data from VERSION-0 (N-1) class. The current solution targets supporting only N+1 version &amp;amp; not the future versions which is the only important part of 24 X 7 support systems in the event of release back out.&lt;br /&gt;
Let's take an example of class "Test" having 2 attribute in VERSION-0, VERSION-1 introduces a new attribute called "versionData1" &amp;amp; VERSION-2 introduces the one more new attribute "versionData2". To simulate the case the data is inserted in between the data. In real-time scenario we will have lots of classes with readExternal()/writeExternal() methods spread across all over the code, but usually controlled with single mother object.&lt;br /&gt;
SKIP_START &amp;amp; SKIP_END are the marker interfaces used to identify the new information and ObjectInputWrapper is the new class used to move the cursor to skip the details when we read new information from the old class.&lt;br /&gt;
"Test" is Externalizable class having 3 attributes. We will include a new attribute in the second version and see how a "Test" object with VERSION -0 (N) reads VERSION -1 (N-1) object.&lt;br /&gt;
&lt;br /&gt;
This plugin architecture is quite scalable.&lt;span style="background-color: #f3f3f3;"&gt; ObjectInputWrapper can be injected with different serialization protocols like Google proto buffer, Oracle Coherence's POF, etc... using a using factory pattern like ObjectInputOutputProviderFactory that provides different implementation including custom logic to efficiently store &amp;amp; retrieve the information &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;u&gt; VERSION = 0;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void writeExternal(ObjectOutput out) throws IOException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeInt(VERSION);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeInt(number);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeObject(name);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void readExternal(ObjectInput _in) throws IOException, ClassNotFoundException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ObjectInputWrapper in = new &lt;span style="background-color: yellow;"&gt;ObjectInputWrapper&lt;/span&gt;(_in);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VERSION = in.readInt();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number = in.readInt();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = (String) in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
"Test{VERSION=0, number=10, name=praveen}"&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;u&gt;VERSION = 1&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
This class has new String attribute called versionData1 with the value "versionData1"&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void writeExternal(ObjectOutput out) throws IOException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeInt(VERSION);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeInt(number);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Added for version1 in between&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;span style="background-color: yellow;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: yellow; color: yellow;"&gt;&amp;nbsp; &lt;span style="color: black;"&gt;out.writeObject(new SKIP_START()); &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeObject(version1Data);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: yellow;"&gt;&amp;nbsp; out.writeObject(new SKIP_END()); &lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeObject(name);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
A marker interface class has been included to identify the new information that the older version can safely ignore.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void readExternal(ObjectInput _in) throws IOException, ClassNotFoundException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ObjectInputWrapper in = new ObjectInputWrapper(_in);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VERSION = in.readInt();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number = in.readInt();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(VERSION&amp;gt;=1) {&lt;br /&gt;
&lt;span style="background-color: yellow;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in.readObject();&lt;/span&gt; // we can safely ignore skip signals&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version1Data = (String)in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="background-color: yellow;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in.readObject();&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = (String) in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
"Test{VERSION=1, number=10, versionData1=versionData1, name=praveen}"&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&amp;nbsp;VERSION = 2&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void writeExternal(ObjectOutput out) throws IOException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeInt(VERSION);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeInt(number);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeObject(version1Data);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Added for version2 data in between&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeObject(new SKIP_START()); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeObject(version2Data);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeObject(new SKIP_END()); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.writeObject(name);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void readExternal(ObjectInput _in) throws IOException, ClassNotFoundException {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ObjectInputWrapper in = new ObjectInputWrapper(_in);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VERSION = in.readInt();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; number = in.readInt();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(VERSION&amp;gt;=1) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(VERSION==1){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version1Data = (String)in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(VERSION==1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(VERSION&amp;gt;=2) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version2Data = (String)in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name = (String) in.readObject();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
"Test{VERSION=2, number=10, versionData1=versionData1, versionData2=versionData2, name=praveen}"&lt;br /&gt;
The skip data version can safely be ignored in future versions. It will be removed in write first and also from read on subsequent versions.&lt;br /&gt;
&lt;br /&gt;
The 2 key classes used to implement are explained here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal" style="text-align: justify;"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt; line-height: 115%;"&gt;The ObjectInputWrapper class will have read method implementations for each basic data type. The sample below shows just two methods reading and readObject for illustration. For real implementations, we need to create final ObjectInputReaderTemplate classes for each basic data type and reuse them in the read methods of &lt;/span&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt; line-height: 115%;"&gt;ObjectInputWrapper&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Times New Roman', serif;"&gt; &amp;amp; they can be cached to avoid lots of object creations. The profiling of&amp;nbsp; this code showed that these light weight are pretty cheap to handle, JVM will make sure that there is overhead in terms of memory or the cpu by in lining them automatically.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-family: 'Times New Roman', serif;"&gt;&lt;script src="https://gist.github.com/1240845.js?file=ObjecrInputDecorator.java"&gt;
&lt;/script&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span style="font-family: 'Times New Roman', serif; font-size: 12pt; line-height: 115%;"&gt;This class makes use of generics and anonymous inner classes to move the cursor to skip the new information that version N was un-aware while reading.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Times New Roman', serif;"&gt;&lt;script src="https://gist.github.com/1253853.js?file=ObjectInputReaderTemplate.java"&gt;
&lt;/script&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Times New Roman', serif;"&gt;&amp;nbsp;One sample code having all the classes published in &lt;a href="https://github.com/pmanvi/javaiqutils/blob/master/src/ForwardCompatibleSerializedObjectPOC.java"&gt;github&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-1370286751259963706?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/icxOnrsSUNhWszvwNQiajZeMc-0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/icxOnrsSUNhWszvwNQiajZeMc-0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/icxOnrsSUNhWszvwNQiajZeMc-0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/icxOnrsSUNhWszvwNQiajZeMc-0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/7YNsyGHX0G8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/1370286751259963706/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=1370286751259963706" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/1370286751259963706?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/1370286751259963706?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/7YNsyGHX0G8/backward-and-forward-compatibility-with.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2011/09/backward-and-forward-compatibility-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08HSHk9eip7ImA9WhdVF0s.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-195315028906871220</id><published>2011-08-20T02:02:00.000-07:00</published><updated>2011-09-23T00:10:39.762-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-23T00:10:39.762-07:00</app:edited><title /><content type="html">&lt;span class="Apple-style-span" style="background-color: white; font-family: arial,sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;Caching Exceptions in server applications -&lt;/div&gt;&lt;div class="MsoNormal"&gt;In web applications it’s common that&amp;nbsp; response page of certain types can be cached for given http request, similar approach could be used to cache the exceptions in the server side applications as well. If the reason for any exception known upfront that it will be applicable for given amount of time, there is a opportunity to cache these to reduce the load on resources. This could be huge gain in cases where a particular piece of code is doing heavy operations like cpu intensive tasks, making remote calls, Database/File manipulation etc..&lt;/div&gt;&lt;div class="MsoNormal"&gt;Here is a solution making use of Java generics.&lt;/div&gt;&lt;div class="MsoNormal"&gt;For Ex:&lt;/div&gt;&lt;div class="MsoNormal"&gt;public static int mockHeavyOperation(String someData) throws FileNotFoundException,&lt;wbr&gt;&lt;/wbr&gt;Exception{&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Thread.sleep(3000);//&lt;wbr&gt;&lt;/wbr&gt;simulating some heavy operation&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(true) throw new FileNotFoundException();&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return 10;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div class="MsoNormal"&gt;Can be converted into&lt;/div&gt;&lt;div class="MsoNormal"&gt;public static int mockHeavyOperationWithCacheExc&lt;wbr&gt;&lt;/wbr&gt;eptionHandler(String someData) throws FileNotFoundException{&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return new ExceptionCacheTemplate&amp;lt;&lt;wbr&gt;&lt;/wbr&gt;Integer,FileNotFoundException&amp;gt;&lt;wbr&gt;&lt;/wbr&gt;(){&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Integer handle() throws Exception {&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Thread.sleep(3000); //simulating some heavy operation&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(true) throw new FileNotFoundException("Checked Exception");&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return 10;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}.runIn(new ExceptionCacheTemplate.&lt;wbr&gt;&lt;/wbr&gt;ExceptionKey(someData,&lt;wbr&gt;&lt;/wbr&gt;40000));&lt;/div&gt;&lt;div class="MsoNormal"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;div class="MsoNormal"&gt;As we can see from above code extra 4 lines are doing the trick.&lt;br /&gt;
If we run the first operation 10 times it takes 30000 millis where as 2nd example takes only 3000 millis, that's a huge gain I suppose.&lt;br /&gt;
1. The input information that resulted in exception can be stored as part of Exception Key class. It can be any class including String as shown above as long as it implements equals/hashCode(). runIn method works directly with String as well. If any Exception re-appears within the interval 40000 as shown above the Exception will be thrown from cache.&lt;br /&gt;
2. Only the exceptions that are included as part of the&amp;nbsp; generic exceptions,&lt;br /&gt;
3. A custom map can be provided to manage the expiring of cached exceptions, Default implementation will be managing through the value provided while creating cache key.&lt;br /&gt;
"public Map&lt;exceptionkey,exception&gt; getCache()" can be overridden to provide different implementation &lt;/exceptionkey,exception&gt;&lt;br /&gt;
For example &lt;a href="http://guava-libraries.googlecode.com/svn/trunk/javadoc/com/google/common/collect/MapMaker.html"&gt;Google's Guava library&lt;/a&gt; provides awesome fluent interface to manage expiry of keys.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Map&amp;lt;Key,Graph&amp;gt; graphs = new MapMaker()
       .concurrencyLevel(4)
       .weakKeys()
       .maximumSize(10000)
       .expireAfterWrite(10, TimeUnit.MINUTES)
       .makeComputingMap(
           new Function&lt;key, graph=""&gt;() {
             public Graph apply(Key key) {
               return createExpensiveGraph(key);
             }
           });&lt;/key,&gt;&lt;/code&gt;&lt;/pre&gt;&lt;code&gt; &lt;/code&gt;&lt;/div&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: arial,sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: arial,sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: arial,sans-serif; font-size: 13px;"&gt;It can be handled at the framework level making it completely transparent to the applications.&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: arial,sans-serif; font-size: 13px;"&gt;&lt;a href="https://github.com/pmanvi/javaiqutils/blob/master/src/ExceptionCacheTemplate.java"&gt;ExceptionTamplate&lt;/a&gt; is available in github&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-195315028906871220?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/i-aTU-MJFqykonY_a1hw4WHTzw8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i-aTU-MJFqykonY_a1hw4WHTzw8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/i-aTU-MJFqykonY_a1hw4WHTzw8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i-aTU-MJFqykonY_a1hw4WHTzw8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/_jMkBZrWxLY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/195315028906871220/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=195315028906871220" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/195315028906871220?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/195315028906871220?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/_jMkBZrWxLY/caching-exceptions-in-server.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2011/08/caching-exceptions-in-server.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8HQX04cCp7ImA9WhdQEEo.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-7755321978820180995</id><published>2011-07-17T10:13:00.000-07:00</published><updated>2011-08-11T07:27:10.338-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-11T07:27:10.338-07:00</app:edited><title /><content type="html">&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;u&gt;Notes on TDD and Unit testing in general.&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Most of the benefits of TDD are unquantifiable, Its tough to correlate better design, better ability to refactor the code to TDD practice. It requires a real practice to experience and appreciate the productivity benefits. When we are working with legacy code and is not easily testable, advocating TDD there is counter productive and refactoring such code to suit TDD is a hard sell &amp;amp; taking up such task is usually a thankless exercise.For green field projects TDD should be applied without a second thought, to my mind its not debatable anymore.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Here are some notes that I collected can be used to sell TDD during the discussions. For me TDD as effective tool of "COMMUNICATION" is the single most important point that should to enough to employ TDD. The lesser defects as result of clear executable communication should make all the stake holders namely Developers, Managers, Testers, Clients and finally the real users of software happy.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Tests prove that your code actually works resulting in fewer bugs, if we catch all the scenarios. Testing before the code is a design activity.These tests can’t replace system and acceptance testing,but they do supplement it &amp;amp; also fewer bugs that make it to QA.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;We can improve the design without breaking it. Having unit tests in place, we can do powerful refactorings that can untangle the most challenging of system psychoses.Refactoring not only becomes cheaper, it changes the developer mindset to strive for better quality.&amp;nbsp;When refactoring becomes cheaper, the quality of software continuously improves.Fixing PMD and FindBugs errors should not require management approval.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Unit tests are a way to make programmers have documentation as they hate to write a MSWord document &amp;amp; is a project management&amp;nbsp;technique. So when we can’t remember how to use a class APIs, read the unit tests to find out.MS Word documents are not meant to be compiled and deployed, if we can avoid as much as possible, its good for everyone.Unit tests reduces the communication pain points. Its a shared language.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;You know what your code needs to do. Then you make it do it. Even if you don’t have a working system,&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;you can see your code actually run and actually work. You get that great “I’ve done it!” feeling. Developers can avoid nagging questions "Have you written it", "Have you tested it" &amp;amp; finally "Have you really tested it". If tests are written and published, developer can always go &amp;amp; check from web tool.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Just try test-first if you want to be high on endorphins, proud about your work, and motivated to do more.They demonstrate concrete progress. You don’t have to wait a month for all the pieces of the system to come together.&amp;nbsp;You can show progress even without a working system. Not only can you say&amp;nbsp;you've&amp;nbsp;written the code, you can actually demonstrate success.&amp;nbsp;Of course, this is another distinction that traditional programming teaches us to ignore.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;“Done” doesn’t mean you’ve written the code and checked it in.“Done” means the code actually runs in the system without bugs. Running unit tests is a step closer to the latter.Unit tests are a form of sample code. We all encounter library functions and classes we don’t know how to use and&amp;nbsp;one of the first places we go is the sample code. Sample code is documentation.&amp;nbsp;But we don’t usually have samples for internal code. So we’re left shifting through the source or through the rest of the system.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Test-first forces you to plan before you code. Writing the test first forces you to think through your design and what it must accomplish&amp;nbsp;before you write the code which results in better code. This not only keeps you focused, it makes for better designs.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Test-first reduces the cost of bugs. Bugs detected earlier are easier to fix. Bugs detected later are usually the result of many changes,&amp;nbsp;and we don’t know which one caused the bug. So first we have to hunt for and find the bug. Then we have to refresh our memories on how the&amp;nbsp;code is supposed to work, because we haven’t seen it for months. Then finally we understand enough to propose a solution.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Anything that reduces the time between when we code the bug and when we detect it seems like a obvious win. We consider ourselves lucky to find out&amp;nbsp;about bugs within a few days, before the code is shipped to QA or to customers. But how about catching them within a few minutes?&amp;nbsp;That’s what test-first accomplishes with the bugs it catches.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;It’s even better than code inspections. Code inspections, they say, are better than testing, because using them to detect and fix bugs is cheaper than testing.&amp;nbsp;After the code ships, it’s much more expensive to fix the bugs. The earlier we can detect and fix bugs, the easier and cheaper and better.&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;That’s the advantage of having code reviews.Code inspections catch more bugs within a few days, rather than a few months, but&amp;nbsp;It virtually eliminates coder’s block. Ever wonder what statement to write next? Like writer’s block, coder’s block can be a real problem.&amp;nbsp;But test-first systematizes the structured part of coding, allowing you to concentrate on the creative part.&amp;nbsp;You may get stuck on how to test the next bit or how to make the test pass, but you’ll never be left puzzling over where to go next.&amp;nbsp;In fact, usually you’re left with the opposite problem: You know you need to take a break before you burn out, but you’re on a roll and don’t want to stop.Failed tests make better designs. Testing a piece of code forces you to define what that code is responsible for. If you can do this easily,&amp;nbsp;that means the code’s responsibility is well-defined and therefore that it has high cohesion. And if you can unit-test your code,&amp;nbsp;that means you can bind it as easily to the test as to the rest of the system. Therefore, it has loose coupling to the pieces around it.High cohesion and loose coupling is the definition of good, maintainable design. Code that is easy to unit-test is also easy to maintain.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;It’s faster than writing code without tests! Or to put it another way, skipping unit tests is faster, unless you actually need the code to work.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;Most of the effort we spend on code, we spend fixing it after we’ve checked it in to the source-code repository.&amp;nbsp;But test-first eliminates much of that waste by allowing us to get more of it right to start with and by making bugs easier to fix.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;One of the real value proposition of unit tests is that we get a low-level regression-test suite,we can go back at any time and see not only what broke but where the bug is. Arguably with many frameworks around it’s a low-effort way to catch bugs before the build goes off to QA. Whenever a bug comes it will make life lot easier without the need of using a debugger many a times.Test-first catches some bugs within a few minutes instead of a few days. It is even cheaper than code inspections, code reviews.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-7755321978820180995?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DHQoz1vaRqHrJFcR9qNLJ--MMyc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DHQoz1vaRqHrJFcR9qNLJ--MMyc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DHQoz1vaRqHrJFcR9qNLJ--MMyc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DHQoz1vaRqHrJFcR9qNLJ--MMyc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/RIc6abpdblU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/7755321978820180995/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=7755321978820180995" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7755321978820180995?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7755321978820180995?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/RIc6abpdblU/notes-on-tdd-and-unit-testing-in.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2011/07/notes-on-tdd-and-unit-testing-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMNQng7fip7ImA9Wx9WGEU.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-7569174330562913634</id><published>2011-01-17T09:17:00.000-08:00</published><updated>2011-01-24T06:48:13.606-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-24T06:48:13.606-08:00</app:edited><title /><content type="html">&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;2011 - My Technical Goals&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Make&lt;a href="http://javaiq.in/"&gt; JavaIQ.in&lt;/a&gt; useful &amp;amp; interesting to Java developers&lt;/li&gt;
&lt;/ul&gt;My child-hood ambition has been to become writer and editor to a magazine. My obsession with politics/history/technology, I guess hasn't helped me to make money, but it made me always feel complete and happy. Not sure by end of 2011, I will make JavaIQ.in a respectable online magazine, but I will definitely give my best shot at that.&amp;nbsp;I also would like to refine my applications that I created as my weekend projects &amp;amp; publish them in this site. &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Android - Develop mobile applications&lt;/li&gt;
&lt;/ul&gt;My guess is that developing&amp;nbsp;applications for smart phones, iPads will be the "big bet" in coming decade and Android is likely to lead in this area of innovation. My decade java programming experience should help. btw, &amp;nbsp;I bought my android phone this year.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;HTML5/Java Script - Learn it's effective usage&lt;/li&gt;
&lt;/ul&gt;Some how I never liked Flash/Flex. Although I tried JavaFX (which apparently was waste of effort), never spent significant time with Flash. I hope create awesome applications with HTML5. JavaScript has been excellent lanaguage I hope to do plenty of coding using YUI, JQuery and GWT/JSNI.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Play/Grails - Developing web applications in simpler way.&lt;/li&gt;
&lt;/ul&gt;The dumb struts &amp;amp; its similar web frameworks will have to be replaced with these awesome frameworks. I never had such a first time nice experience with any framework compared to Play. I intend to teach and develop few web applications with that this year.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;JVM lanaguages - continue to invest in learning&lt;/li&gt;
&lt;/ul&gt;I will continue to invest in learning Groovy and Scala &amp;amp; continue to look for places where I can use these to accomplish the tasks.&lt;br /&gt;
&lt;br /&gt;
Happy &amp;amp; prosperous new year to all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-7569174330562913634?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7-G06BjPvAbmyyvYEKSDb5qe17A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7-G06BjPvAbmyyvYEKSDb5qe17A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7-G06BjPvAbmyyvYEKSDb5qe17A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7-G06BjPvAbmyyvYEKSDb5qe17A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/l9gV1Mv-P4s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/7569174330562913634/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=7569174330562913634" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7569174330562913634?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7569174330562913634?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/l9gV1Mv-P4s/2011-my-technical-goals-make-javaiq.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2011/01/2011-my-technical-goals-make-javaiq.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8GSHYycCp7ImA9WxFWGUo.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-3341579743738378589</id><published>2010-06-03T07:04:00.000-07:00</published><updated>2010-06-07T22:27:09.898-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-07T22:27:09.898-07:00</app:edited><title /><content type="html">&lt;u&gt;Using groovy to search name for my newly born son&lt;/u&gt;.&lt;br /&gt;
I had the un-sorted list of names of the God Vishnu from where I wanted to select a name, so wanted to sort them out alphabetically &amp;amp; used Groovy for the same.&lt;br /&gt;
&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589&amp;amp;pli=1#" onclick="return toggle('GroovyCode')"&gt;Groovy Code in Java style&lt;/a&gt; - Click to see the code&lt;br /&gt;
&lt;div id="GroovyCode" style="display: none;"&gt;&lt;br /&gt;
&lt;pre&gt;&lt;a href="http://www.blogger.com/" name="l1"&gt;&lt;span class="ln"&gt;1    &lt;/span&gt;&lt;/a&gt;&lt;span class="s0"&gt;def &lt;/span&gt;&lt;span class="s1"&gt;top = &lt;/span&gt;&lt;span class="s2"&gt;"""
&lt;a href="http://www.blogger.com/" name="l2"&gt;&lt;span class="ln"&gt;2    &lt;/span&gt;&lt;/a&gt;    &amp;lt;html&amp;gt; &amp;lt;head&amp;gt;
&lt;a href="http://www.blogger.com/" name="l3"&gt;&lt;span class="ln"&gt;3    &lt;/span&gt;&lt;/a&gt;    &amp;lt;script LANGUAGE="JavaScript"&amp;gt;
&lt;a href="http://www.blogger.com/" name="l4"&gt;&lt;span class="ln"&gt;4    &lt;/span&gt;&lt;/a&gt;    &amp;lt;!--

&lt;a href="http://www.blogger.com/" name="l5"&gt;&lt;span class="ln"&gt;5    &lt;/span&gt;&lt;/a&gt;        function toggle(id) { var e = document.getElementById(id); e.style.display = e.style.display == "none" ? "block" : "none"; return false}
&lt;a href="http://www.blogger.com/" name="l6"&gt;&lt;span class="ln"&gt;6    &lt;/span&gt;&lt;/a&gt;    //--&amp;gt;
&lt;a href="http://www.blogger.com/" name="l7"&gt;&lt;span class="ln"&gt;7    &lt;/span&gt;&lt;/a&gt;    &amp;lt;/script&amp;gt;

&lt;a href="http://www.blogger.com/" name="l8"&gt;&lt;span class="ln"&gt;8    &lt;/span&gt;&lt;/a&gt;    &amp;lt;/head&amp;gt;
&lt;a href="http://www.blogger.com/" name="l9"&gt;&lt;span class="ln"&gt;9    &lt;/span&gt;&lt;/a&gt;    &amp;lt;body&amp;gt;
&lt;a href="http://www.blogger.com/" name="l10"&gt;&lt;span class="ln"&gt;10   &lt;/span&gt;&lt;/a&gt;    """&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l11"&gt;&lt;span class="ln"&gt;11   &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="s0"&gt;def &lt;/span&gt;&lt;span class="s1"&gt;htmlOut = top
&lt;a href="http://www.blogger.com/" name="l12"&gt;&lt;span class="ln"&gt;12   &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="s0"&gt;def &lt;/span&gt;&lt;span class="s1"&gt;set = &lt;/span&gt;&lt;span class="s0"&gt;new &lt;/span&gt;&lt;span class="s1"&gt;TreeSet&amp;lt;String&amp;gt;()

&lt;a href="http://www.blogger.com/" name="l13"&gt;&lt;span class="ln"&gt;13   &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="s0"&gt;new &lt;/span&gt;&lt;span class="s1"&gt;File(&lt;/span&gt;&lt;span class="s2"&gt;'c:/vishnu.txt'&lt;/span&gt;&lt;span class="s1"&gt;).eachLine {
&lt;a href="http://www.blogger.com/" name="l14"&gt;&lt;span class="ln"&gt;14   &lt;/span&gt;&lt;/a&gt;  set.add(it.toLowerCase().trim())
&lt;a href="http://www.blogger.com/" name="l15"&gt;&lt;span class="ln"&gt;15   &lt;/span&gt;&lt;/a&gt;}
&lt;a href="http://www.blogger.com/" name="l16"&gt;&lt;span class="ln"&gt;16   &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="s0"&gt;def &lt;/span&gt;&lt;span class="s1"&gt;ref = &lt;/span&gt;&lt;span class="s2"&gt;"a"&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l17"&gt;&lt;span class="ln"&gt;17   &lt;/span&gt;&lt;/a&gt;htmlOut += &lt;/span&gt;&lt;span class="s2"&gt;"""

&lt;a href="http://www.blogger.com/" name="l18"&gt;&lt;span class="ln"&gt;18   &lt;/span&gt;&lt;/a&gt;        &amp;lt;a href="#" onclick="return toggle('&lt;/span&gt;&lt;span class="s1"&gt;$ref&lt;/span&gt;&lt;span class="s2"&gt;')"&amp;gt;&lt;/span&gt;&lt;span class="s1"&gt;$ref&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/a&amp;gt;
&lt;a href="http://www.blogger.com/" name="l19"&gt;&lt;span class="ln"&gt;19   &lt;/span&gt;&lt;/a&gt;        &amp;lt;div id='&lt;/span&gt;&lt;span class="s1"&gt;$ref&lt;/span&gt;&lt;span class="s2"&gt;' style="display:none"&amp;gt;

&lt;a href="http://www.blogger.com/" name="l20"&gt;&lt;span class="ln"&gt;20   &lt;/span&gt;&lt;/a&gt;    """&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l21"&gt;&lt;span class="ln"&gt;21   &lt;/span&gt;&lt;/a&gt;set.each {
&lt;a href="http://www.blogger.com/" name="l22"&gt;&lt;span class="ln"&gt;22   &lt;/span&gt;&lt;/a&gt;  &lt;/span&gt;&lt;span class="s0"&gt;if &lt;/span&gt;&lt;span class="s1"&gt;(ref != it.charAt(&lt;/span&gt;&lt;span class="s3"&gt;0&lt;/span&gt;&lt;span class="s1"&gt;)) {
&lt;a href="http://www.blogger.com/" name="l23"&gt;&lt;span class="ln"&gt;23   &lt;/span&gt;&lt;/a&gt;    htmlOut += &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;/div&amp;gt;"&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l24"&gt;&lt;span class="ln"&gt;24   &lt;/span&gt;&lt;/a&gt;    ref = it.charAt(&lt;/span&gt;&lt;span class="s3"&gt;0&lt;/span&gt;&lt;span class="s1"&gt;)

&lt;a href="http://www.blogger.com/" name="l25"&gt;&lt;span class="ln"&gt;25   &lt;/span&gt;&lt;/a&gt;    htmlOut += &lt;/span&gt;&lt;span class="s2"&gt;"""
&lt;a href="http://www.blogger.com/" name="l26"&gt;&lt;span class="ln"&gt;26   &lt;/span&gt;&lt;/a&gt;            &amp;lt;a href="#" onclick="return toggle('&lt;/span&gt;&lt;span class="s1"&gt;$ref&lt;/span&gt;&lt;span class="s2"&gt;')"&amp;gt;&lt;/span&gt;&lt;span class="s1"&gt;$ref&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/a&amp;gt;
&lt;a href="http://www.blogger.com/" name="l27"&gt;&lt;span class="ln"&gt;27   &lt;/span&gt;&lt;/a&gt;            &amp;lt;div id='&lt;/span&gt;&lt;span class="s1"&gt;$ref&lt;/span&gt;&lt;span class="s2"&gt;' style="display:none"&amp;gt;

&lt;a href="http://www.blogger.com/" name="l28"&gt;&lt;span class="ln"&gt;28   &lt;/span&gt;&lt;/a&gt;        """&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l29"&gt;&lt;span class="ln"&gt;29   &lt;/span&gt;&lt;/a&gt;  }
&lt;a href="http://www.blogger.com/" name="l30"&gt;&lt;span class="ln"&gt;30   &lt;/span&gt;&lt;/a&gt;  htmlOut += it
&lt;a href="http://www.blogger.com/" name="l31"&gt;&lt;span class="ln"&gt;31   &lt;/span&gt;&lt;/a&gt;  htmlOut += &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;br/&amp;gt;"&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l32"&gt;&lt;span class="ln"&gt;32   &lt;/span&gt;&lt;/a&gt;}
&lt;a href="http://www.blogger.com/" name="l33"&gt;&lt;span class="ln"&gt;33   &lt;/span&gt;&lt;/a&gt;htmlOut += &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;br/&amp;gt;&amp;lt;/body&amp;gt;"&lt;/span&gt;&lt;span class="s1"&gt;

&lt;a href="http://www.blogger.com/" name="l34"&gt;&lt;span class="ln"&gt;34   &lt;/span&gt;&lt;/a&gt;writer = &lt;/span&gt;&lt;span class="s0"&gt;new &lt;/span&gt;&lt;span class="s1"&gt;FileWriter(&lt;/span&gt;&lt;span class="s2"&gt;'vishnu.html'&lt;/span&gt;&lt;span class="s1"&gt;)
&lt;a href="http://www.blogger.com/" name="l35"&gt;&lt;span class="ln"&gt;35   &lt;/span&gt;&lt;/a&gt;writer.println(htmlOut)
&lt;a href="http://www.blogger.com/" name="l36"&gt;&lt;span class="ln"&gt;36   &lt;/span&gt;&lt;/a&gt;writer.flush()
&lt;a href="http://www.blogger.com/" name="l37"&gt;&lt;span class="ln"&gt;37   &lt;/span&gt;&lt;/a&gt;
&lt;a href="http://www.blogger.com/" name="l38"&gt;&lt;span class="ln"&gt;38   &lt;/span&gt;&lt;/a&gt;println &lt;/span&gt;&lt;span class="s2"&gt;'done :)'&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l39"&gt;&lt;span class="ln"&gt;39   &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589&amp;amp;pli=1#" onclick="return toggle('GroovyWithMarkUpBuilder')"&gt;Groovy with DSL MarkUpBuilder&lt;/a&gt; -Click to see the code&lt;br /&gt;
&lt;div id="GroovyWithMarkUpBuilder" style="display: none;"&gt;&lt;pre&gt;&lt;a href="http://www.blogger.com/" name="l1"&gt;&lt;span class="ln"&gt;1    &lt;/span&gt;&lt;/a&gt;&lt;span class="s0"&gt;def &lt;/span&gt;&lt;span class="s1"&gt;writer = &lt;/span&gt;&lt;span class="s0"&gt;new &lt;/span&gt;&lt;span class="s1"&gt;FileWriter(&lt;/span&gt;&lt;span class="s2"&gt;'c:/Names1000.html'&lt;/span&gt;&lt;span class="s1"&gt;)
&lt;a href="http://www.blogger.com/" name="l2"&gt;&lt;span class="ln"&gt;2    &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="s0"&gt;def &lt;/span&gt;&lt;span class="s1"&gt;src = &lt;/span&gt;&lt;span class="s0"&gt;new &lt;/span&gt;&lt;span class="s1"&gt;groovy.xml.MarkupBuilder(writer)
&lt;a href="http://www.blogger.com/" name="l3"&gt;&lt;span class="ln"&gt;3    &lt;/span&gt;&lt;/a&gt;src.html {
&lt;a href="http://www.blogger.com/" name="l4"&gt;&lt;span class="ln"&gt;4    &lt;/span&gt;&lt;/a&gt;  head {

&lt;a href="http://www.blogger.com/" name="l5"&gt;&lt;span class="ln"&gt;5    &lt;/span&gt;&lt;/a&gt;    script &lt;/span&gt;&lt;span class="s2"&gt;"""
&lt;a href="http://www.blogger.com/" name="l6"&gt;&lt;span class="ln"&gt;6    &lt;/span&gt;&lt;/a&gt;        function toggle(id) { var e = document.getElementById(id); e.style.display = e.style.display == "none" ? "block" : "none"; return false}
&lt;a href="http://www.blogger.com/" name="l7"&gt;&lt;span class="ln"&gt;7    &lt;/span&gt;&lt;/a&gt;      """&lt;/span&gt;&lt;span class="s1"&gt;

&lt;a href="http://www.blogger.com/" name="l8"&gt;&lt;span class="ln"&gt;8    &lt;/span&gt;&lt;/a&gt;  }
&lt;a href="http://www.blogger.com/" name="l9"&gt;&lt;span class="ln"&gt;9    &lt;/span&gt;&lt;/a&gt;  &lt;/span&gt;&lt;span class="s0"&gt;def &lt;/span&gt;&lt;span class="s1"&gt;set = &lt;/span&gt;&lt;span class="s0"&gt;new &lt;/span&gt;&lt;span class="s1"&gt;TreeSet&amp;lt;String&amp;gt;()
&lt;a href="http://www.blogger.com/" name="l10"&gt;&lt;span class="ln"&gt;10   &lt;/span&gt;&lt;/a&gt;  &lt;/span&gt;&lt;span class="s0"&gt;new &lt;/span&gt;&lt;span class="s1"&gt;File(&lt;/span&gt;&lt;span class="s2"&gt;'c:/vishnu.txt'&lt;/span&gt;&lt;span class="s1"&gt;).eachLine {

&lt;a href="http://www.blogger.com/" name="l11"&gt;&lt;span class="ln"&gt;11   &lt;/span&gt;&lt;/a&gt;    set.add(it.toLowerCase().trim())
&lt;a href="http://www.blogger.com/" name="l12"&gt;&lt;span class="ln"&gt;12   &lt;/span&gt;&lt;/a&gt;  }
&lt;a href="http://www.blogger.com/" name="l13"&gt;&lt;span class="ln"&gt;13   &lt;/span&gt;&lt;/a&gt;  body {
&lt;a href="http://www.blogger.com/" name="l14"&gt;&lt;span class="ln"&gt;14   &lt;/span&gt;&lt;/a&gt;    &lt;/span&gt;&lt;span class="s0"&gt;for &lt;/span&gt;&lt;span class="s1"&gt;(alphabet &lt;/span&gt;&lt;span class="s0"&gt;in &lt;/span&gt;&lt;span class="s3"&gt;97&lt;/span&gt;&lt;span class="s1"&gt;..&lt;/span&gt;&lt;span class="s3"&gt;122&lt;/span&gt;&lt;span class="s1"&gt;) {

&lt;a href="http://www.blogger.com/" name="l15"&gt;&lt;span class="ln"&gt;15   &lt;/span&gt;&lt;/a&gt;      &lt;/span&gt;&lt;span class="s0"&gt;char &lt;/span&gt;&lt;span class="s1"&gt;current = ((&lt;/span&gt;&lt;span class="s0"&gt;char&lt;/span&gt;&lt;span class="s1"&gt;) alphabet)
&lt;a href="http://www.blogger.com/" name="l16"&gt;&lt;span class="ln"&gt;16   &lt;/span&gt;&lt;/a&gt;      Set&amp;lt;String&amp;gt; names = set.findAll { it.charAt(&lt;/span&gt;&lt;span class="s3"&gt;0&lt;/span&gt;&lt;span class="s1"&gt;) == current}
&lt;a href="http://www.blogger.com/" name="l17"&gt;&lt;span class="ln"&gt;17   &lt;/span&gt;&lt;/a&gt;      &lt;/span&gt;&lt;span class="s0"&gt;def &lt;/span&gt;&lt;span class="s1"&gt;size = names.size()

&lt;a href="http://www.blogger.com/" name="l18"&gt;&lt;span class="ln"&gt;18   &lt;/span&gt;&lt;/a&gt;      &lt;/span&gt;&lt;span class="s0"&gt;if &lt;/span&gt;&lt;span class="s1"&gt;(size != &lt;/span&gt;&lt;span class="s3"&gt;0&lt;/span&gt;&lt;span class="s1"&gt;) {
&lt;a href="http://www.blogger.com/" name="l19"&gt;&lt;span class="ln"&gt;19   &lt;/span&gt;&lt;/a&gt;        a(href: &lt;/span&gt;&lt;span class="s2"&gt;"#"&lt;/span&gt;&lt;span class="s1"&gt;, onclick: &lt;/span&gt;&lt;span class="s2"&gt;"return toggle(\"&lt;/span&gt;&lt;span class="s1"&gt;$current&lt;/span&gt;&lt;span class="s2"&gt;\")"&lt;/span&gt;&lt;span class="s1"&gt;) {
&lt;a href="http://www.blogger.com/" name="l20"&gt;&lt;span class="ln"&gt;20   &lt;/span&gt;&lt;/a&gt;          span &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s1"&gt;$current&lt;/span&gt;&lt;span class="s2"&gt; (&lt;/span&gt;&lt;span class="s1"&gt;$size&lt;/span&gt;&lt;span class="s2"&gt;)"&lt;/span&gt;&lt;span class="s1"&gt;

&lt;a href="http://www.blogger.com/" name="l21"&gt;&lt;span class="ln"&gt;21   &lt;/span&gt;&lt;/a&gt;        }
&lt;a href="http://www.blogger.com/" name="l22"&gt;&lt;span class="ln"&gt;22   &lt;/span&gt;&lt;/a&gt;        div(id: current, style: &lt;/span&gt;&lt;span class="s2"&gt;'display:none'&lt;/span&gt;&lt;span class="s1"&gt;) {
&lt;a href="http://www.blogger.com/" name="l23"&gt;&lt;span class="ln"&gt;23   &lt;/span&gt;&lt;/a&gt;          names.each {
&lt;a href="http://www.blogger.com/" name="l24"&gt;&lt;span class="ln"&gt;24   &lt;/span&gt;&lt;/a&gt;            li it
&lt;a href="http://www.blogger.com/" name="l25"&gt;&lt;span class="ln"&gt;25   &lt;/span&gt;&lt;/a&gt;          }

&lt;a href="http://www.blogger.com/" name="l26"&gt;&lt;span class="ln"&gt;26   &lt;/span&gt;&lt;/a&gt;        }
&lt;a href="http://www.blogger.com/" name="l27"&gt;&lt;span class="ln"&gt;27   &lt;/span&gt;&lt;/a&gt;      } &lt;/span&gt;&lt;span class="s0"&gt;else &lt;/span&gt;&lt;span class="s1"&gt;{
&lt;a href="http://www.blogger.com/" name="l28"&gt;&lt;span class="ln"&gt;28   &lt;/span&gt;&lt;/a&gt;        span &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s1"&gt;$current&lt;/span&gt;&lt;span class="s2"&gt; (&lt;/span&gt;&lt;span class="s1"&gt;$size&lt;/span&gt;&lt;span class="s2"&gt;)"&lt;/span&gt;&lt;span class="s1"&gt;

&lt;a href="http://www.blogger.com/" name="l29"&gt;&lt;span class="ln"&gt;29   &lt;/span&gt;&lt;/a&gt;      }
&lt;a href="http://www.blogger.com/" name="l30"&gt;&lt;span class="ln"&gt;30   &lt;/span&gt;&lt;/a&gt;      br &lt;/span&gt;&lt;span class="s2"&gt;''&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l31"&gt;&lt;span class="ln"&gt;31   &lt;/span&gt;&lt;/a&gt;    }
&lt;a href="http://www.blogger.com/" name="l32"&gt;&lt;span class="ln"&gt;32   &lt;/span&gt;&lt;/a&gt;  }
&lt;a href="http://www.blogger.com/" name="l33"&gt;&lt;span class="ln"&gt;33   &lt;/span&gt;&lt;/a&gt;  println &lt;/span&gt;&lt;span class="s2"&gt;'done :)'&lt;/span&gt;&lt;span class="s1"&gt;
&lt;a href="http://www.blogger.com/" name="l34"&gt;&lt;span class="ln"&gt;34   &lt;/span&gt;&lt;/a&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;a href="http://docs.google.com/View?id=dfw4gsjv_106hbc7d9cz"&gt;Unsorted 1000 Names&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://docs.google.com/View?id=dfw4gsjv_108dfmrq8cg"&gt;Sorted 1000 Names with groovy&lt;/a&gt;&lt;br /&gt;
Groovy is indeed Java++, It adds nicer syntax, closures and fluent interface making coding a joy without much noise.&lt;br /&gt;
Here is the result from groovy program. Click on letters to hide/expand the names starting with those letters.&lt;br /&gt;
&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;a&amp;quot;)"&gt;&lt;br /&gt;
a (113)&lt;/a&gt;&lt;br /&gt;
&lt;div id="a" style="display: none;"&gt;a-bhooh: one who has no birth&lt;br /&gt;
a-moortirmaan: having no form&lt;br /&gt;
aadhaaranilayah: the fundamental sustainer&lt;br /&gt;
aadidevah: the first deity&lt;br /&gt;
aadidevah: the primary source of everything&lt;br /&gt;
aadityah: son of aditi&lt;br /&gt;
aadityah: the son of aditi (vaamana)&lt;br /&gt;
aanandah: a mass of pure bliss&lt;br /&gt;
aanandee: one who gives delight&lt;br /&gt;
aashramah: haven&lt;br /&gt;
aatmavaan: the self in all beings&lt;br /&gt;
aatmayonih: the uncaused cause&lt;br /&gt;
aavartanah: the unseen dynamism&lt;br /&gt;
abhipraayah: one who is faced by all seekers marching to the infinite&lt;br /&gt;
acalah: non-moving&lt;br /&gt;
achyutah: he who undergoes no changes&lt;br /&gt;
achyutah: infallible&lt;br /&gt;
acintyo: inconceivable&lt;br /&gt;
adbhutah: wonderful&lt;br /&gt;
adhaataa: above whom there is no other to command&lt;br /&gt;
adhishthaanam: the substratum of the entire universe&lt;br /&gt;
adhokshajah: one whose vitality never flows downwards&lt;br /&gt;
adhritah: without support&lt;br /&gt;
adrishyah: imperceptible&lt;br /&gt;
agraahyah: he who is not perceived sensually&lt;br /&gt;
agrajah: the first-born&lt;br /&gt;
agraneeh: he who guides us to the peak&lt;br /&gt;
ahah: he who is the nature of time&lt;br /&gt;
ahassamvartakah: he who thrills the day and makes it function vigorously&lt;br /&gt;
ajah: he who takes the form of aja, brahma&lt;br /&gt;
ajah: unborn&lt;br /&gt;
ajitah: vanquished by none&lt;br /&gt;
akroorah: never cruel&lt;br /&gt;
akshara: indestructible&lt;br /&gt;
aksharam: imperishable&lt;br /&gt;
akshobhyah: one who cannot be annoyed by anyone&lt;br /&gt;
akshobhyah: one who is ever unruffled&lt;br /&gt;
amaanee: without false vanity&lt;br /&gt;
amaraprabhuh: the lord of the devas&lt;br /&gt;
ambho-nidhir: the substratum of the four types of beings&lt;br /&gt;
ameyaatmaa: he who manifests in infinite varieties&lt;br /&gt;
ameyaatmaa: he whose essence is immeasurable&lt;br /&gt;
amitaashanah: of endless appetite&lt;br /&gt;
amitavikramah: of immeasurable prowess&lt;br /&gt;
amoghah: ever useful&lt;br /&gt;
amoghah: he whose acts are for a great purpose&lt;br /&gt;
amoortih: formless&lt;br /&gt;
amritaamsoodbhavo: the moon who gives flavor to vegetables&lt;br /&gt;
amritaashah: one whose desires are never fruitless&lt;br /&gt;
amritah: immortal&lt;br /&gt;
amritapah: one who drinks the nectar&lt;br /&gt;
amritavapuh: he whose form is immortal&lt;br /&gt;
amrityuh: he who knows no death&lt;br /&gt;
anaadi-nidhanah: he without origin or end&lt;br /&gt;
anaadih: one who is the first cause&lt;br /&gt;
anaamayah: one who has no diseases&lt;br /&gt;
anaghah: sinless&lt;br /&gt;
analah: fire&lt;br /&gt;
analah: one of unlimited wealth, power and glory&lt;br /&gt;
anantaatmaa: the infinite self&lt;br /&gt;
anantah: endless&lt;br /&gt;
anantajit: ever-victorious&lt;br /&gt;
anantaroopah: one of infinite forms&lt;br /&gt;
anantashreeh: full of infinite glories&lt;br /&gt;
anarthah: one to whom there is nothing yet to be fulfilled&lt;br /&gt;
anayah: one who has no leader&lt;br /&gt;
aneeshah: one who has none to lord over him&lt;br /&gt;
anekamoortih: multi-formed&lt;br /&gt;
anilah: air&lt;br /&gt;
anilah: one who never slips&lt;br /&gt;
animishah: he who remains unwinking; ever knowing&lt;br /&gt;
anirdeshya-vapuh: he whose form is indescribable&lt;br /&gt;
anirdeshya-vapuh: of indescribable form&lt;br /&gt;
aniruddhah: he who cannot be obstructed&lt;br /&gt;
anirvinnah: he who has no discontent&lt;br /&gt;
anirvinnah: one who feels no disappointment&lt;br /&gt;
anivartee: one who never retreats&lt;br /&gt;
aniyantaa: one who has no controller&lt;br /&gt;
annaadah: one who eats the food&lt;br /&gt;
annam: one who is food&lt;br /&gt;
anniruddhah: he who is invincible by any enemy&lt;br /&gt;
antakah: the death&lt;br /&gt;
anuh: the subtlest&lt;br /&gt;
anukoolah: well-wisher of everyone&lt;br /&gt;
anuttamah: incomparably great&lt;br /&gt;
apaam-nidhih: treasure of waters (the ocean)&lt;br /&gt;
aparaajitah: one who cannot be defeated&lt;br /&gt;
apramattah: he who never makes a wrong judgement 326) pratishthitah: he who has no cause&lt;br /&gt;
aprameyaatmaa: a soul not known through the pramanas&lt;br /&gt;
aprameyah: he who cannot be perceived&lt;br /&gt;
apratirathah: one who has no enemies to threaten him&lt;br /&gt;
apyayah: the one in whom the universe merges&lt;br /&gt;
araudrah: one who has no negative emotions or urges&lt;br /&gt;
aravindaakshah: he who has eyes as beautiful as the lotus&lt;br /&gt;
archishmaan: the effulgent&lt;br /&gt;
architah: one who is constantly worshipped by his devotees&lt;br /&gt;
arhah: one who deserves to be worshiped&lt;br /&gt;
arkah: one who is in the form of the sun&lt;br /&gt;
arthah: he who is worshiped by all&lt;br /&gt;
asankhyeyah: he who has numberlesss names and forms&lt;br /&gt;
asat: illusion&lt;br /&gt;
ashokah: he who has no sorrow&lt;br /&gt;
ashvattas: tree of life&lt;br /&gt;
ateendrah: he who surpasses indra&lt;br /&gt;
ateendriyo: beyond the sense organs&lt;br /&gt;
athaaparaajitah: the unvanquished&lt;br /&gt;
atulah: incomparable&lt;br /&gt;
aushadham: medicine&lt;br /&gt;
avijnaataa: the non-knower (the knower being the conditioned soul within the body)&lt;br /&gt;
avyaktah: unmanifeset&lt;br /&gt;
avyangah: without imperfections&lt;br /&gt;
avyayah: without destruction&lt;br /&gt;
ayamah: one who knows no death&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;b&amp;quot;)"&gt;b (54)&lt;/a&gt;&lt;div id="b" style="display: none;"&gt;babhrur: he who rules over all the worlds&lt;br /&gt;
bahu-shiraah: he who has many heads&lt;br /&gt;
beejamavyayam: the immutable seed&lt;br /&gt;
bhaanuh: self-effulgent&lt;br /&gt;
bhaarabhrit: one who carries the load of the universe&lt;br /&gt;
bhaaskara-dyutih: the effulgence of the sun&lt;br /&gt;
bhaavanah: he who gives everything to his devotees&lt;br /&gt;
bhaavo: he who becomes all moving and nonmoving things&lt;br /&gt;
bhagahaa: one who destroys the six opulences during pralaya&lt;br /&gt;
bhagavaan: one who possesses six opulences&lt;br /&gt;
bhaktavatsalah: one who loves his devotees&lt;br /&gt;
bhartaa: he who governs the entire living world&lt;br /&gt;
bhayakrit: giver of fear&lt;br /&gt;
bhayanaashanah: destroyer of fear&lt;br /&gt;
bhayapahah: one who destroys all fears&lt;br /&gt;
bheema-paraakramah: one whose prowess is fearful to his enemies&lt;br /&gt;
bheemah: terrible form&lt;br /&gt;
bheemah: the terrible&lt;br /&gt;
bheshajam: medicine&lt;br /&gt;
bhishak: physician&lt;br /&gt;
bhojanam: he who is the sense-objects&lt;br /&gt;
bhoktaa: the enjoyer&lt;br /&gt;
bhoktaaa: one who enjoys&lt;br /&gt;
bhoogarbhah: he who is the womb of the world&lt;br /&gt;
bhoor-bhuvah svas-taruh: the tree of bhur, bhuvah and svah&lt;br /&gt;
bhoor-bhuvo: the substratum of the earth&lt;br /&gt;
bhooridakshinah: he who gives away large gifts&lt;br /&gt;
bhooshanah: one who adorns the world&lt;br /&gt;
bhooshayah: one who rested on the ocean shore (rama)&lt;br /&gt;
bhoota-bhaavanah: the cause of the growth and birth of all creatures&lt;br /&gt;
bhoota-bhavya-bhavan-naathah: the lord of past, present and future&lt;br /&gt;
bhoota-bhavya-bhavat-prabhuh: the lord of past, present and future&lt;br /&gt;
bhoota-bhrit: he who nourishes all creatures&lt;br /&gt;
bhoota-krit: the creator of all creatures&lt;br /&gt;
bhoota-maheshvarah: the great lord of beings&lt;br /&gt;
bhootaadih: the cause of the five great elements&lt;br /&gt;
bhootaatmaa: the aatman of all beings&lt;br /&gt;
bhootaavaaso: the dwelling place of the elements&lt;br /&gt;
bhootih: one who is pure existence&lt;br /&gt;
bhraajishnur: self-effulgent consciousness&lt;br /&gt;
bhujagottamah: the serpent ananta&lt;br /&gt;
braahmana-priyah: dear to the brahmanas&lt;br /&gt;
braahmanah: one who has realised brahman&lt;br /&gt;
brahma-vivardhanah: one who increases the brahman&lt;br /&gt;
brahma: biggest&lt;br /&gt;
brahmaa: creator&lt;br /&gt;
brahmajno: one who knows the nature of brahman&lt;br /&gt;
brahmakrit: one who acts in brahman&lt;br /&gt;
brahmanyah: protector of brahman (anything related to narayana)&lt;br /&gt;
brahmavid: one who knows brahman&lt;br /&gt;
brahmee: one who is with brahma&lt;br /&gt;
brihad-roopah: vast, of infinite dimensions&lt;br /&gt;
brihat-bhaanuh: he who illumines the world with the rays of the sun and moon&lt;br /&gt;
brihat: the greatest&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;c&amp;quot;)"&gt;c (20)&lt;/a&gt;&lt;div id="c" style="display: none;"&gt;chaanooraandhra-nishoodanah: the slayer of canura&lt;br /&gt;
chakra-gadaadharah: bearer of the disc and mace&lt;br /&gt;
chakree: carrier of sudarsana&lt;br /&gt;
chakree: holder of the chakra&lt;br /&gt;
chalah: moving&lt;br /&gt;
chandanaangadee: one who has attractive armlets&lt;br /&gt;
chandraamshuh: the rays of the moon&lt;br /&gt;
chatur-vedavid: knower of all four vedas&lt;br /&gt;
chaturaatmaa: clear-minded&lt;br /&gt;
chaturaatmaa: the four-fold self&lt;br /&gt;
chaturashrah: one who deals squarely&lt;br /&gt;
chaturbaahuh: four-handed&lt;br /&gt;
chaturbhaavas: the source of the four&lt;br /&gt;
chaturbhujah: four-handed&lt;br /&gt;
chaturdamstrah: he who has four canines (nrsimha)&lt;br /&gt;
chaturgatih: the ultimate goal of all four varnas and asramas&lt;br /&gt;
chaturmoortih: four-formed&lt;br /&gt;
chaturvyoohah: one who expresses himself as the dynamic centre in the four vyoohas&lt;br /&gt;
chaturvyoohah: vasudeva, sankarshan etc&lt;br /&gt;
chinnasamshayah: one whose doubts are ever at rest&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;d&amp;quot;)"&gt;d (57)&lt;/a&gt;&lt;div id="d" style="display: none;"&gt;daamodarah: whose stomach is marked with three lines&lt;br /&gt;
daarunah: merciless towards the unrighteous&lt;br /&gt;
daashaarhah: one who was born in the dasarha race&lt;br /&gt;
dakshah: prompt&lt;br /&gt;
dakshah: the smart&lt;br /&gt;
dakshinah: the most liberal&lt;br /&gt;
damah: beautitude in the self&lt;br /&gt;
damanah: he who controls rakshasas&lt;br /&gt;
damayitaa: the controller&lt;br /&gt;
dandah: one who punishes the wicked&lt;br /&gt;
darpadah: one who creates pride, or an urge to be the best, among the righteous&lt;br /&gt;
darpahaa: the destroyer of pride in evil-minded people&lt;br /&gt;
deeptamoortir: of resplendent form&lt;br /&gt;
devabhrit-guruh: advisor of indra&lt;br /&gt;
devah: he who revels&lt;br /&gt;
devakee-nandanah: son of devaki&lt;br /&gt;
deveshah: the lord of all devas&lt;br /&gt;
dhaama: the goal&lt;br /&gt;
dhaataa: he who supports all fields of experience&lt;br /&gt;
dhaaturuttamah: the subtlest atom&lt;br /&gt;
dhananjayah: one who gained wealth through conquest&lt;br /&gt;
dhaneshvarah: the lord of wealth&lt;br /&gt;
dhanurdharah: the wielder of the bow&lt;br /&gt;
dhanurvedah: one who declared the science of archery&lt;br /&gt;
dhanvee: he who always has a divine bow&lt;br /&gt;
dhanyah: fortunate&lt;br /&gt;
dharaadharah: the sole support of the earth&lt;br /&gt;
dharaneedharah: he who supports the earth&lt;br /&gt;
dharma-yoopah: the post to which all dharma is tied&lt;br /&gt;
dharmaadhyakshah: he who presides over dharma&lt;br /&gt;
dharmagub: one who protects dharma&lt;br /&gt;
dharmah: the law of being&lt;br /&gt;
dharmakrit: one who acts according to dharma&lt;br /&gt;
dharmaviduttamah: the highest among men of realisation&lt;br /&gt;
dharmee: the supporter of dharma&lt;br /&gt;
dhritaatmaa: established in himself&lt;br /&gt;
dhruvah: the changeless in the midst of changes&lt;br /&gt;
dhuryah: who carries out creation etc without hitch&lt;br /&gt;
dishah: one who advises and gives knowledge&lt;br /&gt;
divah-sprik: sky-reaching&lt;br /&gt;
dravinapradah: one who lavishly gives wealth&lt;br /&gt;
dridhah: the firm&lt;br /&gt;
driptah: one whio is drunk with infinite bliss&lt;br /&gt;
duh-svapna-naashanah: one who destroys all bad dreams&lt;br /&gt;
duraadharshah: he who cannot be attacked successfully&lt;br /&gt;
duraarihaa: slayer of the asuras&lt;br /&gt;
duraavaasah: not easy to lodge&lt;br /&gt;
duratikramah: one who is difficult to be disobeyed&lt;br /&gt;
durdharah: the object of contemplation&lt;br /&gt;
durdurdharah: he who cannot be known by great yogis 267) vaagmee: he who is eloquent in speech&lt;br /&gt;
durgah: not easy to storm into&lt;br /&gt;
durgamah: one who is realised with great effort&lt;br /&gt;
durjayah: the invincible&lt;br /&gt;
durlabhah: one who obtained with effort&lt;br /&gt;
durmarshanah: he who cannot be vanquished&lt;br /&gt;
dushkritihaa: destroyer of bad actions&lt;br /&gt;
dyutidharah: one who bears an effulgent form&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;e&amp;quot;)"&gt;e (6)&lt;/a&gt;&lt;div id="e" style="display: none;"&gt;eeshanah: the controller of the five great elements&lt;br /&gt;
eeshvarah: he who can do anything without any help&lt;br /&gt;
eeshvarah: the contoller&lt;br /&gt;
ekaatmaa: the one self&lt;br /&gt;
ekah: the one&lt;br /&gt;
ekapaat: one-footed &lt;br /&gt;
&lt;/div&gt;f (0)&lt;br /&gt;
&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;g&amp;quot;)"&gt;g (25)&lt;/a&gt;&lt;div id="g" style="display: none;"&gt;gabhastinemih: the hub of the universal wheel&lt;br /&gt;
gabheeraatmaa: too deep to be fathomed&lt;br /&gt;
gabheerah: the unfathomable&lt;br /&gt;
gadaadharah: carrier of kaumodakee club&lt;br /&gt;
gadaagrajah: one who is invoked through mantra&lt;br /&gt;
gahanah: the unknowable&lt;br /&gt;
gahano: impenetrable&lt;br /&gt;
garudadhvajah: one who has garuda on his flag&lt;br /&gt;
gatisattamah: the ultimate refuge for all devotees&lt;br /&gt;
ghritaaseeh: one who has no need for good wishes&lt;br /&gt;
gohitah: one who does welfare for cows&lt;br /&gt;
gopatih: husband of the earth&lt;br /&gt;
gopatih: the shepherd&lt;br /&gt;
goptaa: protector of the universe&lt;br /&gt;
goptaa: the protector&lt;br /&gt;
govidaam-patih: the lord of all men of wisdom&lt;br /&gt;
govindah: one who is known through vedanta&lt;br /&gt;
govindah: the protector of the cows&lt;br /&gt;
graamaneeh: he who leads the flock&lt;br /&gt;
guhah: he who dwells in the cave of the heart&lt;br /&gt;
guhyo: the mysterious&lt;br /&gt;
gunabhrit: one who supports&lt;br /&gt;
guptah: the well-concealed&lt;br /&gt;
guruh: the teacher&lt;br /&gt;
gurutamah: the greatest teacher&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;h&amp;quot;)"&gt;h (13)&lt;/a&gt;&lt;div id="h" style="display: none;"&gt;halaayudhah: one who has a plough as his weapon&lt;br /&gt;
hamsah: the swan&lt;br /&gt;
harih: the destroyer&lt;br /&gt;
havih: the oblation&lt;br /&gt;
havirharih: the receiver of all oblation&lt;br /&gt;
hemaangah: one who has limbs of gold&lt;br /&gt;
hetuh: the cause&lt;br /&gt;
hiranyagarbhah: he who dwells in the womb of the world&lt;br /&gt;
hiranyagarbhah: the creator&lt;br /&gt;
hiranyanaabhah: he who has a golden navel&lt;br /&gt;
hrisheekeshah: the lord of the senses&lt;br /&gt;
hutabhuk: one who accepts oblations&lt;br /&gt;
hutabhuk: one who enjoys all that is offered in yajna&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;i&amp;quot;)"&gt;i (3)&lt;/a&gt;&lt;br /&gt;
&lt;div id="i" style="display: none;"&gt;ijyah: he who is fit to be invoked through yajna&lt;br /&gt;
indrakarmaa: one who always performs gloriously auspicious actions&lt;br /&gt;
ishtah: he who is invoked through vedic rituals&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;j&amp;quot;)"&gt;j (22)&lt;/a&gt;&lt;div id="j" style="display: none;"&gt;jagadaadijah: born at the beginning of the world&lt;br /&gt;
jagatas-setuh: a bridge across the material energy&lt;br /&gt;
jahnuh: leader of men&lt;br /&gt;
jana-janmaadir: the cause of the birth of all creatures&lt;br /&gt;
janaardanah: he who gives joy to good people&lt;br /&gt;
jananah: he who delivers all living creatures&lt;br /&gt;
janeshvarah: the lord of the people&lt;br /&gt;
janma-mrityu-jaraatigah: one who knows no birth, death or old age in himself&lt;br /&gt;
jayah: the victorious&lt;br /&gt;
jayantah: the conquerer of all enemies&lt;br /&gt;
jeevah: one who functions as the ksetrajna&lt;br /&gt;
jeevanah: the life spark in all creatures&lt;br /&gt;
jetaa: ever-successful&lt;br /&gt;
jita-krodhah: one who has conquered anger&lt;br /&gt;
jitaamitrah: one who has conquered all enemies&lt;br /&gt;
jitamanyuh: one who has no anger&lt;br /&gt;
jnaanagamyah: one who is experienced through pure knowledge&lt;br /&gt;
jnaanamuttamam: the supreme knowledge&lt;br /&gt;
jyeshthah: older than all&lt;br /&gt;
jyotih: self-effulgent&lt;br /&gt;
jyotir-ganeshvarah: lord of the luminaries in the cosmos&lt;br /&gt;
jyotiraadityah: the resplendence of the sun&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;k&amp;quot;)"&gt;k (58)&lt;/a&gt;&lt;div id="k" style="display: none;"&gt;kaalah: he who judges and punishes beings&lt;br /&gt;
kaalanemi-nihaa: slayer of kalanemi&lt;br /&gt;
kaamadevah: the beloved lord&lt;br /&gt;
kaamah: the beloved&lt;br /&gt;
kaamahaa: he who destroys all desires&lt;br /&gt;
kaamakrit: he who fulfills all desires&lt;br /&gt;
kaamapaalah: the fulfiller of desires&lt;br /&gt;
kaamapradah: he who supplies desired objects&lt;br /&gt;
kaamee: one who has fulfilled all his desires&lt;br /&gt;
kaantah: he who is of enchanting form&lt;br /&gt;
kaantah: of enchanting form&lt;br /&gt;
kaaranam: the cause&lt;br /&gt;
kah: one who is of the nature of bliss&lt;br /&gt;
kanakaangadee: wearer of bright-as-gold armlets&lt;br /&gt;
kapeendrah: lord of the monkeys (rama)&lt;br /&gt;
kapih: one who drinks water&lt;br /&gt;
kapilah: the great sage kapila&lt;br /&gt;
karanam: the instrument&lt;br /&gt;
kartaa: the doer&lt;br /&gt;
kathitah: one who is glorified in all scriptures&lt;br /&gt;
kavih: the seer&lt;br /&gt;
keshavah: he who has beautiful locks of hair&lt;br /&gt;
keshavah: one whose rays illumine the cosmos&lt;br /&gt;
keshihaa: killer of kesi&lt;br /&gt;
khanda-parashur: one who holds an axe&lt;br /&gt;
kim: what (the one to be inquired into)&lt;br /&gt;
kramah: all-pervading&lt;br /&gt;
kratuh: the animal-sacrifice&lt;br /&gt;
krishah: delicate, lean&lt;br /&gt;
krishnah: dark-complexioned&lt;br /&gt;
krishno: he whose complexion is dark&lt;br /&gt;
krita-akritah: all that is created and not created&lt;br /&gt;
kritaagamah: author of the vedas&lt;br /&gt;
kritaagamah: the author of the agama scriptures&lt;br /&gt;
kritaantakrit: destroyer of the creation&lt;br /&gt;
kritajnah: he who knows all that is&lt;br /&gt;
kritajnah: the knower of the creation&lt;br /&gt;
kritakarmaa: one who has fulfilled his acts&lt;br /&gt;
kritalakshanah: one who is famous for his qualities&lt;br /&gt;
kritih: he who rewards all our actions&lt;br /&gt;
krodhahaa: he who destroys anger&lt;br /&gt;
krodhakrit-kartaa: he who generates anger against the lower tendency&lt;br /&gt;
kshaamah: he who ever remains without any scarcity&lt;br /&gt;
kshaamah: one who destroys everything&lt;br /&gt;
kshamah: he who is supremely efficient in all undertakings&lt;br /&gt;
kshaminaam-varah: one who has the greatest amount of patience with sinners&lt;br /&gt;
ksharam: he who appears to perish&lt;br /&gt;
kshemakrit: doer of good&lt;br /&gt;
kshetrajnah: the knower of the field&lt;br /&gt;
kshiteeshah: the lord of the earth&lt;br /&gt;
kshobhanah: the agitator&lt;br /&gt;
kumbhah: the pot within whom everything is contained&lt;br /&gt;
kumudah: he who delights in the earth&lt;br /&gt;
kumudah: one who gladdens the earth&lt;br /&gt;
kundah: one who is as attractive as kunda flowers&lt;br /&gt;
kundalee: one who wears shark earrings&lt;br /&gt;
kundarah: the one who lifted the earth&lt;br /&gt;
kuvaleshayah: he who reclines in the waters&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;l&amp;quot;)"&gt;l (10)&lt;/a&gt;&lt;div id="l" style="display: none;"&gt;lakshmeeh: the glory of the universe&lt;br /&gt;
lakshmeevaan: the consort of laksmi&lt;br /&gt;
lohitaakshah: red-eyed&lt;br /&gt;
loka-trayaashrayah: shelter of the three worlds&lt;br /&gt;
lokaadhishthaanam: the substratum of the universe&lt;br /&gt;
lokaadhyakshah: he who presides over all lokas&lt;br /&gt;
lokabandhur: friend of the world&lt;br /&gt;
lokanaathah: lord of the world&lt;br /&gt;
lokasaarangah: one who understands the universe&lt;br /&gt;
lokasvaamee: lord of the universe&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;m&amp;quot;)"&gt;m (64)&lt;/a&gt;&lt;div id="m" style="display: none;"&gt;maadhavah: born in the family of madhu&lt;br /&gt;
maadhavah: husband of lakshmi&lt;br /&gt;
maadhavo: the lord of all knowledge&lt;br /&gt;
maanadah: one who causes, by his maya, false identification with the body&lt;br /&gt;
maanyah: one who is to be honoured&lt;br /&gt;
maargah: the path&lt;br /&gt;
madhuh: sweet&lt;br /&gt;
madhusoodanah: destroyer of the madhu demon&lt;br /&gt;
mahaa-dyutih: greatly luminous&lt;br /&gt;
mahaa-makhah: the great sacrificer&lt;br /&gt;
mahaa-shaktih: all-powerful&lt;br /&gt;
mahaa-veeryah: the supreme essence&lt;br /&gt;
mahaabalah: he who has supreme strength&lt;br /&gt;
mahaabhaago: he who gets the greates share in every yajna&lt;br /&gt;
mahaabhogah: he who is of the nature of enjoyment&lt;br /&gt;
mahaabhootah: the great being&lt;br /&gt;
mahaabuddhir: he who has supreme intelligence&lt;br /&gt;
mahaadevah: the great deity&lt;br /&gt;
mahaadhanah: he who is supremely rich&lt;br /&gt;
mahaadri-dhrik: he who supports the great mountain&lt;br /&gt;
mahaagartah: the great chasm&lt;br /&gt;
mahaahavih: the great offering&lt;br /&gt;
mahaahradah: one who is like a great refreshing swimming pool&lt;br /&gt;
mahaakarmaa: one who accomplishes great acts&lt;br /&gt;
mahaakarmaa: one who performs great deeds&lt;br /&gt;
mahaakoshah: he who has got around him great sheaths&lt;br /&gt;
mahaakramo: of great step&lt;br /&gt;
mahaakratuh: the great sacrifice&lt;br /&gt;
mahaakshah: the great-eyed&lt;br /&gt;
mahaamanaah: great-minded&lt;br /&gt;
mahaamayo: the supreme master of all maayaa&lt;br /&gt;
mahaamortir: the great form&lt;br /&gt;
mahaan: the mighty&lt;br /&gt;
mahaanidhih: the great abode&lt;br /&gt;
mahaarhah: one who deserves the highest worship&lt;br /&gt;
mahaashringah: great-horned (matsya)&lt;br /&gt;
mahaasvanah: he who has a thundering voice&lt;br /&gt;
mahaatapaah: he of great tapas&lt;br /&gt;
mahaatejaah: one of great resplendence&lt;br /&gt;
mahaavaraaho: the great boar&lt;br /&gt;
mahaayajnah: the great yajna&lt;br /&gt;
mahaayajvaa: one who performed great yajnas&lt;br /&gt;
maharddhi: one who has great prosperity&lt;br /&gt;
maharshih kapilaachaaryah: he who incarnated as kapila, the great sage&lt;br /&gt;
maheebhartaa: the husband of mother earth&lt;br /&gt;
maheedharah: the bearer of the earth&lt;br /&gt;
maheedharah: the support of the earth&lt;br /&gt;
mahejyah: one who is to be most worshiped&lt;br /&gt;
mahendrah: the lord of indra&lt;br /&gt;
maheshvaasah: he who wields shaarnga&lt;br /&gt;
mahodadhishayah: one who rests on the great ocean&lt;br /&gt;
mahoragah: the great serpent&lt;br /&gt;
mahotsaaho: the great enthusiast&lt;br /&gt;
mangalam param: the supreme auspiciousness&lt;br /&gt;
manoharah: the stealer of the mind&lt;br /&gt;
manojavah: swift as the mind&lt;br /&gt;
mantrah: the nature of the vedic mantras&lt;br /&gt;
manuh: he who has manifested as the vedic mantras&lt;br /&gt;
mareechih: effulgence&lt;br /&gt;
medhaavee: supremely intelligent&lt;br /&gt;
medhajah: born out of sacrifices&lt;br /&gt;
medineepatih: the lord of the earth&lt;br /&gt;
muktaanaam paramaa gatih: the final goal, reached by liberated souls&lt;br /&gt;
mukundah: the giver of liberation&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;n&amp;quot;)"&gt;n (33)&lt;/a&gt;&lt;br /&gt;
&lt;div id="n" style="display: none;"&gt;naaraayanah: he who resides on the waters&lt;br /&gt;
naarasimha-vapuh: he whose form is man-lion&lt;br /&gt;
nahushah: he who binds all with maya&lt;br /&gt;
naika-roopo: he who has unlimited forms&lt;br /&gt;
naikaatmaa: many souled&lt;br /&gt;
naikah: the many&lt;br /&gt;
naikajah: one who is born many times&lt;br /&gt;
naikakarmakrit: one who does many actions&lt;br /&gt;
naikamaayah: he whose forms are endless and varied 303) mahaashanah: he who eats up everything&lt;br /&gt;
naikashringah: one who has many horns&lt;br /&gt;
nakshatranemir: the nave of the stars&lt;br /&gt;
nakshatree: the lord of the stars (the moon)&lt;br /&gt;
nandah: free from all worldly pleasures&lt;br /&gt;
nandakee: one who holds the nandaka sword&lt;br /&gt;
nandanah: one who makes others blissful&lt;br /&gt;
nandih: infinite bliss&lt;br /&gt;
narah: the guide&lt;br /&gt;
nayah: one who leads&lt;br /&gt;
netaa: the leader&lt;br /&gt;
neyah: the guide&lt;br /&gt;
nidhir-avyayah: the imperishable treasure&lt;br /&gt;
nigrahah: the killer&lt;br /&gt;
nimishah: he who has closed eyes in contemplation&lt;br /&gt;
nirgunah: without any properties&lt;br /&gt;
nirvaanam: all-bliss&lt;br /&gt;
nishthaa: abode of all beings&lt;br /&gt;
nivritaatmaa: the soul retreated from matter&lt;br /&gt;
nivrittaatmaa: one who is fully restrained from all sense indulgences&lt;br /&gt;
nivrittaatmaa: one whose mind is turned away from sense indulgence&lt;br /&gt;
niyamah: one who is not under anyone's laws&lt;br /&gt;
niyamo: the appointing authority&lt;br /&gt;
nyaayah: justice&lt;br /&gt;
nyagrodhah: the one who veils himself with maya&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;o&amp;quot;)"&gt;o (4)&lt;/a&gt;&lt;br /&gt;
&lt;div id="o" style="display: none;"&gt;ojas-tejo-dyutidharah: the possessor of vitality, effulgence and beauty&lt;br /&gt;
oordhvagah: one who is on top of everything&lt;br /&gt;
oorjita-shaasanah: one who commands with his hand&lt;br /&gt;
oorjitah: he who has infinite vitality&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;p&amp;quot;)"&gt;p (81)&lt;/a&gt;&lt;div id="p" style="display: none;"&gt;paapa-naashanah: destroyer of sin&lt;br /&gt;
paavanah: he who gives life-sustaining power to air&lt;br /&gt;
paavanah: one who ever purifies&lt;br /&gt;
padam-anuttamam: the unequalled state of perfection&lt;br /&gt;
padmagarbhah: he who is being meditated upon in the lotus of the heart&lt;br /&gt;
padmanaabhah: he from whose navel comes the lotus&lt;br /&gt;
padmanaabhah: he who has a lotus-navel&lt;br /&gt;
padmanaabhah: he whose navel is like a lotus&lt;br /&gt;
padmanibhekshanah: lotus-eyed&lt;br /&gt;
padmee: he who holds a lotus&lt;br /&gt;
panah: the supreme universal manager&lt;br /&gt;
paraayanam: the way to liberation&lt;br /&gt;
paramaatmaa: the supersoul&lt;br /&gt;
paramaspashtah: the extremely vivid&lt;br /&gt;
parameshthee: one who is readily available for experience within the heart&lt;br /&gt;
parameshvarah: the supreme lord&lt;br /&gt;
pararddhih: he who has supreme manifestations&lt;br /&gt;
parigrahah: the receiver&lt;br /&gt;
parjanyah: he who is similar to rain-bearing clouds&lt;br /&gt;
paryavasthitah: one who dwells everywhere&lt;br /&gt;
pavanah: the air that fills the universe&lt;br /&gt;
pavitram: he who gives purity to the heart&lt;br /&gt;
peshalah: one who is supremely soft&lt;br /&gt;
poorayitaa: the fulfiller&lt;br /&gt;
poornah: the complete&lt;br /&gt;
pootaatmaa: he with an extremely pure essence&lt;br /&gt;
praagvamshah: one who has the most ancient ancestry&lt;br /&gt;
praamshuh: he with a huge body&lt;br /&gt;
praanadah: giver of life&lt;br /&gt;
praanadah: he who gives life&lt;br /&gt;
praanadah: he who gives prana&lt;br /&gt;
praanah: life&lt;br /&gt;
praanah: the prana in all living creatures&lt;br /&gt;
praanajeevanah: he who maintains the life-breath in all living creatures&lt;br /&gt;
praananilayah: he in whom all prana is established&lt;br /&gt;
praanibhrit: he who rules over all pranas&lt;br /&gt;
praano: he who ever lives&lt;br /&gt;
prabhavah: the womb of the five great elements&lt;br /&gt;
prabhootas: ever-full&lt;br /&gt;
prabhuh: the almighty lord&lt;br /&gt;
prabhuh: the lord&lt;br /&gt;
pradhaana-purusheshvarah: lord of pradhaana and purusha&lt;br /&gt;
pradyumnah: very rich&lt;br /&gt;
pragrahah: receiver of worship&lt;br /&gt;
prajaa-bhavah: he from whom all praja comes&lt;br /&gt;
prajaagarah: ever-awakened&lt;br /&gt;
prajaapatih: he from whom all creatures emerge&lt;br /&gt;
prajaapatih: the lord of all creatures&lt;br /&gt;
prakaashaatmaa: the effulgent self&lt;br /&gt;
prakaashanah: he who illuminates&lt;br /&gt;
pramaanam: he whose form is the vedas&lt;br /&gt;
pramaanam: the proof&lt;br /&gt;
pramodanah: ever-blissful&lt;br /&gt;
pranavah: he who is praised by the gods&lt;br /&gt;
pranavah: omkara&lt;br /&gt;
prapitaamahah: the father of the father of beings (brahma)&lt;br /&gt;
prasanaatmaa: ever pure and all-blissful self&lt;br /&gt;
prataapanah: thermal energy; one who heats&lt;br /&gt;
pratardanah: the supreme destruction&lt;br /&gt;
prathitah: he who exists pervading all&lt;br /&gt;
pratyayah: he whose nature is knowledge&lt;br /&gt;
preetivardhanah: one who increases joy in the devotee's heart&lt;br /&gt;
prituh: the expanded&lt;br /&gt;
priyaarhah: one who deserves all our love&lt;br /&gt;
priyakrit: one who is ever-obliging in fulfilling our wishes&lt;br /&gt;
pundareekaakshah: he who dwells in the heart&lt;br /&gt;
punya-keertir: of holy fame&lt;br /&gt;
punya-shravana-keertanah: the hearing of whose glory causes holiness to grow&lt;br /&gt;
punyah: supremely pure&lt;br /&gt;
punyah: the truly holy&lt;br /&gt;
puraatanah: he who was even before time&lt;br /&gt;
purandarah: destroyer of cities&lt;br /&gt;
purujit: one who has conquered numerous enemies&lt;br /&gt;
purusattamah: the greatest of the great&lt;br /&gt;
purushah: he who dwells in the city of nine gates&lt;br /&gt;
purushah: one who dwells in all bodies&lt;br /&gt;
purushottamah: the supreme controller&lt;br /&gt;
pushkaraakshah: he who has eyes like the lotus&lt;br /&gt;
pushkaraakshah: lotus eyed&lt;br /&gt;
pushpahaasah: he who shines like an opening flower&lt;br /&gt;
pushtah: one who is ever-full&lt;br /&gt;
&lt;/div&gt;q (0)&lt;br /&gt;
&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;r&amp;quot;)"&gt;r (14)&lt;/a&gt;&lt;div id="r" style="display: none;"&gt;raamah: one who is most handsome&lt;br /&gt;
rakshanah: protector of the universe&lt;br /&gt;
ranapriyah: lover of battles&lt;br /&gt;
rathaanga-paanih: one who has the wheel of a chariot as his weapon&lt;br /&gt;
ratna-naabhah: of beautiful navel&lt;br /&gt;
ratnagarbhah: the jewel-wombed&lt;br /&gt;
ravih: one who dries up everything&lt;br /&gt;
ravilochanah: one whose eye is the sun&lt;br /&gt;
riddhah: full of prosperity&lt;br /&gt;
riddhah: he who has expanded himself as the universe&lt;br /&gt;
rituh: the seasons&lt;br /&gt;
rohitah: the fish incarnation&lt;br /&gt;
ruchiraangadah: one who wears resplendent shoulder caps&lt;br /&gt;
rudrah: he who makes all people weep&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;s&amp;quot;)"&gt;s (243)&lt;/a&gt;&lt;div id="s" style="display: none;"&gt;saadhur: he who lives by the righteous codes&lt;br /&gt;
saakshee: the witness&lt;br /&gt;
saama: the sama veda&lt;br /&gt;
saamagaayanah: one who sings the sama songs&lt;br /&gt;
saamagah: the singer of the sama songs&lt;br /&gt;
saattvikah: one who is full of sattvic qualities&lt;br /&gt;
saatvataam-patih: the lord of the satvatas&lt;br /&gt;
sadaa-yogee: always in yoga&lt;br /&gt;
sadaamarshee: one who forgives the trespasses of his devotees&lt;br /&gt;
sadbhootih: one who has rich glories&lt;br /&gt;
sadgatih: the goal of good people&lt;br /&gt;
sahah: all-enduring&lt;br /&gt;
sahasra-moordhaa: he who has endless heads&lt;br /&gt;
sahasraakshah: thousands of eyes&lt;br /&gt;
sahasraamshur: the thousand-rayed&lt;br /&gt;
sahasraarchih: he who has thousands of rays&lt;br /&gt;
sahasrajit: he who vanquishes thousands&lt;br /&gt;
sahasrapaat: thousand-footed&lt;br /&gt;
sahishnuh: he who can suffer patiently&lt;br /&gt;
sahishnuh: one who calmly endures duality&lt;br /&gt;
sam-pramardanah: he who persecutes evil men&lt;br /&gt;
samaatmaa: he who is the same in all&lt;br /&gt;
samaavartah: the efficient turner&lt;br /&gt;
samah: calm&lt;br /&gt;
samah: equal&lt;br /&gt;
samayajnah: one whose worship is nothing more than keeping an equal vision of the mind by the devotee&lt;br /&gt;
sambhavah: he who descends of his own free will&lt;br /&gt;
sameehanah: one whose desires are auspicious&lt;br /&gt;
sameeranah: he who sufficiently administers all movements of all living creatures&lt;br /&gt;
samgrahah: he who holds everything together&lt;br /&gt;
samitinjayah: ever-victorious&lt;br /&gt;
samkha-bhrit: one who has the divine pancajanya&lt;br /&gt;
samksheptaa: the involver&lt;br /&gt;
sammitah: he who has been accepted by authorities&lt;br /&gt;
samnyaasa-krit: institutor of sannyasa&lt;br /&gt;
samsthaanah: the ultimate authority&lt;br /&gt;
samvatsarah: he from whom the concept of time comes&lt;br /&gt;
samvatsarah: the year&lt;br /&gt;
samvritah: he who is vieled from the jiva&lt;br /&gt;
sanaat: the beginningless and endless factor&lt;br /&gt;
sanaatanatamah: the most ancient&lt;br /&gt;
sandhaataa: the regulator&lt;br /&gt;
sandhimaan: he who seems to be conditioned&lt;br /&gt;
sankarshanochyutah: he who absorbs the whole creation into his nature and never falls away from that nature&lt;br /&gt;
sannivaasah: the abode of the good&lt;br /&gt;
santah: one who is expressed through saintly men&lt;br /&gt;
saptaidhaah: the seven effulgences in the flames&lt;br /&gt;
saptajihvah: he who expresses himself as the seven tongues of fire (types of agni)&lt;br /&gt;
saptavaahanah: one who has a vehicle of seven horses (sun)&lt;br /&gt;
sargah: he who creates the world from himself&lt;br /&gt;
sarva-drik: the seer of everything&lt;br /&gt;
sarva-lakshana-lakshanyah: known through all proofs&lt;br /&gt;
sarva-praharanaayudhah: he who has all implements for all kinds of assault and fight&lt;br /&gt;
sarva-shastra-bhritaam-varah: the best among those who wield weapons&lt;br /&gt;
sarva-vaageeshvareshvarah: lord of the lord of speech&lt;br /&gt;
sarva-yoga-vinissritah: he who is free from all attachments&lt;br /&gt;
sarvaadih: the beginning of all&lt;br /&gt;
sarvaasunilayah: the abode of all life energies&lt;br /&gt;
sarvadarshanah: all-seeing&lt;br /&gt;
sarvadarshee: all-knower&lt;br /&gt;
sarvadrik-vyaaso: one who creates many men of wisdom&lt;br /&gt;
sarvagah: all-pervading&lt;br /&gt;
sarvah: he who is everything&lt;br /&gt;
sarvajna: omniscient&lt;br /&gt;
sarvajno: omniscient&lt;br /&gt;
sarvakaamadah: one who fulfils all desires of true devotees&lt;br /&gt;
sarvasahah: one who carries the entire universe&lt;br /&gt;
sarvatah-chakshuh: one who has eyes everywhere&lt;br /&gt;
sarvato-mukhah: one who has his face turned everywhere&lt;br /&gt;
sarvavid-bhaanuh: all-knowing and effulgent&lt;br /&gt;
sarvavij-jayee: one who is at once omniscient and victorious&lt;br /&gt;
sarveshvarah: controller of all&lt;br /&gt;
sat-keertih: one of pure fame&lt;br /&gt;
sat: existence&lt;br /&gt;
sataam gatih: the goal for all virtuous people&lt;br /&gt;
sataam-gatih: refuge of the good&lt;br /&gt;
sataavarttah: he who takes infinite forms&lt;br /&gt;
satkartaa: he who adores good and wise people&lt;br /&gt;
satkritah: he who is adored by all good people&lt;br /&gt;
satkritih: one who is full of good actions&lt;br /&gt;
satparaayanah: the supreme goal for the good&lt;br /&gt;
satpathaachaarah: one who walks the path of truth&lt;br /&gt;
satram: protector of the good&lt;br /&gt;
satta: one without a second&lt;br /&gt;
sattvasthah: situated in sattva&lt;br /&gt;
sattvavaan: one who is full of exploits and courage&lt;br /&gt;
satya-dharma-paraakramah: one who champions heroically for truth and righteousness&lt;br /&gt;
satya-dharma-paraayanah: one who is the very abode of truth and dharma&lt;br /&gt;
satya-paraakramah: dynamic truth&lt;br /&gt;
satyadharmaa: one who has in himself all true dharmas&lt;br /&gt;
satyah: he who is himself the truth&lt;br /&gt;
satyah: the truth&lt;br /&gt;
satyah: truth&lt;br /&gt;
satyamedhah: one whose intelligence never fails&lt;br /&gt;
satyasandhah: of truthful resolution&lt;br /&gt;
savah: the nature of the sacrifice&lt;br /&gt;
savitaa: the father of all&lt;br /&gt;
savitaa: the one who brings forth the universe from himself&lt;br /&gt;
shaantah: peaceful within&lt;br /&gt;
shaantidah: giver of peace&lt;br /&gt;
shaantih: one whose very nature is peace&lt;br /&gt;
shaarnga-dhanvaa: one who aims his shaarnga bow&lt;br /&gt;
shaashvata-sthirah: one who is eternal and stable&lt;br /&gt;
shaashvatah-sthaanur: permanent and immovable&lt;br /&gt;
shaashvatah: he who always remains the same&lt;br /&gt;
shaastaa: he who rules over the universe&lt;br /&gt;
shabdaatigah: one who transcends all words&lt;br /&gt;
shabdasahah: one who allows himself to be invoked by vedic declarations&lt;br /&gt;
shaktimataam-shresthah: the best among the powerful&lt;br /&gt;
shambhuh: he who brings auspiciousness&lt;br /&gt;
sharabhah: one who dwells and shines forth through the bodies&lt;br /&gt;
sharanam: the refuge&lt;br /&gt;
shareera-bhootabhrit: one who nourishes the nature from which the bodies came&lt;br /&gt;
shareerabhrit: he who sustains all bodies&lt;br /&gt;
sharma: he who is himself infinite bliss&lt;br /&gt;
sharvaree-karah: creator of darkness&lt;br /&gt;
sharvas: the auspicious&lt;br /&gt;
shashabindhuh: the moon who has a rabbit-like spot 286) sureshvarah: a person of extreme charity&lt;br /&gt;
shataananah: many-faced&lt;br /&gt;
shataanandah: of infinite varieties and joys&lt;br /&gt;
shatamoortih: of many forms&lt;br /&gt;
shatrughnah: the destroyer of enemies&lt;br /&gt;
shatrujit: one who is ever victorious over his hosts of enemies&lt;br /&gt;
shatrutaapanah: the scorcher of enemies&lt;br /&gt;
shauri: one who always has invincible prowess&lt;br /&gt;
shaurih: he who incarnated in the dynasty of shoora&lt;br /&gt;
shikhandee: he who wears a peacock feather&lt;br /&gt;
shipivishtah: the presiding deity of the sun&lt;br /&gt;
shishirah: the cold season, winter&lt;br /&gt;
shishta-krit: the law-maker&lt;br /&gt;
shivah: auspiciousness&lt;br /&gt;
shivah: he who is eternally pure&lt;br /&gt;
shoka-naashanah: destroyer of sorrows&lt;br /&gt;
shoonyah: the void&lt;br /&gt;
shoora-janeshvarah: lord of the valiant&lt;br /&gt;
shoorah: the valiant&lt;br /&gt;
shoorasenah: one who has heroic and valiant armies&lt;br /&gt;
shramanah: one who persecutes the worldly people&lt;br /&gt;
shrashtaa: creator of all beings&lt;br /&gt;
shreedah: giver of opulence&lt;br /&gt;
shreedharah: holder of sree&lt;br /&gt;
shreegarbhah: he in whom are all glories&lt;br /&gt;
shreekarah: one who gives sree&lt;br /&gt;
shreemaan: he who is always courted by glories&lt;br /&gt;
shreemaan: he who is always with shree&lt;br /&gt;
shreemaan: possessor of sree&lt;br /&gt;
shreemaan: the possessor of light, effulgence, glory&lt;br /&gt;
shreemataam varah: the best among glorious&lt;br /&gt;
shreenidhih: the treasure of sree&lt;br /&gt;
shreenivaasah: one who dwells in the good people&lt;br /&gt;
shreenivaasah: the permanent abode of shree&lt;br /&gt;
shreepatih: lord of laksmi&lt;br /&gt;
shreeshah: the lord of sree&lt;br /&gt;
shreevatsa-vakshaah: one who has sreevatsa on his chest&lt;br /&gt;
shreevibhaavanah: distributor of sree&lt;br /&gt;
shreshthah: the most glorious&lt;br /&gt;
shrevaasah: abode of sree&lt;br /&gt;
shreyah: liberation&lt;br /&gt;
shringee: the horned one&lt;br /&gt;
shruti-saagarah: the ocean for all scripture&lt;br /&gt;
shubhaangah: one who has the most beautiful form&lt;br /&gt;
shubhaangah: one with enchanting limbs&lt;br /&gt;
shubhekshanah: all-auspicious gaze&lt;br /&gt;
shuchi-shravaah: he who has beautiful, sacred names&lt;br /&gt;
shuchih: he who is pure&lt;br /&gt;
shuchih: he who is spotlessly clean&lt;br /&gt;
siddhaarthah: he who has all arthas&lt;br /&gt;
siddhah: one who is perfection&lt;br /&gt;
siddhah: the most famous&lt;br /&gt;
siddhasankalpah: he who gets all he wishes for&lt;br /&gt;
siddhidah: the giver of benedictions&lt;br /&gt;
siddhih: he who gives moksha&lt;br /&gt;
siddhisaadhanah: the power behind our sadhana&lt;br /&gt;
simhah: he who destroys&lt;br /&gt;
simhah: the lion&lt;br /&gt;
sishteshtah: the greatest beloved&lt;br /&gt;
skanda-dharah: upholder of withering righteousness&lt;br /&gt;
skandah: he whose glory is expressed through subrahmanya&lt;br /&gt;
somah: one who as the moon nourishes plants&lt;br /&gt;
somapah: one who takes soma in the yajnas&lt;br /&gt;
sookshmah: the subtlest&lt;br /&gt;
sooryah: the one source from where everything is born&lt;br /&gt;
spashtaaksharo: one who is indicated by om&lt;br /&gt;
sragvee: he who always wears a garland of undecaying flowers&lt;br /&gt;
srashtaa: creator&lt;br /&gt;
stavapriyah: one who is invoked through prayer&lt;br /&gt;
stavyah: one who is the object of all praise&lt;br /&gt;
sthaanadah: he who confers the right abode&lt;br /&gt;
sthaanuh: the pillar, the immovable truth&lt;br /&gt;
sthaavarah-sthaanuh: the firm and motionless&lt;br /&gt;
sthaviro dhruvah: the ancient, motionless one&lt;br /&gt;
sthavishtah: the supremely gross&lt;br /&gt;
sthavishthah: one who is supremely huge&lt;br /&gt;
sthirah: steady&lt;br /&gt;
sthoolah: one who is the fattest&lt;br /&gt;
stotaa: one who adores or praises&lt;br /&gt;
stotram: the hymn&lt;br /&gt;
stutih: the act of praise&lt;br /&gt;
subhujah: he who has graceful arms&lt;br /&gt;
sudarshanah: he whose meeting is auspicious&lt;br /&gt;
sudhanvaa: one who has shaarnga&lt;br /&gt;
sughoshah: of auspicious sound&lt;br /&gt;
suhrit: friend of all creatures&lt;br /&gt;
sukhadah: giver of bliss to those who are liberated&lt;br /&gt;
sukhadah: giver of happiness&lt;br /&gt;
sulabhah: one who is readily available&lt;br /&gt;
sulochanah: one who has the most enchanting eyes&lt;br /&gt;
sumedhaa: one who has pure intelligence&lt;br /&gt;
sumukhah: one who has a charming face&lt;br /&gt;
sundah: of great mercy&lt;br /&gt;
sundarah: of unrivalled beauty&lt;br /&gt;
suparnah: beautiful-winged (two birds analogy)&lt;br /&gt;
suparnah: the golden leaf (vedas) bg 15.1&lt;br /&gt;
suprasaadah: fully satisfied&lt;br /&gt;
suraadhyaksho: he who presides over all devas&lt;br /&gt;
suraanando: he who gives out happiness&lt;br /&gt;
suraarihaa: destroyer of the enemies of the devas&lt;br /&gt;
sureshah: the lord of the demigods&lt;br /&gt;
suruchih: whose desire manifests as the universe&lt;br /&gt;
sushenah: he who has a charming army&lt;br /&gt;
sutantuh: beautifully expanded&lt;br /&gt;
sutapaah: he who has glorious tapas&lt;br /&gt;
suvarna-binduh: with limbs radiant like gold&lt;br /&gt;
suvarna-varnah: golden-coloured&lt;br /&gt;
suveerah: one who moves through various ways&lt;br /&gt;
suvratah: he who ever-perfoeming the pure vow&lt;br /&gt;
suvratah: one who has taken the most auspicious forms&lt;br /&gt;
suyaamunah: one who attended by the people who dwell on the banks of yamuna&lt;br /&gt;
svaabhaavyah: ever rooted in the nature of his own self&lt;br /&gt;
svaangah: one with well-proportioned limbs&lt;br /&gt;
svaapanah: one who puts people to sleep&lt;br /&gt;
svaasyah: one who has an effulgent face&lt;br /&gt;
svadhritah: self-supported&lt;br /&gt;
svakshah: beautiful-eyed&lt;br /&gt;
svangah: beautiful-limbed&lt;br /&gt;
svasti: one who is the source of all auspiciouness&lt;br /&gt;
svastibhuk: one who constantly enjoys auspiciousness&lt;br /&gt;
svastidah: giver of svasti&lt;br /&gt;
svastidakshinah: distributor of auspiciousness&lt;br /&gt;
svastikrit: one who robs all auspiciousness&lt;br /&gt;
svavashah: he who has everything under his control&lt;br /&gt;
svayambhooh: he who manifests from himself&lt;br /&gt;
svayamjaatah: self-born&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;t&amp;quot;)"&gt;t (19)&lt;/a&gt;&lt;br /&gt;
&lt;div id="t" style="display: none;"&gt;taarah: he who saves&lt;br /&gt;
taarah: one who helps all to cross over&lt;br /&gt;
taaranah: he who enables others to cross&lt;br /&gt;
tantu-vardhanah: one who sustains the continuity of the drive for the family&lt;br /&gt;
tat: that&lt;br /&gt;
tattvam: the reality&lt;br /&gt;
tattvavit: one who has realised the reality&lt;br /&gt;
teerthakaro: the teacher of the tirthas&lt;br /&gt;
tejovrisho: one who showers radiance&lt;br /&gt;
tridashaadhyaksho: the lord of the three states of consciousness&lt;br /&gt;
trikakub-dhaama: the support of the three quarters&lt;br /&gt;
trilokaatmaa: the self of the three worlds&lt;br /&gt;
trilokadhrik: one who is the support of all the three worlds&lt;br /&gt;
trilokeshah: the lord of the three worlds&lt;br /&gt;
tripadah: one who has taken three steps&lt;br /&gt;
trisaamaa: one who is glorified by devas, vratas and saamans&lt;br /&gt;
trivikramah: one who took three steps&lt;br /&gt;
tushtah: one who is contented with a very simple offering&lt;br /&gt;
tvashtaa: he who makes huge things small&lt;br /&gt;
&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;u&amp;quot;)"&gt;u (8)&lt;/a&gt;&lt;div id="u" style="display: none;"&gt;udbhavah: the originator&lt;br /&gt;
udbhavah: the ultimate source&lt;br /&gt;
udeernah: the great transcendent&lt;br /&gt;
udumbarah: nourishment of all living creatures&lt;br /&gt;
ugrah: the terrible&lt;br /&gt;
upendrah: the younger brother of indra (vaamana)&lt;br /&gt;
uttaaranah: one who lifts us out of the ocean of change&lt;br /&gt;
uttarah: he who lifts us from the ocean of samsara&lt;/div&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;v&amp;quot;)"&gt;v (119)&lt;/a&gt;&lt;div id="v" style="display: none;"&gt;vaachaspatir-ayonijah: one who is the master of all vidyas and who is unborn through a womb&lt;br /&gt;
vaachaspatir-udaara-dheeh: he who is eloquent in championing the supreme law of life; he with a large-hearted intelligence&lt;br /&gt;
vaajasanah: the giver of food&lt;br /&gt;
vaamanah: he with a dwarf body&lt;br /&gt;
vaarunah: the son of varuna (vasistha or agastya)&lt;br /&gt;
vaasavaanujah: the brother of indra&lt;br /&gt;
vaasudevah: dwelling in all creatures although not affected by that condition&lt;br /&gt;
vaasudevah: one who envelops the world with maya&lt;br /&gt;
vaasudevo: the son of vasudeva&lt;br /&gt;
vaayuh: the air&lt;br /&gt;
vaayuvaahanah: controller of winds&lt;br /&gt;
vaayuvaahanah: the mover of the winds&lt;br /&gt;
vahnih: fire&lt;br /&gt;
vaidyah: the supreme doctor&lt;br /&gt;
vaikhaanah: the one who cut through the earth&lt;br /&gt;
vaikunthah: one who prevents men from straying on wrong paths&lt;br /&gt;
vamshavardhanah: he who multiplies his family of descendents&lt;br /&gt;
vanamaalee: one who wears a garland of forest flowers&lt;br /&gt;
varaangah: with beautiful limbs&lt;br /&gt;
varaaroho: the most glorious destination&lt;br /&gt;
varadah: he who fulfills boons&lt;br /&gt;
vardhamaanah: he who can grow into any dimension&lt;br /&gt;
vardhanah: the nurturer and nourisher&lt;br /&gt;
varunah: one who sets on the horizon (sun)&lt;br /&gt;
vashatkaarah: he who is invoked for oblations&lt;br /&gt;
vasudah: he who gives all wealth&lt;br /&gt;
vasuh: he who is wealth&lt;br /&gt;
vasuh: the refuge for all&lt;br /&gt;
vasuh: the support of all elements&lt;br /&gt;
vasumanaah: he whose mind is supremely pure&lt;br /&gt;
vasumanaah: one who is attentive to everything&lt;br /&gt;
vasupradah: the free-giver of wealth&lt;br /&gt;
vasupradah: the giver of salvation, the greatest wealth&lt;br /&gt;
vasuretaah: he whose essence is golden&lt;br /&gt;
vatsalah: the supremely affectionate&lt;br /&gt;
vatsarah: the abode&lt;br /&gt;
vatsee: the father&lt;br /&gt;
vedaangah: he whose limbs are the vedas&lt;br /&gt;
vedah: he who is the vedas&lt;br /&gt;
vedavid: the knower of the vedas&lt;br /&gt;
vedavit: he who contemplates upon the vedas&lt;br /&gt;
vedhaah: creator of the universe&lt;br /&gt;
vedyah: that which is to be known&lt;br /&gt;
veerabaahur: having mighty arms&lt;br /&gt;
veerah: the courageous&lt;br /&gt;
veerah: the heroic victor&lt;br /&gt;
veerah: the valiant&lt;br /&gt;
veerahaa: destroyer of valiant heroes&lt;br /&gt;
veerahaa: he who destroys the mighty heroes&lt;br /&gt;
veerahaa: one who ends the passage from womb to womb&lt;br /&gt;
veetabhayah: one with no fear&lt;br /&gt;
vegavaan: he who is swift&lt;br /&gt;
vibhuh: all-pervading&lt;br /&gt;
vibhuh: he who manifests in endless forms&lt;br /&gt;
vidaaranah: one who splits asunder&lt;br /&gt;
vidhaataa: all supporter&lt;br /&gt;
vidhaataa: the dispenser of fruits of action&lt;br /&gt;
vidheyaatmaa: one who is ever available for the devotees to command in love&lt;br /&gt;
vidishah: one who is unique in his giving&lt;br /&gt;
vidvattamah: one who has the greatest wisdom&lt;br /&gt;
vihaayasa-gatih: one who travels in space&lt;br /&gt;
vijayah: victorious&lt;br /&gt;
vijitaatmaa: one who has conquered the sense organs&lt;br /&gt;
vikartaa: creator of the endless varieties that make up the universe&lt;br /&gt;
vikramah: he who stepped (vaamana)&lt;br /&gt;
vikramee: he who is full of prowess&lt;br /&gt;
vikramee: the most daring&lt;br /&gt;
viksharah: imperishable&lt;br /&gt;
vimuktaatmaa: the ever-liberated self&lt;br /&gt;
vinayah: he who humiliates those who are unrighteous&lt;br /&gt;
vinayitaa-saakshee: the witness of modesty&lt;br /&gt;
viraamah: the abode of perfect-rest&lt;br /&gt;
virajo: passionless&lt;br /&gt;
virochanah: one who shines in different forms&lt;br /&gt;
vishama: unequalled&lt;br /&gt;
vishishtah: he who transcends all in his glory&lt;br /&gt;
vishnuh: all-pervading&lt;br /&gt;
vishnuh: he who pervades everywhere&lt;br /&gt;
vishnuh: long-striding&lt;br /&gt;
vishodhanah: the great purifier&lt;br /&gt;
vishokah: sorrowless&lt;br /&gt;
vishraamah: the resting place&lt;br /&gt;
vishuddhaatmaa: one who has the purest soul&lt;br /&gt;
vishva-dakshinah: the most skilful and efficient&lt;br /&gt;
vishva-dhrik: supporter of the world&lt;br /&gt;
vishvaatmaa: the soul of the universe&lt;br /&gt;
vishvabhuk: he who enjoys all experiences&lt;br /&gt;
vishvakarmaa: the creator of the universe&lt;br /&gt;
vishvaksenah: he against whom no army can stand&lt;br /&gt;
vishvam: he who is the universe, the virat-purusha&lt;br /&gt;
vishvamoortih: of the form of the entire universe&lt;br /&gt;
vishvayonih: he who incarnates because of the world 150) punarvasuh: he who lives repeatedly in different bodies&lt;br /&gt;
vishvayonih: the womb of the universe&lt;br /&gt;
visishtah: the noblest and most sacred&lt;br /&gt;
visrutaatmaa: he who is called atma in the vedas&lt;br /&gt;
vistaarah: the extension&lt;br /&gt;
visva-retaah: the seed of the universe&lt;br /&gt;
visvabaahuh: he whose hand is in everything&lt;br /&gt;
viviktah: separate&lt;br /&gt;
vriddhaatmaa: the ancient self&lt;br /&gt;
vrikshah: the tree&lt;br /&gt;
vrishaahee: controller of all actions&lt;br /&gt;
vrishaakapih: he who lifts the world to dharma&lt;br /&gt;
vrishaakritih: the form of dharma&lt;br /&gt;
vrishabhaaksho: one whose eyes rain fulfilment of desires&lt;br /&gt;
vrishabhah: he who showers all dharmas&lt;br /&gt;
vrishah: he who is dharma&lt;br /&gt;
vrishakarmaa: he whose every act is righteous&lt;br /&gt;
vrishaparvaa: the ladder leading to dharma (as well as dharma itself)&lt;br /&gt;
vrishapriyah: one who delights in dharma&lt;br /&gt;
vrishodarah: he from whose belly life showers forth&lt;br /&gt;
vyaadishah: one who is unique in his commanding power&lt;br /&gt;
vyaalah: the serpent (vyaalah) to athiests&lt;br /&gt;
vyaapee: all-pervading&lt;br /&gt;
vyaaptah: the pervader&lt;br /&gt;
vyagrah: one who is ever engaged in fulfilling the devotee's desires&lt;br /&gt;
vyaktaroopah: he who is perceptible to the yogi&lt;br /&gt;
vyavasaayah: resolute&lt;br /&gt;
vyavasthaanah: the substratum&lt;br /&gt;
&lt;/div&gt;w (0)&lt;br /&gt;
x (0)&lt;br /&gt;
&lt;a href="http://www.blogger.com/post-edit.g?blogID=31568098&amp;amp;postID=3341579743738378589#" onclick="return toggle(&amp;quot;y&amp;quot;)"&gt;y (22)&lt;/a&gt;&lt;div id="y" style="display: none;"&gt;yadu-shresthah: the best among the yadava clan&lt;br /&gt;
yajnaangah: one whose limbs are the things employed in yajna&lt;br /&gt;
yajnaantakrit: one who performs the concluding act of the yajna&lt;br /&gt;
yajnabhrid: the ruler of the yajanas&lt;br /&gt;
yajnabhuk: receiver of all that is offered&lt;br /&gt;
yajnaguhyam: the person to be realised by yajna&lt;br /&gt;
yajnah: one who is of the nature of yajna&lt;br /&gt;
yajnah: one whose very nature is yajna&lt;br /&gt;
yajnakrit: one who performs yajna&lt;br /&gt;
yajnapatih: the lord of all yajnas&lt;br /&gt;
yajnasaadhanah: one who fulfils all yajnas&lt;br /&gt;
yajnavaahanah: one who fulfils yajnas in complete&lt;br /&gt;
yajnee: enjoyer of yajnas&lt;br /&gt;
yajvaa: the one who performs yajna&lt;br /&gt;
yamah: the administrator&lt;br /&gt;
yat: which&lt;br /&gt;
yoga-vidaam netaa: the guide of those who know yoga&lt;br /&gt;
yogah: he who is realized through yoga&lt;br /&gt;
yogee: one who can be realised through yoga&lt;br /&gt;
yogeeshah: the king of yogis&lt;br /&gt;
yugaadi-krit: the creator of the yugas&lt;br /&gt;
yugaavartah: the law behind time&lt;/div&gt;z (0)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-3341579743738378589?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/W-g6xqlWlOFoiD2GF2b4nPgEqUs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/W-g6xqlWlOFoiD2GF2b4nPgEqUs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/W-g6xqlWlOFoiD2GF2b4nPgEqUs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/W-g6xqlWlOFoiD2GF2b4nPgEqUs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/jguPEOnifRQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/3341579743738378589/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=3341579743738378589" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/3341579743738378589?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/3341579743738378589?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/jguPEOnifRQ/function-toggleid-var-e-document.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2010/06/function-toggleid-var-e-document.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIHQX88fSp7ImA9WxNUFkg.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-377317181417900344</id><published>2009-09-20T22:53:00.000-07:00</published><updated>2009-11-07T20:28:50.175-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-07T20:28:50.175-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Google App Engine" /><title /><content type="html">&lt;b&gt;Google App Engine &amp;amp; Cloud computing : Making world flat for Developers all over the world. &lt;/b&gt;&lt;br /&gt;The playing field for developers all over the world has been levelled with the advent of cloud computing &amp;amp; web services. It's pretty much free for any developer to develop/deploy application over the &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-corrected"&gt;Internet&lt;/span&gt;. There is no start-up cost.Scaling up can happen incrementally based business requirement with upfront investment &amp;amp; I think that's &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-corrected"&gt;revolutionary&lt;/span&gt; in my &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-corrected"&gt;opinion&lt;/span&gt;.&lt;br /&gt;Here are my thoughts on Google App Engine, after deploying my first sample application.&lt;br /&gt;&lt;br /&gt;Salient features of Google App Engine&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Google started supporting java on their engine in April - 09 - &lt;a href="http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html"&gt;Ref&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Support for Google Id and Sign In &lt;/li&gt;&lt;li&gt;&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-corrected"&gt;Automatic&lt;/span&gt; Persistence -&lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;JDO&lt;/span&gt; or &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;JPA&lt;/span&gt; (standards based approach, implementing standard Java &lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;APIs&lt;/span&gt; on top of App Engine where possible. So instead of using the underlying App Engine &lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;datastore&lt;/span&gt; &lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;API&lt;/span&gt;, developers can program against Java Data Objects or Java Persistence &lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;API&lt;/span&gt;) &lt;/li&gt;&lt;li&gt;Local Development - Remote &lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;Depolyment&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Scalability and free Use - Pretty cheap&lt;/li&gt;&lt;li&gt;Monitoring - Nice overview&lt;/li&gt;&lt;li&gt;Eclipse plug in - I did not face any problem with while deploying.&lt;/li&gt;&lt;li&gt;Limited support for &lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;JDK&lt;/span&gt; classes - When I tried converting my swing application to &lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;GWT&lt;/span&gt; one I found many of classes I used were not supported like java.util.Timer classes&lt;/li&gt;&lt;li&gt;Native threads can't be spawned&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Google unleashed App Engine with support for Python in 2008(April). This was &lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;Google's&lt;/span&gt; first entry into on-demand application development and deployment. Developers were able to build, develop and easily deploy apps using Python. I think it has been successful in that.T&lt;b&gt;he economic impact of is that cloud computing disrupts the data center world by slashing the capital and skills required to deploy a web application. &lt;/b&gt;I am betting on success of this model.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;About the current application: &lt;a href="http://javatypingtester.appspot.com/"&gt;java typing tutor&lt;/a&gt;&lt;/div&gt;&lt;div&gt;I created this sample application within an hour with GWT &amp;amp; published it. Initially I tried to porting my one of Swing application "Java Typing Tutor" which I created after reading the &lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;steve&lt;/span&gt; &lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;yegge's&lt;/span&gt; blog long back &lt;a href="http://steve-yegge.blogspot.com/2008/09/programmings-dirtiest-little-secret.html"&gt;Programmings dirtiest little secret &lt;/a&gt;- BTW I don't believe that fast typist should also be better programmer in general, but it was interesting write up. Whenever I get time I do intent to make this application on par with my feature rich swing application.&lt;/div&gt;&lt;div&gt;&lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;GWT&lt;/span&gt; - Although I feel very comfortable coding with this framework, (may be because I spent lot of time in coding Swing Apps) it's API limitations are quite annoying(java.util.Timer does't work etc...). Initially I had the impression that converting a Swing application to &lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;GWT&lt;/span&gt; application is straight forward &amp;amp; I had even the ambition to write even converter!(paint() for &lt;span id="SPELLING_ERROR_18" class="blsp-spelling-error"&gt;GWT&lt;/span&gt; widgets), But I guess now I realized that it's not possible. The programming style, approach are quite different. Once I used &lt;a href="http://wingsframework.org/cms/"&gt;&lt;span id="SPELLING_ERROR_19" class="blsp-spelling-error"&gt;wingS&lt;/span&gt; &lt;/a&gt;framework to convert one of swing application to web - it was straight forward because of deep integration with swing, but now apparently that project has died. It &lt;span id="SPELLING_ERROR_20" class="blsp-spelling-corrected"&gt;definitely&lt;/span&gt; requires a different mindset to develop web application than developing swing application.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Finally some happy notes for swing programmers:&lt;br /&gt;&lt;i&gt;Wicket &amp;amp; &lt;span id="SPELLING_ERROR_21" class="blsp-spelling-error"&gt;GWT&lt;/span&gt; are great saviours for struggling swing developers : &lt;/i&gt;With Swing &lt;span id="SPELLING_ERROR_22" class="blsp-spelling-error"&gt;GUIS&lt;/span&gt; losing their relevance, these 2 framework provides great pathway to move into web development.&lt;/div&gt;&lt;div&gt;Over all I feel &lt;a href="http://code.google.com/webtoolkit/"&gt;&lt;span id="SPELLING_ERROR_23" class="blsp-spelling-error"&gt;GWT&lt;/span&gt; &lt;/a&gt;&amp;amp; &lt;a href="http://wicket.apache.org/"&gt;Wicket &lt;/a&gt;are great framework for Swing developers to develop web application in terms productivity. Rails/Grails (or any request/response framework) guys can never match component developers in terms of productivity :-)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Advantage of &lt;span id="SPELLING_ERROR_24" class="blsp-spelling-error"&gt;GWT&lt;/span&gt; clients (or any fat client) is that they can tap into the resources of the client PC they are running on (such as memory to store state) and thus scale much better for large numbers of users. &lt;span id="SPELLING_ERROR_25" class="blsp-spelling-error"&gt;GWT&lt;/span&gt; produces something that is more akin to applets, independent applications that happen to be hosted on web page.&lt;/div&gt;&lt;div&gt;But where as,&lt;/div&gt;&lt;div&gt;&lt;div&gt;Wicket still assumes that you want to build at least part of your application the 'old fashioned' &lt;/div&gt;&lt;div&gt;way, so that it will work without JavaScript, turn up in search engines, can be bookmarked so on...&lt;/div&gt;&lt;div&gt;So component developers can satisfy both the worlds.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 14px; border-collapse: collapse; color: rgb(51, 51, 51); line-height: 18px; "&gt;"&lt;a href="http://www.guardian.co.uk/technology/2008/sep/29/cloud.computing.richard.stallman"&gt;It's stupidity. It's worse than stupidity: it's a marketing hype campaign&lt;/a&gt;," -Richard Stallman&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"    style="font-family:arial, sans-serif;font-size:130%;color:#333333;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;a href="http://news.cnet.com/8301-13953_3-9917409-80.html"&gt;Amazon looks to be better than Google for Cloud&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-377317181417900344?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DHiXgfxyMUhJgVFfRQ65gjXiPds/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DHiXgfxyMUhJgVFfRQ65gjXiPds/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DHiXgfxyMUhJgVFfRQ65gjXiPds/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DHiXgfxyMUhJgVFfRQ65gjXiPds/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/QVmCg92Ez9o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/377317181417900344/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=377317181417900344" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/377317181417900344?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/377317181417900344?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/QVmCg92Ez9o/google-app-engine-cloud-computing.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/09/google-app-engine-cloud-computing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYNR3o4eip7ImA9WxNbF0U.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-7430267798604881660</id><published>2009-09-13T09:10:00.001-07:00</published><updated>2009-11-20T23:06:36.432-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-20T23:06:36.432-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Java Basics" /><category scheme="http://www.blogger.com/atom/ns#" term="General" /><title /><content type="html">&lt;h3&gt; Elements of Java Coding Styles&lt;/h3&gt;&lt;span xmlns=""&gt;&lt;p&gt;Java Coding Styles: Here are some of the tricks which I felt useful for java developers &amp;amp; I have been using them a lot. Again these are personal preferences, consider what you like &amp;amp; disdain if you don't. By end of the day the software professional is all about getting "good working software, quickly and at low cost" that can sustain for longer time &amp;amp; solves the business problem at hand (with YAGNI caveat). I want to keep updating this whenever I see interesting ones.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Prefer smaller methods&lt;/span&gt;&lt;br /&gt;They look beautiful, easy to understand/reuse/change &amp;amp; test.&lt;/p&gt;&lt;p&gt;&lt;i&gt;'As I did 20 years ago, I still fervently believe that the only way to make software secure, reliable, and fast is to make it small.' - Andrew Tanenbaum&lt;/i&gt;&lt;/p&gt;&lt;p&gt;Dr. Venkat gives wonderful explanation on - &lt;a href="http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281"&gt;how to convince your fellow developer to write short methods?&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Use JUnit test cases; assert statements and method/variable names as documentation, writing comments in JavaDoc are obsolete and useless many a times.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The purpose of the assert statement is to give you a way to catch program errors early, using assertions to state things you know (or think you know) about your program can improve readability &amp;amp; are great in serving as comments, they are intended to be cheap to write, just drop them into your code any time you think of them. They are great tool of communication for a programmer &amp;amp; can get rid of dumb English stuff in the code with // &amp;amp; /** */.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;"There is nothing as useless as doing efficiently, which should not be done at all."  - Peter Drucker&lt;/i&gt;. &lt;/p&gt;&lt;p&gt;I hate to hear someone telling me to add javadoc comments especially for private methods. The method name variable name should be wise enough to reveal the intent. Fluent interface &amp;amp; design pattern can help a lot in naming variables, methods &amp;amp; class names. Over the years my variable &amp;amp; function names have become more verbose. It's so much easier to understand code from years ago when it reads like a sentence.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Big caveat with respect to assertions,&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Assertions should be used to specify things that to be true at various points in your program for providing the documentation &amp;amp; definitely NOT for error checking and any active code. Assertions are disabled ("turned off") by default. Assertions were introduced in Java1.4 &amp;amp; can be turned on with -enableassertions (or -ea) flag on the java command line.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;amp; for JavaDoc,&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Code that isn't fully documented is unfinished and potentially useless. Javadoc comments on methods and classes should normally indicate what the method or class&lt;br /&gt;&lt;/p&gt;&lt;p&gt;It was necessary document the type of keys and values in a Map, as well as the Map's purpose, but now with Java5 Generics that is also not required. Prior to Generics I always used to code List/*String*/ = new ArrayList();&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Some&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;&lt;span class="Apple-style-span"&gt;Java 5 features are smart; Look for smarter new libraries that exploit these features well&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Use basic infrastructure libraries like Google Collections (I prefer this over apache collections), sl4j, Guice etc… as much as possible. We will learn to appreciate the value of Java-5 new features by looking into the source code of these libraries, Old coding styles have to be abandoned in favor new features.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;Commenting the code with "if(false)" &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In many a times we want to use different implementation for testing &amp;amp; commenting out code temporarily. If the method is very long it's painful to comment out the whole block. Let us say we have method like this.&lt;/p&gt;&lt;p&gt;public void sendMail(){&lt;/p&gt;&lt;p&gt;if(true) return;&lt;/p&gt;&lt;p&gt;// Lot of code for adding to database to event&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;&lt;p&gt;// Transforming text with XSL etc...&lt;/p&gt;&lt;p&gt;....&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;if(true) return; -&gt; This line has the same impact as the commenting out the whole stuff :)&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Use double brace initialization (For non-performance intensive code),  If possible use Google Collections in all the cases.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;As swing programmer I have been using these quite long time. I have seen quite number of experienced java programmers aren't aware this. This really useful while testing. It's concise, requires less typing &amp;amp; more readable but comes with &lt;b&gt;cost. &lt;/b&gt;Google Collections provide better same feature without any performance cost.&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="  line-height: 13px; font-family:-webkit-monospace;font-size:13px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class="java java" id="ghl_java" face="monospace" size="13px" color="transparent" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-  background-position: initial initial; "&gt;Map&lt;integer,&gt; map = new HashMap&lt;integer,&gt;() {{ &lt;/integer,&gt;&lt;/integer,&gt;&lt;/pre&gt;&lt;pre class="java java" id="ghl_java" face="monospace" size="13px" color="transparent" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-  background-position: initial initial; "&gt;&lt;integer,&gt;&lt;integer,&gt;    put(1, "one");     &lt;/integer,&gt;&lt;/integer,&gt;&lt;/pre&gt;&lt;pre class="java java" id="ghl_java" face="monospace" size="13px" color="transparent" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-  background-position: initial initial; "&gt;&lt;integer,&gt;&lt;integer,&gt;    put(2, "two");    &lt;/integer,&gt;&lt;/integer,&gt;&lt;/pre&gt;&lt;pre class="java java" id="ghl_java" face="monospace" size="13px" color="transparent" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-  background-position: initial initial; "&gt;&lt;integer,&gt;&lt;integer,&gt;    put(3, "three");     &lt;/integer,&gt;&lt;/integer,&gt;&lt;/pre&gt;&lt;pre class="java java" id="ghl_java" face="monospace" size="13px" color="transparent" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-  background-position: initial initial; "&gt;&lt;integer,&gt;&lt;integer,&gt;    put(4, "four");     &lt;/integer,&gt;&lt;/integer,&gt;&lt;/pre&gt;&lt;pre class="java java" id="ghl_java" face="monospace" size="13px" color="transparent" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-  background-position: initial initial; "&gt;&lt;integer,&gt;&lt;integer,&gt;    put(5, "five"); &lt;/integer,&gt;&lt;/integer,&gt;&lt;/pre&gt;&lt;pre class="java java" id="ghl_java" face="monospace" size="13px" color="transparent" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial;  vertical-align: baseline; background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-  background-position: initial initial; "&gt;&lt;integer,&gt;&lt;integer,&gt;}};&lt;/integer,&gt;&lt;/integer,&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Use protected &amp;amp; final where ever possible&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Using final does not make much sense from performance point of view as modern JVM is intelligent enough to make use them efficiently, but still I feel they have lot of value in making the intent clear &amp;amp; in multi threading simple with im-mutable state.&lt;/p&gt;&lt;p&gt;Usage of "private" is over-rated &amp;amp; I think it's better to have it has protected making setting the code simpler.&lt;/p&gt;&lt;p&gt;Person p = new Person(){{&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;age=30; name="Suresh";&lt;/p&gt;&lt;p&gt;}}&lt;/p&gt;&lt;p&gt;where age &amp;amp; name are protected variables.&lt;/p&gt;&lt;p&gt;More &amp;amp; more you start using inner classes, you will get frustrate with java for lack of "closures" &amp;amp; will eventually move to Groovy or Scala (Like me :-))&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Use Null Object Pattern &amp;amp; throw IllegalArguementException wherever applicable&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The Null Object provides intelligent do nothing behaviour that helps to avoid problems with Null references (NPEs) &amp;amp; so called "A billion dollar irreversible mistake"&lt;/p&gt;&lt;p&gt;&lt;b&gt;Prefer Unchecked Exception over Checked Exception&lt;/b&gt;&lt;/p&gt;&lt;p&gt;90% of time Unchecked Exception makes more sense than the Checked Exception. This is one of the most significant attribute of successful libraries like Spring &amp;amp; Hibernate. Use Checked Exception for recoverable errors (Business Exception) &amp;amp; Unchecked for remaining stuff.&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Understand Soft, Weak and Phantom references in Java&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"    style="font-family:Verdana, sans-serif;font-size:100%;color:#333333;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 19px;font-size:13px;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);   font-weight: normal; line-height: normal; font-family:Georgia, serif;font-size:16px;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"    style="font-family:Verdana, sans-serif;font-size:100%;color:#333333;"&gt;&lt;b&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:Verdana, sans-serif;font-size:13px;"&gt;WeakReference&lt;/span&gt;&lt;span class="Apple-style-span"   style="  font-weight: normal; color: rgb(51, 51, 51); line-height: 19px; font-family:Verdana, sans-serif;font-size:13px;"&gt; is a reference which doesn't have enough force to prevent&lt;b&gt; &lt;span class="Apple-style-span" style="font-weight: normal; "&gt;Garbage Collector&lt;/span&gt;&lt;/b&gt;(GC) deleting object - Useful for caching&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"    style="font-family:Verdana, sans-serif;font-size:100%;color:#333333;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 19px; font-size:13px;"&gt;&lt;b&gt;Soft Reference&lt;/b&gt; behaves like weak references, except  when GC determines object is softly reachable &amp;amp; can be used to avoid OutOfMemoryError.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"    style="font-family:Verdana, sans-serif;font-size:100%;color:#333333;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 19px; font-size:13px;"&gt;&lt;b&gt;Phantom references&lt;/b&gt; are enqueued when objects are deleted from memory and &lt;i&gt;get()&lt;/i&gt;method always returns &lt;i&gt;null &lt;/i&gt;to prevent resurrecting object.  So  phantom references are good for determining exactly when object is deleted from memory.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;__________________&lt;/p&gt;&lt;p&gt;Interesting quotes from Rock star programmers that I collected.&lt;/p&gt;&lt;/b&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt; "Write lots of code. Have fun with it!" — Joshua Bloch&lt;/i&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;"Learn to use your tools. And I don't mean just enough to get by. I mean really learn how to use your tools." — Tor Norbye&lt;/i&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;"Don't use line numbers. Don't put your entire application in one method." — Chet Haase&lt;/i&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;"Don't be overwhelmed by the language or the platform." — Raghavan Srinivas (In the same line Neal Ford says "&lt;/i&gt;When you were hired by your current employer, you may think it's because of your  winning personality, your dazzling smile, or your encyclopedic knowledge of  Java. But it's not. You were hired for your ability to sit and concentrate for  long periods of time to solve problems")&lt;/p&gt;&lt;p&gt;&lt;i&gt;"Millions of people have been employed because someone at Sun Microsystems invented Java." - Masood Mortazavi&lt;/i&gt;. Master it &amp;amp; you will never regret for that&lt;/p&gt;&lt;p&gt;&lt;i&gt;"There will always be opportunities for great engineers, but as I said earlier, I think the number of these opportunities will shrink as other, less technical personnel play larger roles in the software-development process, using more productive, higher-level tools and frameworks than we have used in the past." - Ben Galbraith&lt;/i&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;"Google makes finding information easier than ever, but nothing beats interacting with an expert."- Ben Galbraith&lt;/i&gt;. So always associate with people from whom you think you can learn.&lt;/p&gt;&lt;p&gt;From Pragmatic Thinking &amp;amp; Learning&lt;/p&gt;&lt;p&gt;There is no expertise without experience.It takes something on the order of ten years/ 10,000 hours&lt;br /&gt;of practice to be expert in a field Deliberate, thoughtful practice is what makes the difference—not&lt;br /&gt;just going through the motions.Practice doesn't make perfect, but it does make permanent:&lt;br /&gt;neuroplasticity will cause your brain to re-wire itself according to what you do.You may not become&lt;br /&gt;what you dream, or what you aspire to be, but you will become what you do.Unfortunately there is no substitute for hard work.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;References:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/Interviews/studentdevs/index.html?intcmp=2225"&gt;http://java.sun.com/developer/technicalArticles/Interviews/studentdevs/index.html?intcmp=2225&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281"&gt;http://www.agiledeveloper.com/blog/PermaLink.aspx?guid=8a745e85-2a34-4d9c-8c25-ca371530e281&lt;/a&gt; - How to convince your fellow developer to write short methods?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://weblog.raganwald.com/2007/04/rails-style-creators-in-java-or-how-i.html"&gt;http://weblog.raganwald.com/2007/04/rails-style-creators-in-java-or-how-i.html&lt;/a&gt; - Rails style initializers&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.refactory.org/s/double_brace_initialisation/view/latest"&gt;http://www.refactory.org/s/double_brace_initialisation/view/latest&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://c2.com/cgi/wiki?DoubleBraceInitialization"&gt;http://c2.com/cgi/wiki?DoubleBraceInitialization&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://bwinterberg.blogspot.com/2009/09/introduction-to-google-collections.html"&gt;http://bwinterberg.blogspot.com/2009/09/introduction-to-google-collections.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;http://thestrangeloop.com/sessions/ghost-virtual-machine-reference-references&lt;/p&gt;&lt;p&gt;http://juixe.com/techknow/index.php/2009/11/18/favorite-programming-quotes-2009/&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.readwriteweb.com/archives/top_10_software_engineer_traits.php"&gt;http://www.readwriteweb.com/archives/top_10_software_engineer_traits.php&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"    style="font-family:Verdana, sans-serif;font-size:100%;color:#666666;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 16px; font-size:11px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"    style="font-family:Verdana, sans-serif;font-size:100%;color:#666666;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 16px;font-size:11px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-7430267798604881660?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9gMLoTuGntkCZLYuVdyYcFJA4gs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9gMLoTuGntkCZLYuVdyYcFJA4gs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9gMLoTuGntkCZLYuVdyYcFJA4gs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9gMLoTuGntkCZLYuVdyYcFJA4gs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/qirpQa4OQvY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/7430267798604881660/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=7430267798604881660" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7430267798604881660?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7430267798604881660?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/qirpQa4OQvY/elements-of-java-coding-styles.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/09/elements-of-java-coding-styles.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8DQnszcSp7ImA9WxNbEk8.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-777491880689595611</id><published>2009-06-26T00:03:00.001-07:00</published><updated>2009-11-14T10:54:33.589-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-14T10:54:33.589-08:00</app:edited><title /><content type="html">&lt;span xmlns=""&gt;&lt;p&gt;&lt;b&gt;ALL ABOUT UNIT TESTING&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;"First about Boring Theory"&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;"Unit Test is the smallest piece of testable part of an application" In computer programming, unit testing is a software verification and validation method where the programmer gains confidence those individual units of source code is fit for use. A unit is the smallest testable part of an application. The primary goal of unit testing is to take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect. Each unit is tested separately before integrating them into modules to test the interfaces between modules. Unit testing has proven its value in that a large percentage of defects are identified during its use.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;"In Java Unit Test cases means JUnit test cases, the single most importance of Spring &amp;amp; Guice (or any dependency injection framework) is to make unit testing easier"&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;JUnit is the de-facto framework for unit testing in java world. JUnit is a simple library, although there are mock objects, test code generators, behavioral test design &amp;amp; many other tools based on dynamic languages JUnit remains viable option while testing libraries or API where developer is a end user. Bob Lee (Author of Guice) stresses on the point that single most importance of dependency injection framework or interface driven design for matter is easier testability. All Google great applications like Gmail, Google Adsense, Calendar are the great testimony of this fact.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;"Developers don't like writing unit test cases; Management needs to understand the technical debt associated with un-availability of test cases"&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Let's face it, developers don't like writing unit tests &amp;amp; write documentation. Kent says, Software, like golf, is both a long and short game. JUnit is an example of a long game project – lots of users, stable revenue, where the key goal is to just stay ahead of the needs of the users. So it's hard to sell writing JUnit cases for small projects that don't have longer life. It's clearly avoidable overhead in such cases (Most of the web applications). &lt;i&gt;&lt;b&gt;It may not economically make sense to write extensive test cases for short lived &amp;amp; small applications&lt;/b&gt;&lt;/i&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In some cases developers hate to be embarrassed &amp;amp; look stupid when someone finds a mistake or highly technical guys think they don't need to write test their solid code. The first case can be handled through management as it's a purely competence issue which can be sorted out through training &amp;amp; other means, in second case it's hard to convince as these guys very much correct in their assertions in their own way. It's an attitude problem, the best way would to be deploy someone to write unit test cases. A "high level of quality code" is great, yet most software lives on and on and people expect to add/modify features in that software or debug it, it's economic requirement that super stars need to prove that their code works with unit test cases. How much will the maintenance costs are without unit tests? How much more risk does that add?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;"Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" -- Brian Kernighan&lt;br /&gt;&lt;/p&gt;&lt;p&gt;"Unit testing seems to a lot of managers and developers like pure overhead, but professionally responsible developers know that it is one of the keys to quality." - Neal Ford&lt;/p&gt;&lt;p&gt;&lt;strong&gt;"Solid test cases with 100% coverage provides the courage to refactor the code &amp;amp; the reduces the testing effort in future"&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;We need to educate ourselves it's economically makes sense to have solid test cases especially for pure library (API)providers, as cost associated testing &amp;amp; testers can be completely (almost) avoided as anyway applications will test the APIs &amp;amp; we can avoid duplicating of the testing effort of testers in testing the APIs. Unfortunately these long sighted approaches are difficult to sell to the management and it's become thankless job when the unit tested solid code can't be differentiated with the working code. Developing APIs is a marathon job &amp;amp; not a 100 meters race. Stamina &amp;amp; perseverance plays very important role. In most of the cases committed can't be taken back, I guess JDK deprecated APIs must be haunting, humiliating the initial designers. One of the benefits of JUnit test cases are that developers get first had experience of the developers using the same.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;As time goes on, there will be cases where the code works a bit less, some minor bugs, and some dirty quick fix (or hack) happens. Since you don't want to touch that code, you'll put fixes/enhancements/workarounds in other parts of the code, slightly but constantly degrading the quality of your design. You won't even upgrade a depending library, since you can't easily run regression tests over it. In a shorter time than you expect, that good designed and implemented project will turn into a nightmare. So it's just not about changing code, it's about changing environment - RDBMS vendor, JDK version, Library versions, OS versions…&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;"JUnit can be used to write End to End functional Tests &amp;amp; Unit test cases needs to be reviewed"&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;From definition, a test is not a unit test if:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It talks to the database&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It communicates across the network&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It touches the file system&lt;br /&gt;&lt;/li&gt;&lt;li&gt;It can't run at the same time as any of your other unit tests&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You have to do special things to your environment (such as editing config files) to run it.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If we go by above principle 90% of our JUnit test cases don't pass above rules. Although POJO driven frameworks like Spring tries to solve it, I don't think we can use JUnit in it's pure form. It's ok to use the JUnit for functional and integration test cases as well.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;"Test Before Code, or perhaps Test Before Design." – That means unit test cases need to be reviewed before the design or coding. These reviews probably should be more thorough than the code reviews itself.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;"JUnit test cases can serve as great tool to document"&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Probably writing documentation through Javadocs is a bad idea. Usage of verbose class names, method names &amp;amp; JUnit test cases is more scalable &amp;amp; efficient way of documenting classes. Communicating through the code is the best way communication.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;"JUnit test cases have to be efficient &amp;amp; succinct"&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Manual test hurts both economic wise &amp;amp; manageability wise. But by end of the day if test cases are not capturing the correct scenarios &amp;amp; worst part if we have repetitive test it really JUnit really doesn't help. Best of the people involved with software development needs to do this type of unit testing. Garbage in &amp;amp; Garbage out rule is perfectly applicable here.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;I am done with all my legal points to sell unit testing? Do you guys buy this argument? &lt;span style="font-family:Wingdings;"&gt;J&lt;/span&gt;&lt;br /&gt;  &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;My next topic on unit testing would be on patterns and anti-patterns while writing test cases.&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Resource:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.artima.com/weblogs/viewpost.jsp?thread=126923"&gt;http://www.artima.com/weblogs/viewpost.jsp?thread=126923&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.theserverside.com/news/thread.tss?thread_id=51615"&gt;http://www.theserverside.com/news/thread.tss?thread_id=51615&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.junit.org/"&gt;http://www.junit.org&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://c2.com/cgi/wiki?WhoIsUsingJunit"&gt;http://c2.com/cgi/wiki?WhoIsUsingJunit&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.theserverside.com/news/thread.tss?thread_id=51615"&gt;http://www.theserverside.com/news/thread.tss?thread_id=51615&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://c2.com/cgi/wiki?FunctionalTest"&gt;http://c2.com/cgi/wiki?FunctionalTest&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.davenicolette.net/articles/functional_tdd.html"&gt;http://www.davenicolette.net/articles/functional_tdd.html&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.logigear.com/newsletter/api_vs_unit.asp"&gt;http://www.logigear.com/newsletter/api_vs_unit.asp&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.exubero.com/junit/antipatterns.html"&gt;http://www.exubero.com/junit/antipatterns.html&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.infoq.com/news/2009/06/test-or-not"&gt;http://www.infoq.com/news/2009/06/test-or-not&lt;/a&gt;&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.agitar.com/solutions/why_unit_testing.html"&gt;http://www.agitar.com/solutions/why_unit_testing.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-777491880689595611?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/r6Zusb4nc7y8DU3cxWgNCTvEHTA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/r6Zusb4nc7y8DU3cxWgNCTvEHTA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/r6Zusb4nc7y8DU3cxWgNCTvEHTA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/r6Zusb4nc7y8DU3cxWgNCTvEHTA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/F5zPd_BXzPs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/777491880689595611/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=777491880689595611" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/777491880689595611?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/777491880689595611?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/F5zPd_BXzPs/all-about-unit-testing.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/06/all-about-unit-testing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAHSXc4fyp7ImA9WxJXEEg.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-5794575894102880427</id><published>2009-04-24T12:27:00.000-07:00</published><updated>2009-06-03T11:28:58.937-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-03T11:28:58.937-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Search" /><title /><content type="html">Search Domain Basics : Search is probably the most pervasive technology domain of this century. Here I have tried to cover some basic concepts &amp;amp; some software implementation details with java as the focus. I thought this information can help new comers to this domain &amp;amp; provides enough starting pointers to dig into more details. &lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;"Content is King" - &lt;/span&gt;&lt;span class="Apple-style-span"&gt;Content is what that drives the web &amp;amp; "search" is the engine for that. All the services providing the content has to employ search techniques to fetch the required information with minimum possible user inputs in fastest possible way. Google/Yahoo which have become synonyms with search is implementing all the applications in relation with search one way or the other. Apparently unstructured content forms the major portion of the content available in the universe. Unstructured data (or unstructured information) refers to (usually) computerized information that either does not have a data model or has one that is not easily usable by a computer program or in simple words any data that is not represented in terms of column names in RDBMS table schema. Parallel computing, Data sharding, Schema definition, Scale of data &amp;amp; nature of the content acquisition related with un-structured content makes it unsuitable to be solved from 100% RDBMS solution, although full text indexing does exist in the RDBMS world.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Raw data with context is called 'Information' &amp;amp; Information search and retrieval is all about locating relevant material from collection of raw data in a fastest way taking minimum possible input from the users. The ability to aid and assist a user in finding relevant information is the primary goal of information engineers &amp;amp; information Retrieval (IR) libraries.&lt;/div&gt;&lt;div&gt;&lt;div&gt;Major parts for search engine:&lt;/div&gt;&lt;div&gt;fetching/Loading the document – downloading content (lists of pages) that have been referenced.&lt;/div&gt;&lt;div&gt;analysis – analyzing the database to assign a priority scores to pages (PageRank) and to prioritize fetching. &lt;/div&gt;&lt;div&gt;indexing – combines content from the fetcher, incoming information from the built-in data source, and link analysis scores into a data structure that’s quickly reachable usually using cache services.&lt;/div&gt;&lt;div&gt;searching – returns set of content that ranks pages against a query using an index.&lt;/div&gt;&lt;div&gt;database – keeping track of what documents with various context information helping the ranking better.&lt;/div&gt;&lt;div&gt;To scale to billions of documents, all of these must be distributable, i.e., each must be able to run in parallel on multiple machines. This should happen by throwing more hardware into the pool, without massive reconfiguration whenever scale up is required.As we cannot offer to have failure of any single component cause a major hiccups; a search solution must be able to easily scale by throwing more hardware into the pool, without massive reconfiguration; and  things should largely fix themselves without human intervention. This can only be possible with the stateless implementation of software services.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;&lt;div&gt;Search Engine with Java for unstructured content: &lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;Studying the Information library APIs gives better insights into what search engine is capable of providing the service &amp;amp; I am taking the lucence as the sample for that.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;Lucene library has become defacto IR library in java world, now lucene has been ported to almost all the major languages showcasing the popularity &amp;amp; capability of this small library.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;div&gt;Lucene is a search and retrieval library providing key word and fielded search. It can use boolean AND, OR, and NOT to formulate complex queries &amp;amp; can use fuzzy logic that is useful when searching text created by optical character recognition. Un-structured content far exceeds the structured content in the web world. Lucene mainly deals unstructured content &amp;amp; can effectively search structured content also with the field tags.Lucene provides minimum required information retrieval functionality. We can call this a "SearchKernal" library that provides full-text search and indexing functionality. Instead of an out of the box application, Lucene offers a usable API for programmers and operates on a lower level.There are off the shelf libraries (Compass, Nutch, Solr...) providing monitoring, transaction utilities over lucene. Commercial enterprise search offerings include from vendors such as, Autonomy, Google, Oracle &amp;amp; FAST (MS).Lucene does not search file by file. The search space is analysed first and translated into a normalised representation - the index. Lucene uses a reverse index. All words in the index are unique, that means the index is a compressed representation of the search space. Lucene only supports plain-text files. However, a variety of free open source document parsers are available for document types such as, RTF, PDF, HTML, XML, Word etc. Depending on the nature of the text content various analysers are on offer. For example, text can be analysed with a white space analyzer which breaks down the text in tokens separated by white space. To keep the response time short the process of generating and optimising the index is separated. The index gets normalized by applying a stemming and lemmatisation algorithms. Lucene beats the RDBMS in full text search in terms of processing speed, manageable reduced the size of the index footprint (now about 25 percent of the source documents’ size), easy incremental updates, support for index partitions, price &amp;amp; flexibility (index methodology, deploy options &amp;amp; schema evolution). RDBMS way of searching with where clause &amp;amp; LIKE % is not only scalable but ineffecient, although RDBMS like Oracle includes full text indexing capabilities they have not been as popular to independent solutions such as Lucene &amp;amp; also it's not easy to implement the parallel processing (map/reduce) invloving multiple machines &amp;amp; terabytes of data. It's the dynamic nature &amp;amp; context understanding nature of search bringing huge changes search domain with navigating the hierarchy is becoming old fashioned. With technical problems pretty solved in this domain, now the key thing to remember is &lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;"search methodology is much more important than the underlying technology".&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;Search Terminologies:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;&lt;div&gt;Proximity search:&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;A search where users to specify that documents returned should have the words near each other.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Concept Search: &lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;A search for documents related conceptually to a word, rather than specifically containing the word itself. Involves parallel computing.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;strong&gt;Boolean search:&lt;/strong&gt; A search allowing the inclusion or exclusion of documents containing certain words through the use of operators such as AND, NOT and OR.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;strong&gt;Proximity search:&lt;/strong&gt; A search where users to specify that documents returned should have the words near each other.&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;strong&gt;Stemming:&lt;/strong&gt; The ability for a search to include the "stem" of words. For example, stemming allows a user to enter "running" and get back results also for the stem word "run."&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;Lemmatisation:&lt;/span&gt; is the process of grouping together the different inflected forms of a word so they can be analysed as a single item.Lemmatisation is closely related to stemming. The difference is that a stemmer operates on a single word without knowledge of the context, and therefore cannot discriminate between words which have different meanings depending on part of speech.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;Noise or Stop words&lt;/span&gt;:Conjunctions, prepositions and articles and other words such as AND, TO and A that appear often in documents yet alone may contain little meaning.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;strong&gt;Thesaurus:&lt;/strong&gt; A list of synonyms a search engine can use to find matches for particular words if the words themselves don't appear in documents.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;Index: &lt;/span&gt;Normailzed presentation of words&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;Semantic Search:&lt;/span&gt; is a process used to improve online searching by using data from semantic networks to disambiguate queries and web text in order to generate more relevant results.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;Web Search :&lt;/span&gt; Content is public &amp;amp; Generic.Uses keywords, Links (relevency) based some kind of historic traffic.&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;Enterprise Search&lt;/span&gt; : Also contains private documents that domian specific, Quality of content should be highest quality content &amp;amp; not necessarily popular. Information/metadata needs to be secure with role based access to the content.It has to support security (Realms, Roles), SLAs and many other requirements. Google &amp;amp; Yahoo do not provide enterprise search.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As of now I am interested in researching this topic in the search retrieval field, So will keep updating this blog with my research findings.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;"Automatic annotation/Summary addition for content":&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;Lengthy documents/text are boring to read. It will be great if someone or computer can automatically creates the gist of the content. Automatic creation of annotation is tough task especially for non-domain specific topics but can be predictable in domain specific cases. For example it might be easier to extract the information from judgments copy automatically (at least in routine cases that hardly requires special knowledge from legal experts to annotate) or through workflow for review with automatically annotating the content/documents. I see this as an interesting area.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Summary:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: bold"&gt;&lt;span class="Apple-style-span" style="FONT-WEIGHT: normal"&gt;IR &amp;amp; Search domain is pretty complex subject requiring mastery over algorithms &amp;amp; data structures. Hope that I have been able assimilate the information related to search taking "lucene" as sample search engine library.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;References:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a href="http://www.manning.com/hatcher3/"&gt;Lucene&lt;/a&gt;&lt;a href="http://www.manning.com/hatcher3/"&gt; Book&lt;/a&gt; : http://www.manning.com/hatcher3/&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a href="http://wiki.apache.org/lucene-java/PoweredBy/"&gt;Powered by &lt;/a&gt;&lt;a href="http://wiki.apache.org/lucene-java/PoweredBy/"&gt;Lucene:http://wiki.apache.org/lucene-java/PoweredBy/&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a href="http://www.blogger.com/Google%20Search:http://en.wikipedia.org/wiki/Google_search"&gt;Google Search:http://en.wikipedia.org/wiki/Google_search&lt;/a&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;Useful wrapper libraries over Lucene. &lt;/p&gt;&lt;p class="MsoNormal"&gt;http://lucene.apache.org/solr/features.html - Solr Features &lt;/p&gt;&lt;p class="MsoNormal"&gt;http://www.compass-project.org/overview.html - Compass Features&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-5794575894102880427?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cH4ViEr2IkclGTc-pt15AS3TTl4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cH4ViEr2IkclGTc-pt15AS3TTl4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cH4ViEr2IkclGTc-pt15AS3TTl4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cH4ViEr2IkclGTc-pt15AS3TTl4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/vk6tPkxBPIU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/5794575894102880427/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=5794575894102880427" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/5794575894102880427?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/5794575894102880427?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/vk6tPkxBPIU/search-domain-basics-search-is-probably.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/04/search-domain-basics-search-is-probably.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMDRns_cCp7ImA9WxJSFEo.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-8037193015574066704</id><published>2009-04-17T05:23:00.000-07:00</published><updated>2009-05-04T15:01:17.548-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-04T15:01:17.548-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Design" /><title /><content type="html">Some &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;statistics&lt;/span&gt; about Java source code of popular open source libraries. Currently I am looking/learning a big system that has multi-&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;million&lt;/span&gt; number of source code. I wrote a simple utility to extract information about the java source code just for fun. I ran this utility on many of "src" directory of open source libraries as well.This java utility takes a source code directory as inputs &amp;amp; traverses all the java code &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;recursively&lt;/span&gt; inside that directory. It collects total number of active lines of code excluding comments, package count... &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;amp; here is the result.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;********* &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;JDK&lt;/span&gt;1.5 ********&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Total # Lines = 850918&lt;/div&gt;&lt;div&gt;Total # of Files = 6556&lt;/div&gt;&lt;div&gt;Avg # Lines per file = 129&lt;/div&gt;&lt;div&gt;Total # of packages = 368&lt;/div&gt;&lt;div&gt;******** &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Hadoop&lt;/span&gt; 0.18.3 ******&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Total # Lines = 129742&lt;/div&gt;&lt;div&gt;Total # of Files = 926&lt;/div&gt;&lt;div&gt;Avg # Lines per file = 140&lt;/div&gt;&lt;div&gt;Total # of packages = 66&lt;/div&gt;&lt;div&gt;******* &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;Lucene&lt;/span&gt; 2.4.1 *********&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Total # Lines = 69606&lt;/div&gt;&lt;div&gt;Total # of Files = 528&lt;/div&gt;&lt;div&gt;Avg # Lines per file = 131&lt;/div&gt;&lt;div&gt;Total # of packages = 16&lt;/div&gt;&lt;div&gt;******** Struts *********&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Total # Lines = 63707&lt;/div&gt;&lt;div&gt;Total # of Files = 1040&lt;/div&gt;&lt;div&gt;Avg # Lines per file = 61&lt;/div&gt;&lt;div&gt;Total # of packages = 120&lt;/div&gt;&lt;div&gt;********* &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;iText&lt;/span&gt; 2.1.5 ***********&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Total # Lines = 96830&lt;/div&gt;&lt;div&gt;Total # of Files = 544&lt;/div&gt;&lt;div&gt;Avg # Lines per file = 177&lt;/div&gt;&lt;div&gt;Total # of packages = 55&lt;/div&gt;&lt;div&gt;******* Tapestry 5.1.0.3 ******&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Total # Lines = 96395&lt;/div&gt;&lt;div&gt;Total # of Files = 1937&lt;/div&gt;&lt;div&gt;Avg # Lines per file = 49&lt;/div&gt;&lt;div&gt;Total # of packages = 103&lt;/div&gt;&lt;div&gt;It's not all surprising that one of the best prolific java coder comes best ("&lt;a href="http://tapestryjava.blogspot.com/"&gt;Howard&lt;/a&gt;") in the java world when it it comes to modularity.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;********* &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;iBatis&lt;/span&gt; *********&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Total # Lines = 14132&lt;/div&gt;&lt;div&gt;Total # of Files = 202&lt;/div&gt;&lt;div&gt;Avg # Lines per file = 69&lt;/div&gt;&lt;div&gt;Total # of packages = 45&lt;/div&gt;&lt;div&gt;***** Hibernate 3.3.1.GA *******&lt;/div&gt;&lt;div&gt;&lt;div&gt;Total # Lines = 173698&lt;/div&gt;&lt;div&gt;Total # of Files = 2102&lt;/div&gt;&lt;div&gt;Avg # Lines per file = 82&lt;/div&gt;&lt;div&gt;Total # of packages = 292&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I guess these figures can be considered as standard while reviewing the modularity of any library.Do let me know if any one interested in code &amp;amp; having ANT target to analyze the&lt;/div&gt;&lt;/div&gt;&lt;div&gt; source code b/w releases.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-8037193015574066704?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VCAlFmVKT7locqbIAJ_TdWsVAyY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VCAlFmVKT7locqbIAJ_TdWsVAyY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VCAlFmVKT7locqbIAJ_TdWsVAyY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VCAlFmVKT7locqbIAJ_TdWsVAyY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/ZxAROE0z0aU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/8037193015574066704/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=8037193015574066704" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/8037193015574066704?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/8037193015574066704?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/ZxAROE0z0aU/some-statistics-about-java-source-code.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/04/some-statistics-about-java-source-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMGRXo9eip7ImA9WxJREEw.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-6653088604964369829</id><published>2009-03-10T07:24:00.001-07:00</published><updated>2009-05-10T20:27:04.462-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-10T20:27:04.462-07:00</app:edited><title /><content type="html">&lt;div&gt;Interview with one of the best API designer in the world -Joshua Bloch.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/ZOwHiGCzZjo&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;embed src="http://www.youtube.com/v/ZOwHiGCzZjo&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Adding some other interesting wise quotes on API design that I have read...&lt;/div&gt;&lt;div&gt;When you design user interfaces, it's a good idea to keep two principles in mind:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Users don't have the manual, and if they did, they wouldn't read it.In fact, users can't read &lt;/div&gt;&lt;div&gt;anything, and if they could, they wouldn't want to.&lt;/div&gt;&lt;div&gt;Same rule applies for API designers as well:&lt;/div&gt;&lt;div&gt;Developers don't have the java docs, and if they did, they wouldn't read it.In fact, Developers can't read anything other than pressing "." against the object reference in IDE &amp;amp; wait for something to select, and if they could, they wouldn't want to.&lt;/div&gt;&lt;div&gt;Learnability,Effeciency,Memorability,Errors &amp;amp; Satisfaction remains the core of good interface design.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;APIs should emerge from the needs of real applications, and that they should make common tasks super-easy as the demand for quality, validated designs far exceeds our capacity to create them.In 1996 it wasn't clear we could create a sufficiently fast language without primitive types and arrays, It wasn't clear how much boilerplate code would be required by anonymous callback classes or checked exception. So Java couldn't resist including primitive types,excluding closures in favour of anonymous classes &amp;amp; over-using checked exceptions. &lt;/div&gt;&lt;div&gt;Grady Booch-&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;"Great thing about objects is that they can be replaced". The great thing about Spring is it helps you replace them. Flexibility is much more important than the re-use.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Joshua Bloch says,&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Public APIs are forever - one chance to get it right&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Good code is modular–each module has an API&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Thinking in terms of APIs improves code quality&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Easy to use, even without documentation&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Don’t let implementation details “leak” into API&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Make classes and members as private as possible &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Make variables "final" wherever possible&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Now some economics:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Economic reality suggest that buying more memory can be easier and cheaper than to pay someone to debug code &amp;amp; it pays more in the long run to have understandable slow code than super fast cryptic code.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once I heard from Architect in IBM conference (don;t remember the name) for choosing Java over C++ saying this,&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;"The most compelling reason for adopting Java over C++ is automatic memory management. It protects application from mediocre programmers. It eliminates many embarrassments of memory leaks &amp;amp; crash that randomly occur in production". He went on say that "So as a result we are trading with inexplicable crashes for slow performance (automatic memory management &amp;amp; database-centric storage).This makes sure that application at least works anyway"&lt;br /&gt;&lt;/div&gt;&lt;div&gt;"Rushing is at the root of all lack of quality" - Peter Calthorpe, architect&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Reference:&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.slideshare.net/guestbe92f4/how-to-design-a-good-a-p-i-and-why-it-matters-g-o-o-g-l-e"&gt;Design Slides&lt;/a&gt;&lt;br /&gt;&lt;a href="http://anirudhvyas.com/root/2008/10/20/art-of-defensive-programming/"&gt;Defensive Programming&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.arc-mind.com/papers/springIsGood.html"&gt;Spring is Good&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-6653088604964369829?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tf7fjH33-KjfxJQkAzV2ua_vvRI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tf7fjH33-KjfxJQkAzV2ua_vvRI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tf7fjH33-KjfxJQkAzV2ua_vvRI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tf7fjH33-KjfxJQkAzV2ua_vvRI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/LXJviik0m6A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/6653088604964369829/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=6653088604964369829" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/6653088604964369829?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/6653088604964369829?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/LXJviik0m6A/api-design-speech-from-one-of-best-api.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/03/api-design-speech-from-one-of-best-api.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQHRn0-cCp7ImA9WxJREE0.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-6174114179072351260</id><published>2009-03-09T13:48:00.001-07:00</published><updated>2009-05-10T17:05:37.358-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-10T17:05:37.358-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Startup" /><title /><content type="html">&lt;div&gt;&lt;a href="http://javaiq.in/"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt; javaiq.in&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt; - A playground for learning Java RIAs. I am planning to expose my experimental applications with GWT, JavaFx &amp;amp; Felx. I will also be creating applications mixing multiple open services from various vendors (Google,Yahoo, Amazon, eBay...) &amp;amp; create a combined value. I guess this is the area that has huge scope.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;I created &lt;/span&gt;&lt;a href="http://javaiq.in/"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;this&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt; site &amp;amp; made it public 2 months back. It was result of my experimenting with new techniques with sample applications/code snippets,I always felt that best way to sell any  new technique is with real application. It's great to have useful apps while learning new technologies/framework,I hate to write throw away examples. I have been following web frameworks from past few years, I have spent large amount of time in validating/learning over the year. I am SWING programmer &amp;amp; was always trying out the samples from Internet/books. Learning (or Stealing) the good code snippets that I liked &amp;amp; thought of exposing them as useful apps. Having spent a considerable amount of time and energy with Swing, it was queasy feeling in my stomach to see all my Swing programming heroes (Like Chet, Romain Guy...) either have gone to Adobe/Google or have moved to JavaFx/Flex way. I have also lost faith in Swing. I don't expect to develop new pure Swing apps any more, but I guess I was able to grasp GWT, Echo, Wicket frameworks much better than any pure web MVC framework (Struts, Spring MVC...) developers who were not having exposure to swing. I guess that's the advantage still I can leverage.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;Chasing entrepreneurship dream- "&lt;span class="Apple-style-span" style="font-style: italic;"&gt;When you are not into inheriting money and because you do not belong to a rich family and when you aren’t an individual blessed with the talent of a sportsperson or an actor, the next best thing &lt;span class="Apple-style-span" style="font-style: normal;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;to do is to become an entrepreneur" &lt;/span&gt;- Anand Morzaria&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;A man is a success if he gets up in the morning and gets to bed at night, and in between he does what he wants to do&lt;/span&gt; - Bob Dylan&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;Now experts say it has become relatively cheaper to start a new web application or a startup. Moore's law has made hardware cheap; open source has made software free; the web has made marketing and distribution free; and more powerful programming languages &amp;amp; techniques are making development teams smaller &amp;amp; powerful. But actual life it is not that simpler, especially if you are fighting a lone battle.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;It's really pretty time consuming process to create &amp;amp; manage applications. I went with cheap shared Java hosting which was unable to run my "stripes" web framework based application &amp;amp; no one was there to help me out by providing tomcat logs &amp;amp; I had to settle with few JSPs with trimmed version. It's pretty costly affair to run java apps in a proper manner. It's big road blocker if anybody wants to develop/expose web applications in java today.  Sun has to fix this problem (shared hosting) if it wants to replace PHP/Ruby On Rails apps in small scale applications. (I will have separate notes with java hosting) Enthusiasm to code is very hard to maintain, actually I wrote most of the applications in a few days, but was difficult to keep the momentum. Perseverance, relentless resourcefulness (as paul graham calls it) is difficult to achieve without full time dedication. Anyway it was good exercise to know all these limitations.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;If I look back, I seriously doubt my spending of countless hours in browsing blogs, learning 10s of java web frameworks has significant impact on carrying out my day today work or think better. In fact my guess is I have wasted &gt;30% of total time spent in gleaning through useless/marketing literature links. Hopefully from now on I will be able channelize all my energy in building better context for my day today work rather than learning all java web frameworks under the Sun. BTW all my web framework heroes (Wicket, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Appfuse&lt;/span&gt;, Stripes, Tapestry...) that I have been following from past one year are apparently looking for jobs themselves &amp;amp; are investing time in using Groovy, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Scala&lt;/span&gt; &amp;amp; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;Clojure&lt;/span&gt;. :-( not really a happy situation. I guess innovation with pure java in this space has reached dead end. Now I want to to learn/invest more on my current work so that I can become better at what I am doing currently, that's my priority #1 &amp;amp; I will resist experimenting with what blog writers say on latest technologies. One of the trouble I had disclosing this site was public embarrassment! of people knowing that I created this half baked application that I hesitated to own. But now it's quite decent set of useful applications that I started as my week-end project &amp;amp; I have good ideas to make it still better &amp;amp; this will be always my low priority work &amp;amp; also make sure to extract the best out of I am currently working on.&lt;span class="Apple-style-span"  style="font-family:Georgia;"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;Oh! Now I can call myself &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;CTO&lt;/span&gt; of &lt;/span&gt;&lt;a href="http://javaiq.in/"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;javaiq&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;. nice feeling. :-)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-6174114179072351260?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7bcBMdq5GSLxXISIgLwHTlsWw5w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7bcBMdq5GSLxXISIgLwHTlsWw5w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7bcBMdq5GSLxXISIgLwHTlsWw5w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7bcBMdq5GSLxXISIgLwHTlsWw5w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/d80Pw948tkk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/6174114179072351260/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=6174114179072351260" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/6174114179072351260?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/6174114179072351260?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/d80Pw948tkk/javaiq.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/03/javaiq.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcNRHk4fCp7ImA9WxVVGUs.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-273257106292126732</id><published>2009-03-06T00:02:00.000-08:00</published><updated>2009-03-13T10:58:15.734-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-13T10:58:15.734-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="management" /><title /><content type="html">Popular techie words: we hear below words a lot in discussion &amp;amp; blogs. I thought it's good to have their &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;definitions&lt;/span&gt; (easier ones) &amp;amp; explain if anyone asks "what's that?" as I also use them to have buzzwords compliance.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Technical Debt:&lt;/span&gt;&lt;br /&gt;Technical Debt is a wonderful metaphor developed by Ward Cunningham to help us think about this problem. In this metaphor, doing things the quick and dirty way sets us up with a technical debt, which is similar to a financial debt. Like a financial debt, the technical debt incurs interest payments, which come in the form of the extra effort that we have to do in future development because of the quick and dirty design choice. We can choose to continue paying the interest, or we can pay down the principal by refactoring the quick and dirty design into the better design. Although it costs to pay down the principal, we gain by reduced interest payments in the future.&lt;br /&gt;The metaphor also explains why it may be sensible to do the quick and dirty approach. Just as a business incurs some debt to take advantage of a market opportunity developers may incur technical debt to hit an important deadline. The all too common problem is that development organizations let their debt get out of control and spend most of their future development effort paying crippling interest payments.&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://www.c2.com/cgi/wiki?TechnicalDebt"&gt;http://www.c2.com/cgi/wiki?TechnicalDebt&lt;/a&gt;&lt;br /&gt;&lt;a href="http://martinfowler.com/bliki/TechnicalDebt.html"&gt;http://martinfowler.com/bliki/TechnicalDebt.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=pqeJFYwnkjE"&gt;http://www.youtube.com/watch?v=pqeJFYwnkjE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;MapReduce&lt;/span&gt;&lt;/span&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;MapReduce&lt;/span&gt;&lt;/span&gt; is hierarchical scatter/gather operation.&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;MapReduce&lt;/span&gt;&lt;/span&gt; is a library that lets you adopt a particular, stylized way of programming that's easy to split among a bunch of machines. The basic idea is that you divide the job into two parts: a Map, and a Reduce. Map basically takes the problem, splits it into sub-parts, and sends the sub-parts to different machines - so all the pieces run at the same time. Reduce takes the results from the sub-parts and combines them back together to get a single answer.&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://scienceblogs.com/goodmath/2008/01/databases_are_hammers_mapreduc.php"&gt;http://scienceblogs.com/goodmath/2008/01/databases_are_hammers_mapreduc.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Cloud Computing:&lt;/span&gt;&lt;br /&gt;With cloud computing, everything is web-based instead of being desktop-based; access all programs and documents from any computer that’s connected to the Internet is possible. Cloud computing helps to do it more easily than ever before.&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Wikipedia&lt;/span&gt;&lt;/span&gt; Cloud Computing is "a style of computing in which resources are provided as a service over the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;internet&lt;/span&gt;&lt;/span&gt;". Cloud computing user need not have worry about managing a machine or service at the physical level (Machine &amp;amp; location). Amazon Simple DB is an example for this as it handled operating system or database maintenance functions, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;SLA&lt;/span&gt;&lt;/span&gt; &amp;amp; operational issues.&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/XdBd14rjcs0&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xcfcfcf&amp;amp;hl=en&amp;amp;feature=player_embedded&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;br /&gt;&lt;br /&gt;&lt;embed src="http://www.youtube.com/v/XdBd14rjcs0&amp;amp;color1=0xb1b1b1&amp;amp;color2=0xcfcfcf&amp;amp;hl=en&amp;amp;feature=player_embedded&amp;amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;Sharding&lt;/span&gt;&lt;/span&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;Sharding&lt;/span&gt;&lt;/span&gt; or &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_9"&gt;horizontal&lt;/span&gt; partitioning is about splitting up data sets. If data doesn't fit on one machine then split it up into pieces, each piece is called a shard.&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;Sharding&lt;/span&gt;&lt;/span&gt; is used when you have too much data to fit in one single relational database.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://scienceblogs.com/goodmath/2008/01/databases_are_hammers_mapreduc.php"&gt;http://highscalability.com/sharding-hibernate-way&lt;/a&gt;&lt;br /&gt;&lt;a href="http://scienceblogs.com/goodmath/2008/01/databases_are_hammers_mapreduc.php"&gt;http://highscalability.com/unorthodox-approach-database-design-coming-shard&lt;/a&gt;&lt;br /&gt;&lt;a href="http://lethargy.org/~jesus/archives/95-Partitioning-vs.-Federation-vs.-Sharding.html"&gt;http://lethargy.org/~jesus/archives/95-Partitioning-vs.-Federation-vs.-Sharding.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Refactoring:&lt;/span&gt;&lt;br /&gt;Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior. Its heart is a series of small behavior preserving transformations&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://www.refactoring.com/"&gt;http://www.refactoring.com/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Code_refactoring"&gt;http://en.wikipedia.org/wiki/Code_refactoring&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Code Smell:&lt;/span&gt;&lt;br /&gt;In computer programming, code smell is any symptom in the source code of a program that possibly indicates a deeper problem.&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Code_smell"&gt;http://en.wikipedia.org/wiki/Code_smell&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-273257106292126732?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VZUZDxOSeEYJgbg_HwdfSmoBZ68/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VZUZDxOSeEYJgbg_HwdfSmoBZ68/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VZUZDxOSeEYJgbg_HwdfSmoBZ68/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VZUZDxOSeEYJgbg_HwdfSmoBZ68/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/lTHNWFRU_hE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/273257106292126732/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=273257106292126732" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/273257106292126732?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/273257106292126732?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/lTHNWFRU_hE/popular-techie-words-we-hear-below.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/03/popular-techie-words-we-hear-below.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIHRn88cCp7ImA9WxVVGUo.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-7662897322274992002</id><published>2009-02-28T10:51:00.001-08:00</published><updated>2009-03-13T12:28:57.178-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-13T12:28:57.178-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Startup" /><title /><content type="html">DHH - The best talk I heard on startups&lt;br /&gt;&lt;object width="520" height="276"&gt;&lt;param name="movie" value="http://www.omnisio.com/bin/Embed.swf?embedID=dwno9ObCyr3QwfadbiFy2w&amp;amp;autoPlay=0"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;embed type="application/x-shockwave-flash" name="omnisio_video_dwno9ObCyr3QwfadbiFy2w" src="http://www.omnisio.com/bin/Embed.swf?embedID=dwno9ObCyr3QwfadbiFy2w&amp;amp;autoPlay=0" bgcolor="#FFFFFF" quality="high" allowfullscreen="true" allowscriptaccess="always" width="520" height="276"&gt;&lt;/embed&gt;&lt;noembed&gt;&lt;/noembed&gt;&lt;/object&gt;&lt;br /&gt;&lt;a border="0" href="http://www.gigyamailbutton.com/wildfire/gigyamailbutton.ashx?url=aHR*cDovL3dpbGRmaXJlLmdpZ3lhLmNvbS93aWxkZmlyZS93ZnBvcC5hc3B4P21vZHVsZT1lbWFpbCZ1cmw9aHR*cCUzYSUyZiUyZnd3dy5vbW5pc2lvLmNvbSUyZnYlMmZaVzRXVFVHZGpoRyUyZmRhdmlkLWhlaW5lbWVpZXItaGFuc3Nvbi1hdC1zdGFydHVwLXNjaG9vbC*wOA==" target="_blank"&gt;&lt;img src="http://cdn.gigya.com/wildfire/i/includeShareButton.gif" border="0" width="60" height="20" /&gt;&lt;/a&gt;&lt;img style="visibility:hidden;width:0px;height:0px;" border="0" width="0" height="0" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bHQ9MTIzNTg*NjEyOTY4NyZwdD*xMjM1ODQ3MDk2MzU5JnA9MTkzNTAxJmQ9Jm49YmxvZ2dlciZnPTEmdD*mbz1kZWZmOTQwMTE1M2E*YjA2ODFiNGJhNDgzZWEyMTk2ZA==.gif" /&gt;&lt;br /&gt;&lt;br /&gt;I was quite impressed by DHH (Creator of Ruby On Rails framework) speech on "The secret to making money online" when I viewed this &lt;a href="http://www.omnisio.com/startupschool08/david-heinemeier-hansson-at-startup-school-08"&gt;video&lt;/a&gt; again today.&lt;br /&gt;&lt;br /&gt;There are just 3 steps for this.&lt;br /&gt;1. Create a gr8 product that people like &amp;amp; is useful to them&lt;br /&gt;2. Have a price for the product &amp;amp; ask people to pay for it or it's usage.&lt;br /&gt;3. Make profits!&lt;br /&gt;&lt;br /&gt;This is so ridiculously simple grand old rule! he goes on to say that you don't need to be f***ing genius to achieve this.&lt;br /&gt;&lt;br /&gt;He also came up with nice probability analysis that strike rate of success following above simple model is much higher rather than Yahoo, Google,facebook &amp;amp; youtube (setting up BillBoards/hoardings) way of attracting users providing free services &amp;amp; make use of web page real estate to show ads &amp;amp; make money. He also suggest to go slow on implementing the idea as "Finding a good cause is incredibly hard &amp;amp; time consuming" - Craign Newmark.&lt;br /&gt;&lt;br /&gt;Simply superb.&lt;br /&gt;&lt;br /&gt;I have been following many startup blogs including &lt;a href="http://www.paulgraham.com/"&gt;paul Graham's&lt;/a&gt;, but never impressed like this before, so simple words but telling you the hard truth :-)&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-7662897322274992002?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ydh1feFzuNsDGFqvZiL1zwaDbwI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ydh1feFzuNsDGFqvZiL1zwaDbwI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ydh1feFzuNsDGFqvZiL1zwaDbwI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ydh1feFzuNsDGFqvZiL1zwaDbwI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/XGKH2kG_5tU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/7662897322274992002/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=7662897322274992002" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7662897322274992002?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7662897322274992002?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/XGKH2kG_5tU/david-heinemeier-hansson-at-startup.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2009/02/david-heinemeier-hansson-at-startup.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYMRHs7fip7ImA9WxRUEk0.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-1003923231471432865</id><published>2008-11-20T10:24:00.000-08:00</published><updated>2008-11-20T10:36:25.506-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-20T10:36:25.506-08:00</app:edited><title /><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_uvIefXZeOnk/SSWrleG8hfI/AAAAAAAAAEc/knJUIM6RJQM/s1600-h/mytechList.JPG" style="text-decoration: none;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;font-weight: bold; "&gt;Nice way to tell what all you know with &lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold; text-decoration: underline;"&gt;wordle&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="text-decoration: underline;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 272px; " src="http://1.bp.blogspot.com/_uvIefXZeOnk/SSWrleG8hfI/AAAAAAAAAEc/knJUIM6RJQM/s400/mytechList.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5270807599132739058" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://wordle.net/gallery/wrdl/201473/My_Technology_Stack" title="Wordle: My Technology Stack"&gt;&lt;img src="http://wordle.net/thumb/wrdl/201473/My_Technology_Stack" style="padding:4px;border:1px solid #ddd" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-1003923231471432865?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/E6tJKIh9K0WOcizIWHSxR9fATjU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/E6tJKIh9K0WOcizIWHSxR9fATjU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/E6tJKIh9K0WOcizIWHSxR9fATjU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/E6tJKIh9K0WOcizIWHSxR9fATjU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/DjxvGglFgVI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/1003923231471432865/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=1003923231471432865" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/1003923231471432865?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/1003923231471432865?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/DjxvGglFgVI/nice-way-to-tell-what-all-you-know-with.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_uvIefXZeOnk/SSWrleG8hfI/AAAAAAAAAEc/knJUIM6RJQM/s72-c/mytechList.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/11/nice-way-to-tell-what-all-you-know-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cNSXYyfCp7ImA9WxRUEU8.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-7271766737399462670</id><published>2008-11-11T04:52:00.000-08:00</published><updated>2008-11-19T10:58:18.894-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-19T10:58:18.894-08:00</app:edited><title /><content type="html">Do we really need a web service &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;api&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; for serving static data when we already have a good query and mining language?  (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;SQL&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, XML)&lt;br /&gt;&lt;br /&gt;Google, Amazon &amp;amp; eBay provide the static data by publishing through their docs.&lt;br /&gt;-  Location information (City, Country...)&lt;br /&gt;-  Categories&lt;br /&gt;-  Currency data&lt;br /&gt;- Hierarchy information&lt;br /&gt;&lt;br /&gt;These are the advantages that I see from the above approach. &lt;br /&gt;- Uses local CPU power, saves unnecessary traffic to the web service&lt;br /&gt;-  Supports online/offline scenarios&lt;br /&gt;- Supports programming logic flow, since we will have the information at the compile time it's easy to code&lt;br /&gt;- Solves the performance problem, what ever be the improvement network calls are always costly compared to local calls&lt;br /&gt;- data model is essentially a flat data model, easy to import,save &amp;amp; navigate&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But I guess they should be better exposed as XML rather than as HTML&lt;br /&gt;&lt;br /&gt;The problems I see with this approach&lt;br /&gt;- We need to have stringent way of updating the local cache of static code (usually stored in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;SQL&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;or XML or as text file with some &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;delimiters&lt;/span&gt;&lt;/span&gt;)&lt;br /&gt;- static information that are easy to represent in code (say number is less than 10 &amp;amp; unlikely to change)  are represented as &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Enums&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; , so we will be 2 rules, some will be represented with static &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;enums&lt;/span&gt;&lt;/span&gt; &amp;amp; some will be represented with static code&lt;br /&gt;- There will be different rules for representing the data &amp;amp; we will be sacrificing the strong typing which I think is not a issue as benefits to the both parties (client &amp;amp; server) exceeds the pain with String based &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;APIs&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;As from the mature real SOAP based web services, it's clear that we don't need to expose &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;API&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;StaticCodeService&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;() to get these static information. &lt;span style="font-weight: bold;"&gt;The demand for quality, correct designs far exceeds our capacity to create them. Web services should emerge from the needs of real applications, and that they should make common tasks &lt;/span&gt;&lt;span style="font-weight: bold;" class="blsp-spelling-corrected" id="SPELLING_ERROR_6"&gt;ridiculously&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; easy.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In Summary,&lt;br /&gt;It's not worth wasting SOAP web service &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;API&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; calls for getting static information.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-7271766737399462670?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/obbQ0PxU9tEj1mrEqmgbvn9RNJQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/obbQ0PxU9tEj1mrEqmgbvn9RNJQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/obbQ0PxU9tEj1mrEqmgbvn9RNJQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/obbQ0PxU9tEj1mrEqmgbvn9RNJQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/IgI02KzxrWk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/7271766737399462670/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=7271766737399462670" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7271766737399462670?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7271766737399462670?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/IgI02KzxrWk/do-we-really-need-web-service-api-for.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/11/do-we-really-need-web-service-api-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkYBSH0-eip7ImA9WxRVGEs.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-3371557519316810843</id><published>2008-11-06T20:58:00.000-08:00</published><updated>2008-11-16T11:35:59.352-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-16T11:35:59.352-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="fluent api" /><category scheme="http://www.blogger.com/atom/ns#" term="Design" /><title /><content type="html">Why Fluent Interface? Here are some thoughts on using fluent interface while designing APIs &amp;amp; their impact&lt;br /&gt;Definition : &lt;em&gt;In software engineering, a fluent interface (as first coined by Eric Evans and Martin Fowler) is an object oriented construct that defines a behavior capable of relaying the instruction 'context' of a subsequent call. &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;First philosophy,&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The success of Conversation/Communication/Integration depends on the quality of signals between two entities involved &amp;amp; the signal is clean &amp;amp; is understood well. Communication is always based on context, shared context. Context also influences interpretation. For example , "use a fork" differently depending on context (Unix, dining table, Java or Ant build file). Well understood shared context improves the signal-to-noise ratio in communication it makes communication effective, expressive, easy to understand and easy to work with.&lt;br /&gt;Domain Specific languages (DSLs) have &lt;b&gt;implicit context&lt;/b&gt;, context is never mentioned, once the context is established repeating it again &amp;amp; again is a noise,. The end goal for involved parties in communication should be to reduce the noise to zero.&lt;br /&gt;We have 2 types of DSL, Internal - based on exiisting language &amp;amp; external - A new language with parser &amp;amp; full fledged grammar, evidently external DSL is tough to implement &amp;amp; very effective (SQL,HTML) on the other hand Internal DSL is easy to implement especially with dynamic languages.&lt;br /&gt;&lt;br /&gt;That's all about the boring philosophy...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The benefits,&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;No need to document the APIs.&lt;br /&gt;- They are all self explanatory&lt;br /&gt;- Examples should do all the explanation if any&lt;br /&gt;- Testing/adaptability becomes easier&lt;br /&gt;&lt;br /&gt;Less effort required to use, resulting in better economics&lt;br /&gt;- There is very less chance to make mistakes&lt;br /&gt;- All the extra noise is hidden which does not add domain concepts&lt;br /&gt;- User has to write less &amp;amp; less number of lines of code, LOC most&lt;br /&gt;of the time translate to number of bugs. Less the the code less the bugs&lt;br /&gt;&lt;br /&gt;Correctly written fluent API gives the satisfaction of well written novel to&lt;br /&gt;the author &amp;amp; the same reading experience to the consumer.&lt;br /&gt;&lt;br /&gt;Market is always right, now all the new libraries are coming up using fluent APIs&lt;br /&gt;Big software houses are putting more efforts to make code less noisy. The trend from Microsoft (C#3, IronRuby, F#...) Sun (JRuby &amp;amp; other dynamic language support) points towards that.&lt;br /&gt;&lt;br /&gt;Experts think Fluent APIs are cool.&lt;br /&gt;- Martin Fowler is writing a book on DSL&lt;br /&gt;- Well proven frameworks like JUnit are coming up with fluent API alternatives&lt;br /&gt;- Google collections, JMock, Fest, Guice... countless popular APIs are based&lt;br /&gt;on fluent APIs&lt;br /&gt;- Ruby on Rails Active Record is best example how a DSL can simplify the job &amp;amp; has successfully forced to think differently&lt;br /&gt;- Market Signals shows that, best brains are talking more about DSL, functional&lt;br /&gt;langauges &amp;amp; is definately are the way go about to develop software.&lt;br /&gt;- Joshua Bloch (Google Java Architect) in his new Effective Java book talks about Builder pattern for building immutable fluent java objects.&lt;br /&gt;buying more memory can be easier and cheaper than to pay someone to understand/debug code. Well written code (read fluent interface) results in good economics.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Now the real world code using Fluent APIs,&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;No marketing is better than showcasing real working code for technique or technology.&lt;br /&gt;&lt;br /&gt;New Java Date APIs &lt;a href="http://today.java.net/pub/a/today/2008/09/18/jsr-310-new-java-date-time-api.html"&gt;JSR 130&lt;/a&gt;:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Period thePeriod = Periods.periodBuilder().years(8).months(3).build();&lt;/span&gt;&lt;br /&gt;This is what experts feel how the code should be written &amp;amp; this code is definitely looks better than java.util.Calendar,java.util.Date APIs.&lt;br /&gt;&lt;br /&gt;Fluent way of handling XML marshalling un-marshalling:&lt;br /&gt;&lt;br /&gt;Here we have sample example showcasing the XML usage with fluent APIs&lt;br /&gt;&lt;br /&gt;&amp;lt;contacts&amp;gt;&lt;br /&gt;&amp;lt;contact&amp;gt;&lt;br /&gt;&amp;lt;name&amp;gt;praveenm&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;lt;phone type="mobile"&amp;gt;98862342333&amp;lt;/phone&amp;gt;&lt;br /&gt;&amp;lt;phone type="office"&amp;gt;080-2344234233&amp;lt;/phone&amp;gt;&lt;br /&gt;&amp;lt;email&amp;gt;pm@aol.com&amp;lt;/email&amp;gt;&lt;br /&gt;&amp;lt;/contact&amp;gt;&lt;br /&gt;&amp;lt;/contacts&amp;gt;&lt;br /&gt;&lt;br /&gt;Groovy Sample:&lt;br /&gt;def mkp = new MarkupBuilder()&lt;br /&gt;mkp.contacts {&lt;br /&gt;contact {&lt;br /&gt;name("praveenm")&lt;br /&gt;phone(type: "mobile", "98862342333")&lt;br /&gt;phone(type:"office", "080-2344234233")&lt;br /&gt;email("pm@aol.com")&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Ruby Sample&lt;br /&gt;require 'builder'&lt;br /&gt;x = Builder::XmlMarkup.new(:target =&gt; $stdout, :indent =&gt; 2)&lt;br /&gt;x.contacts {&lt;br /&gt;x.contact {&lt;br /&gt;x.name('praveenm')&lt;br /&gt;x.phone '98862342333', :type =&gt; 'mobile'&lt;br /&gt;x.phone '080-2344234233', :type =&gt; 'office'&lt;br /&gt;x.email 'pm@aol.com'&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Google Collections:&lt;br /&gt;A excelellent example how JDK Collections can be simplified with fluent APIs&lt;br /&gt;public static final ImmutableSet&lt;integer&gt; FAVORITE_NUMBERS&lt;br /&gt;= ImmutableSet.of(2,9, 8, 15, 16, 50);&lt;br /&gt;&lt;br /&gt;FEST Example: DSL-oriented API for functional Swing GUI testing&lt;br /&gt;&lt;br /&gt;dialog.comboBox("domain").select("Users");&lt;br /&gt;dialog.textBox("username").enterText("alex.ruiz");&lt;br /&gt;dialog.button("ok").click();&lt;br /&gt;dialog.optionPane().requireErrorMessage()&lt;br /&gt;.requireMessage("Please enter your password");&lt;br /&gt;&lt;br /&gt;&lt;a href="https://jaxb2-commons.dev.java.net/fluent-api/"&gt;JaxB common:&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;USAddress address = new USAddress()&lt;br /&gt;.setName(name)&lt;br /&gt;.setStreet(street)&lt;br /&gt;.setCity(city)&lt;br /&gt;.setState(state)&lt;br /&gt;.setZip(new BigDecimal(zip));&lt;br /&gt;&lt;br /&gt;I guess this is not a good example for fluent.&lt;br /&gt;&lt;br /&gt;Guice:&lt;br /&gt;@Override&lt;br /&gt;protected void configure() {&lt;br /&gt;    binder().bind(IUserService.class).to(UserServiceMockImpl.class);&lt;br /&gt;    binder().bind(AuditInfo.class).to(DummyAuditInfo.class);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Hibernate:&lt;br /&gt;List cats = session.createCriteria(Cat.class).setMaxResults(50).list()&lt;br /&gt;&lt;br /&gt;DesignGridLayout:&lt;br /&gt;A Fluent Layout manager&lt;br /&gt;&lt;br /&gt;layout.row().label(label("Last Name")).add(lastNameField, 2).add(label("First Name")).add(firstNameField, 2);&lt;br /&gt;layout.row().label(label("Phone"))&lt;br /&gt;.add(phoneField, 2).add(label("Email")).add(emailField, 2);&lt;br /&gt;layout.row().label(label("Address 1")).add(address1Field);&lt;br /&gt;layout.row().label(label("Address 2")).add(address2Field);&lt;br /&gt;&lt;br /&gt;Frameworks like Grails, JMock, JPA utilizes the fluent APIs. We also have some samples in standard JDK itself like StringBuffer, StringBuilder, ProcessBuilder etc...&lt;br /&gt;&lt;br /&gt;These are the commonly seen techniques in Fluent APIs with Java.&lt;br /&gt;- Method Chaining&lt;br /&gt;- Nested Interfaces&lt;br /&gt;- Builder Pattern&lt;br /&gt;- static imports&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;And finally the problems with fluent APIs,&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;It's definitely not the 'wow' technique. People have been using this for a quite long time &amp;amp; now we have just fancy name 'Fluent API' that's it. So let's not think this is like OOP or OOAD or MDA. It's a simple programming technique for making code look better.&lt;br /&gt;&lt;br /&gt;- DSL is about writing good essay. Programmers are not essayists&lt;br /&gt;- Java is not suitable for DSL- It doesn't have closures, open classes , quite verbose &amp;amp; is filled badly written APIs.&lt;br /&gt;- It's very difficult to get correct in developing DSLs.Fluent API can be useful for highly used API,otherwise the investment of developing may not be as effective as intended. Thus, not all API can be made fluent.&lt;br /&gt;- Difficult to track down null return value issues that occur somewhere in the chain&lt;br /&gt;- Difficult to handle the exceptions, especially while dealing with existing APIs having checked exceptions.&lt;br /&gt;- One of my 'java friend' was not ready to believe some of the fluent samples that I showed him were actaully a java code, :-), so there is also -ve impact on readability&lt;br /&gt;- Need to write more code to make code fluent.&lt;br /&gt;&lt;br /&gt;Summary:&lt;br /&gt;I strongly believe that DSL, both internal &amp;amp; external helps in developing better software that is easy to learn,extend, use &amp;amp; hard to misuse.&lt;br /&gt;&lt;br /&gt;That's it, Hope that I was able sell fluent APIs to the new guys.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://martinfowler.com/dslwip/" target="_blank"&gt;Domain Specific Language Book &lt;/a&gt;by Martin Fowler&lt;br /&gt;&lt;a href="http://martinfowler.com/bliki/DomainSpecificLanguage.html" target="_blank"&gt;Domain Specific Language&lt;/a&gt; by Martin Fowler&lt;br /&gt;&lt;a href="http://martinfowler.com/bliki/DslBoundary.html" target="_blank"&gt;DSL Boundary&lt;/a&gt; by Martin Fowler&lt;/integer&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-3371557519316810843?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FBCENHz8sIpvQCF-axc9N60Eqj8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FBCENHz8sIpvQCF-axc9N60Eqj8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FBCENHz8sIpvQCF-axc9N60Eqj8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FBCENHz8sIpvQCF-axc9N60Eqj8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/g0i5u-C_EeY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/3371557519316810843/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=3371557519316810843" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/3371557519316810843?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/3371557519316810843?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/g0i5u-C_EeY/why-fluent-interface-here-some-thoughts.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/11/why-fluent-interface-here-some-thoughts.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQDRXo-fCp7ImA9WxRXEkU.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-7795598535084155021</id><published>2008-10-17T15:08:00.000-07:00</published><updated>2008-10-17T15:59:34.454-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-17T15:59:34.454-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="soap" /><category scheme="http://www.blogger.com/atom/ns#" term="fluent api" /><category scheme="http://www.blogger.com/atom/ns#" term="Groovy" /><title /><content type="html">I am currently working on building a fluent interface over soap &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;toolkits&lt;/span&gt;. I did discussed the possibilities of &lt;a href="http://praveendiary.blogspot.com/2008/08/what-value-could-custom-client-sdk-can.html"&gt;rich &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;APIs&lt;/span&gt; &lt;/a&gt;value addition. One of the problem with fluent &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;APIs&lt;/span&gt; is that we have to get rid of checked exception to make it easier, but there are cases where fault containment is necessary. I am just thinking the better &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;appraoach&lt;/span&gt; would be to generate the unchecked Exception counterparts for each of the fault code &amp;amp; provide the easier error handling.&lt;br /&gt;&lt;br /&gt;For Example: (I have modified sample shown by the Martin Fowler), Let us assume that &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;newOrder&lt;/span&gt; process will talk to 2 other web services &amp;amp; there is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;possibilities&lt;/span&gt; of 2 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;soapfault&lt;/span&gt; errors.&lt;br /&gt;&lt;br /&gt;import &lt;strong&gt;static&lt;/strong&gt; test.Customer.newOrder;&lt;br /&gt;&lt;br /&gt;private void orderNew(){&lt;br /&gt;newOrder() .&lt;br /&gt;with(6, "TAL") .with(5, "HPK").skippable()&lt;br /&gt;.withDollar(35.d) .withAccountId(23423l).withLicense("AS900980") .&lt;br /&gt;.with(3, "LGV")&lt;br /&gt;.priorityRush();&lt;br /&gt;}&lt;br /&gt;@Test&lt;br /&gt;public void test(){&lt;br /&gt;try{&lt;br /&gt;orderNew();&lt;br /&gt;}catch(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;GenricException&lt;/span&gt; exp){&lt;br /&gt;switch(exp.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;getErrorCode&lt;/span&gt;()){&lt;br /&gt;case &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;SOAPFaultsCodes&lt;/span&gt;.E1001:&lt;br /&gt;// handle the exception possibly giving more useful message or some other recovery action&lt;br /&gt;case &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;SOAPFaultsCodes&lt;/span&gt;.7003:&lt;br /&gt;}&lt;br /&gt;throw new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;RuntimeException&lt;/span&gt;("&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;Unhandled&lt;/span&gt; Error");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Here again GenericExcption is abstract Exception extedning RuntimeException that is implemented by all the soap fault exception correspding to the errorcode &amp;amp; will be thrown by the rich APIs.&lt;br /&gt;&lt;br /&gt;I guess with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;JDK&lt;/span&gt;7 I guess we can have String based switch() &amp;amp; upgraded catch block.&lt;br /&gt;&lt;br /&gt;Well, for unit testing exception we can &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;laverege&lt;/span&gt; the annotations support to assert with JUnit4&lt;br /&gt;@Test(expected = E7069Exception.class)&lt;br /&gt;&lt;br /&gt;I wanted to generate all these Exceptions automatically from soap faults document, For that I wrote this groovy script. (show casing the usage of multiline string, closure &amp;amp; file I/O)&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error"&gt;constantsFile&lt;/span&gt;=""&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;converFileLineIntoException&lt;/span&gt; = {&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;sarray&lt;/span&gt; = it.split(" ")&lt;br /&gt;exception = &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;sarray&lt;/span&gt;[0]+"Exception"&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;errorCode&lt;/span&gt; = exception.substring(1,sarray[0].length())&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;constantsFile&lt;/span&gt;+="\n public static final int E$&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;errorCode&lt;/span&gt; = $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;errorCode&lt;/span&gt;;"&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;className&lt;/span&gt; =&lt;br /&gt;"""package com.yahoo.sm.ws.builders.exception;&lt;br /&gt;// Generated code&lt;br /&gt;public class $exception extends &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;GenericException&lt;/span&gt; {&lt;br /&gt;&lt;br /&gt;private String description;&lt;br /&gt;private String &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;shortDescription&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;public $exception(String description, String &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;shortDescription&lt;/span&gt;){&lt;br /&gt;   this.description=description;&lt;br /&gt;   this.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;shortDescription&lt;/span&gt;=&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;shortDescription&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public int &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;errorCode&lt;/span&gt;(){&lt;br /&gt;  return $&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;errorCode&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;getDescription&lt;/span&gt;(){&lt;br /&gt;   return this.description;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;shortDescription&lt;/span&gt;(){&lt;br /&gt;   return this.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;shortDescription&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;"""&lt;br /&gt;new File(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;sarray&lt;/span&gt;[0]+"Exception.java").write(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;className&lt;/span&gt;)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;def lines = new File("&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;soapFaultList&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;txt&lt;/span&gt;").&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;eachLine&lt;/span&gt;(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;converFileLineIntoException&lt;/span&gt;)&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;soapFaults&lt;/span&gt; = """&lt;br /&gt;package com.yahoo.sm.ws.builders.exception;&lt;br /&gt;public interface &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;SOAPFaultsCodes&lt;/span&gt; {&lt;br /&gt;$&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;constantsFile&lt;/span&gt;&lt;br /&gt;}"""&lt;br /&gt;new File("&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;SOAPFaultsCodes&lt;/span&gt;.java").write(&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;soapFaults&lt;/span&gt;)&lt;br /&gt;println "--- Gr8 I am done "&lt;br /&gt;&lt;br /&gt;Groovy, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;JUnit&lt;/span&gt;4 &amp;amp; static imports just rocks :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-7795598535084155021?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TctofS2YnawfGKQxdLf4fiy_djs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TctofS2YnawfGKQxdLf4fiy_djs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TctofS2YnawfGKQxdLf4fiy_djs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TctofS2YnawfGKQxdLf4fiy_djs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/Q_oANekkzXU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/7795598535084155021/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=7795598535084155021" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7795598535084155021?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7795598535084155021?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/Q_oANekkzXU/i-am-currently-working-on-building.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/10/i-am-currently-working-on-building.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4CQncyfSp7ImA9WxBTEEU.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-1210653564966591995</id><published>2008-10-12T10:39:00.000-07:00</published><updated>2009-12-05T22:29:23.995-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-05T22:29:23.995-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Guice" /><category scheme="http://www.blogger.com/atom/ns#" term="JUnit4" /><title /><content type="html">&lt;u&gt;Dependency Injection with &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;Guice&lt;/span&gt;, &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;JUnit&lt;/span&gt; 4 &amp;amp; Get-Set problem:&lt;/u&gt;&lt;br /&gt;I was evaluating &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;Guice&lt;/span&gt;,&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;JUnit&lt;/span&gt;-4,while trying out with these same I wrote a sample application using the same. &amp;amp; also tried out a possible solution for the problem with data conversion.&lt;br /&gt;In a typical web application we also use heavily with get/set to convert from &lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;UI&lt;/span&gt; representation of object to back end implementation object. Many a times (In my experience most of the time) they are all heavy parallel structures required by framework (Like classic struts forces &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;UI&lt;/span&gt; object to extend &amp;amp; &lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;ActionFormBean&lt;/span&gt;, limited data type support) or data type representation in the different &lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;UI&lt;/span&gt; models. With the advent of domain driven design we have more rich domain objects which usually contains many other data/&lt;span id="SPELLING_ERROR_8" class="blsp-spelling-corrected"&gt;behaviour&lt;/span&gt; which should not be or need not be exposed to the &lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;UI&lt;/span&gt; layer.&lt;br /&gt;The problem with this conversion is that they are not only look dumb consuming lot of source code lines but they are error-prone &amp;amp; since there is no contract with back end we are forced to unit test the code as we cannot rely on compile time checks. I also tried a possible solution for this, 3 years back I tried out implementing this in a classic struts based web application &amp;amp; was successful in reducing the number of bugs.&lt;br /&gt;&lt;br /&gt;The sample application is user management system. (Please note that the code has been written in such a way to show the usage &lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;Guice&lt;/span&gt;, &lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;JUnit&lt;/span&gt; &amp;amp; type safe data conversion &amp;amp; &lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;shouldn'&lt;/span&gt;t be &lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;mistaken&lt;/span&gt; as real time design,there are no exceptions, validation etc...). It follows a typical &lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;MVC&lt;/span&gt; pattern followed in web applications.&lt;br /&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;Model Layer&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a onclick="return toggle('User')" href="#"&gt;User.java&lt;/a&gt; Represents a User domain object. As we notice it also contains the information that is populated through context (Logged in user, context, date, etc... usually through &lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;HttpSession&lt;/span&gt; or &lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;EJBContext&lt;/span&gt;) in the form of &lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;AuditInfo&lt;/span&gt; object. Here the &lt;span id="SPELLING_ERROR_18" class="blsp-spelling-error"&gt;fullName&lt;/span&gt; field (which doesn't make sense to &lt;span id="SPELLING_ERROR_19" class="blsp-spelling-error"&gt;UI&lt;/span&gt;) representing the &lt;span id="SPELLING_ERROR_20" class="blsp-spelling-error"&gt;firstName&lt;/span&gt; &amp;amp; &lt;span id="SPELLING_ERROR_21" class="blsp-spelling-error"&gt;fullName&lt;/span&gt; as '&lt;span id="SPELLING_ERROR_22" class="blsp-spelling-error"&gt;firstName&lt;/span&gt;,&lt;span id="SPELLING_ERROR_23" class="blsp-spelling-error"&gt;lastName&lt;/span&gt;' in a single field. This is done to show how easily back end object can be refactored to &lt;span id="SPELLING_ERROR_24" class="blsp-spelling-error"&gt;accomadate&lt;/span&gt; client requirements. This can be even applied to data types. Since extracting of interface from any class is supported by all the &lt;span id="SPELLING_ERROR_25" class="blsp-spelling-error"&gt;IDEs&lt;/span&gt;, there is no coding effort required here.&lt;br /&gt;&lt;br /&gt;&lt;div style="DISPLAY:none" id="User"&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;\&lt;span id="SPELLING_ERROR_26" class="blsp-spelling-error"&gt;src&lt;/span&gt;\model\&lt;span id="SPELLING_ERROR_27" class="blsp-spelling-error"&gt;User&lt;/span&gt;.java&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="comment"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt; &lt;span class="comment"&gt; * To change this template, choose Tools  Templates&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="comment"&gt; * and open the template in the editor.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="comment"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="keyword-directive"&gt;package&lt;/span&gt; model;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt; &lt;span class="keyword-directive"&gt;import&lt;/span&gt; controller.IUser;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;praveenm&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt; &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;class&lt;/span&gt; User &lt;span class="keyword-directive"&gt;implements&lt;/span&gt; IUser,java.io.Serializable {&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt;     &lt;span class="keyword-directive"&gt;private&lt;/span&gt; String userName;&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;     &lt;span class="keyword-directive"&gt;private&lt;/span&gt; String eMail;&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt;     &lt;span class="keyword-directive"&gt;private&lt;/span&gt; &lt;span class="keyword-directive"&gt;int&lt;/span&gt; age;&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt;     &lt;span class="keyword-directive"&gt;private&lt;/span&gt; String fullName;&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt;     &lt;span class="keyword-directive"&gt;private&lt;/span&gt; &lt;span class="keyword-directive"&gt;static&lt;/span&gt; &lt;span class="keyword-directive"&gt;final&lt;/span&gt; String DELIMETER=&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;,&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;21&lt;/span&gt;  &lt;br /&gt;&lt;span class="line-number"&gt;22&lt;/span&gt;     &lt;span class="keyword-directive"&gt;private&lt;/span&gt; AuditInfo auditInfo = &lt;span class="keyword-directive"&gt;new&lt;/span&gt; AuditInfo();&lt;br /&gt;&lt;span class="line-number"&gt;23&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;24&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; String getUserName() {&lt;br /&gt;&lt;span class="line-number"&gt;25&lt;/span&gt;         &lt;span class="keyword-directive"&gt;return&lt;/span&gt; userName;&lt;br /&gt;&lt;span class="line-number"&gt;26&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;27&lt;/span&gt;   &lt;br /&gt;&lt;span class="line-number"&gt;28&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; User(){&lt;br /&gt;&lt;span class="line-number"&gt;29&lt;/span&gt;       &lt;br /&gt;&lt;span class="line-number"&gt;30&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;31&lt;/span&gt;  &lt;br /&gt;&lt;span class="line-number"&gt;32&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;33&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; setUserName(String userName) {&lt;br /&gt;&lt;span class="line-number"&gt;34&lt;/span&gt;         &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.userName = userName;&lt;br /&gt;&lt;span class="line-number"&gt;35&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;36&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;37&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; String getEMail() {&lt;br /&gt;&lt;span class="line-number"&gt;38&lt;/span&gt;         &lt;span class="keyword-directive"&gt;return&lt;/span&gt; eMail;&lt;br /&gt;&lt;span class="line-number"&gt;39&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;40&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;41&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; setEMail(String eMail) {&lt;br /&gt;&lt;span class="line-number"&gt;42&lt;/span&gt;         &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.eMail = eMail;&lt;br /&gt;&lt;span class="line-number"&gt;43&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;44&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;45&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;int&lt;/span&gt; getAge() {&lt;br /&gt;&lt;span class="line-number"&gt;46&lt;/span&gt;         &lt;span class="keyword-directive"&gt;return&lt;/span&gt; age;&lt;br /&gt;&lt;span class="line-number"&gt;47&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;48&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;49&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; setAge(&lt;span class="keyword-directive"&gt;int&lt;/span&gt; age) {&lt;br /&gt;&lt;span class="line-number"&gt;50&lt;/span&gt;         &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.age = age;&lt;br /&gt;&lt;span class="line-number"&gt;51&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;52&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;53&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; String getFirstName() {&lt;br /&gt;&lt;span class="line-number"&gt;54&lt;/span&gt;         &lt;span class="keyword-directive"&gt;return&lt;/span&gt; fullName.split(DELIMETER)[0];&lt;br /&gt;&lt;span class="line-number"&gt;55&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;56&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;57&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; setFirstName(String firstName) {&lt;br /&gt;&lt;span class="line-number"&gt;58&lt;/span&gt;         &lt;span class="keyword-directive"&gt;if&lt;/span&gt;(getLastName()!=&lt;span class="keyword-directive"&gt;null&lt;/span&gt;){&lt;br /&gt;&lt;span class="line-number"&gt;59&lt;/span&gt;             fullName = firstName+DELIMETER+getLastName();&lt;br /&gt;&lt;span class="line-number"&gt;60&lt;/span&gt;         }&lt;br /&gt;&lt;span class="line-number"&gt;61&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;62&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;63&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; String getLastName() {&lt;br /&gt;&lt;span class="line-number"&gt;64&lt;/span&gt;         &lt;span class="keyword-directive"&gt;return&lt;/span&gt; fullName.split(DELIMETER)[1];&lt;br /&gt;&lt;span class="line-number"&gt;65&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;66&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;67&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; setLastName(String lastName) {&lt;br /&gt;&lt;span class="line-number"&gt;68&lt;/span&gt;         &lt;span class="keyword-directive"&gt;if&lt;/span&gt;(getFirstName()!=&lt;span class="keyword-directive"&gt;null&lt;/span&gt;){&lt;br /&gt;&lt;span class="line-number"&gt;69&lt;/span&gt;             fullName = getFirstName()+DELIMETER+lastName;&lt;br /&gt;&lt;span class="line-number"&gt;70&lt;/span&gt;         }&lt;br /&gt;&lt;span class="line-number"&gt;71&lt;/span&gt;           &lt;br /&gt;&lt;span class="line-number"&gt;72&lt;/span&gt;           &lt;br /&gt;&lt;span class="line-number"&gt;73&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;74&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; setFullName(String str){&lt;br /&gt;&lt;span class="line-number"&gt;75&lt;/span&gt;         fullName=str;&lt;br /&gt;&lt;span class="line-number"&gt;76&lt;/span&gt;       &lt;br /&gt;&lt;span class="line-number"&gt;77&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;78&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;79&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; AuditInfo getAuditInfo() {&lt;br /&gt;&lt;span class="line-number"&gt;80&lt;/span&gt;         &lt;span class="keyword-directive"&gt;return&lt;/span&gt; auditInfo;&lt;br /&gt;&lt;span class="line-number"&gt;81&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;82&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;83&lt;/span&gt;     &lt;span class="keyword-directive"&gt;public&lt;/span&gt; &lt;span class="keyword-directive"&gt;void&lt;/span&gt; setAuditInfo(AuditInfo auditInfo) {&lt;br /&gt;&lt;span class="line-number"&gt;84&lt;/span&gt;         &lt;span class="keyword-directive"&gt;this&lt;/span&gt;.auditInfo = auditInfo;&lt;br /&gt;&lt;span class="line-number"&gt;85&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;86&lt;/span&gt;  &lt;br /&gt;&lt;span class="line-number"&gt;87&lt;/span&gt;  &lt;br /&gt;&lt;span class="line-number"&gt;88&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;89&lt;/span&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onclick="return toggle('IUserService')" href="#"&gt;&lt;span id="SPELLING_ERROR_126" class="blsp-spelling-error"&gt;IUserService&lt;/span&gt;&lt;/a&gt; - Exposing the functionality of user management service&lt;br /&gt;&lt;div style="DISPLAY: none" id="IUserService"&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;\&lt;span id="SPELLING_ERROR_127" class="blsp-spelling-error"&gt;src&lt;/span&gt;\model\&lt;span id="SPELLING_ERROR_128" class="blsp-spelling-error"&gt;IUserService&lt;/span&gt;.java&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="literal"&gt;package&lt;/span&gt; model;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; &lt;span id="SPELLING_ERROR_129" class="blsp-spelling-error"&gt;ui&lt;/span&gt;.&lt;span id="SPELLING_ERROR_130" class="blsp-spelling-error"&gt;IUser&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; java.util.List;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="comment"&gt;A&lt;/span&gt; &lt;span class="comment"&gt;&lt;span id="SPELLING_ERROR_131" class="blsp-spelling-error"&gt;simmple&lt;/span&gt;&lt;/span&gt; &lt;span class="comment"&gt;service&lt;/span&gt; &lt;span class="comment"&gt;representing&lt;/span&gt; &lt;span class="comment"&gt;the&lt;/span&gt; &lt;span class="comment"&gt;general&lt;/span&gt; &lt;span class="comment"&gt;User&lt;/span&gt; &lt;span class="comment"&gt;management&lt;/span&gt; &lt;span class="comment"&gt;activities&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;&lt;span id="SPELLING_ERROR_132" class="blsp-spelling-error"&gt;praveenm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt; &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;interface&lt;/span&gt; &lt;span id="SPELLING_ERROR_133" class="blsp-spelling-error"&gt;IUserService&lt;/span&gt; {&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt;     User get(String &lt;span id="SPELLING_ERROR_134" class="blsp-spelling-error"&gt;userName&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt;     &lt;span class="literal"&gt;&lt;span id="SPELLING_ERROR_135" class="blsp-spelling-error"&gt;boolean&lt;/span&gt;&lt;/span&gt; &lt;span id="SPELLING_ERROR_136" class="blsp-spelling-error"&gt;saveOrUpdate&lt;/span&gt;(User user);&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt;     &lt;span class="literal"&gt;&lt;span id="SPELLING_ERROR_137" class="blsp-spelling-error"&gt;boolean&lt;/span&gt;&lt;/span&gt; delete(String &lt;span id="SPELLING_ERROR_138" class="blsp-spelling-error"&gt;userName&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt;     &lt;span class="literal"&gt;&lt;span id="SPELLING_ERROR_139" class="blsp-spelling-error"&gt;boolean&lt;/span&gt;&lt;/span&gt; &lt;span id="SPELLING_ERROR_140" class="blsp-spelling-error"&gt;saveOrUpdate&lt;/span&gt;(&lt;span id="SPELLING_ERROR_141" class="blsp-spelling-error"&gt;IUser&lt;/span&gt; user,&lt;span id="SPELLING_ERROR_142" class="blsp-spelling-error"&gt;AuditInfo&lt;/span&gt; info);&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;     List&amp;amp;&lt;span id="SPELLING_ERROR_143" class="blsp-spelling-error"&gt;lt&lt;/span&gt;;&lt;span id="SPELLING_ERROR_144" class="blsp-spelling-error"&gt;IUser&lt;/span&gt;&amp;gt; &lt;span id="SPELLING_ERROR_145" class="blsp-spelling-error"&gt;getUsers&lt;/span&gt;();&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onclick="return toggle('UserServiceMockImpl')" href="#"&gt;&lt;span id="SPELLING_ERROR_146" class="blsp-spelling-error"&gt;UserServiceMockImpl&lt;/span&gt;.java&lt;/a&gt; - Implements the service by saving the content in a file using object serialization.&lt;br /&gt;&lt;div style="DISPLAY: none" id="UserServiceMockImpl"&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;\&lt;span id="SPELLING_ERROR_147" class="blsp-spelling-error"&gt;src&lt;/span&gt;\model\&lt;span id="SPELLING_ERROR_148" class="blsp-spelling-error"&gt;AuditInfo&lt;/span&gt;.java&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="comment"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt; &lt;span class="comment"&gt; * To change this template, choose Tools  Templates&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="comment"&gt; * and open the template in the editor.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="comment"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="literal"&gt;package&lt;/span&gt; model;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; java.io.Serializable;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; java.util.Date;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;&lt;span id="SPELLING_ERROR_149" class="blsp-spelling-error"&gt;praveenm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt; &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;class&lt;/span&gt; &lt;span id="SPELLING_ERROR_150" class="blsp-spelling-error"&gt;AuditInfo&lt;/span&gt; &lt;span class="literal"&gt;implements&lt;/span&gt; &lt;span id="SPELLING_ERROR_151" class="blsp-spelling-error"&gt;Serializable&lt;/span&gt; {&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; String &lt;span id="SPELLING_ERROR_152" class="blsp-spelling-error"&gt;updatedBy&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; String &lt;span id="SPELLING_ERROR_153" class="blsp-spelling-error"&gt;createdBy&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; Date &lt;span id="SPELLING_ERROR_154" class="blsp-spelling-error"&gt;updatedDate&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; Date &lt;span id="SPELLING_ERROR_155" class="blsp-spelling-error"&gt;createdDate&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; &lt;span class="literal"&gt;&lt;span id="SPELLING_ERROR_156" class="blsp-spelling-error"&gt;boolean&lt;/span&gt;&lt;/span&gt; &lt;span id="SPELLING_ERROR_157" class="blsp-spelling-error"&gt;isAdmin&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;21&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;22&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; String &lt;span id="SPELLING_ERROR_158" class="blsp-spelling-error"&gt;getUpdatedBy&lt;/span&gt;() {&lt;br /&gt;&lt;span class="line-number"&gt;23&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; &lt;span id="SPELLING_ERROR_159" class="blsp-spelling-error"&gt;updatedBy&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;24&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;25&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;26&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; &lt;span id="SPELLING_ERROR_160" class="blsp-spelling-error"&gt;setUpdatedBy&lt;/span&gt;(String &lt;span id="SPELLING_ERROR_161" class="blsp-spelling-error"&gt;updatedBy&lt;/span&gt;) {&lt;br /&gt;&lt;span class="line-number"&gt;27&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.&lt;span id="SPELLING_ERROR_162" class="blsp-spelling-error"&gt;updatedBy&lt;/span&gt; = &lt;span id="SPELLING_ERROR_163" class="blsp-spelling-error"&gt;updatedBy&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;28&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;29&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;30&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; String &lt;span id="SPELLING_ERROR_164" class="blsp-spelling-error"&gt;getCreatedBy&lt;/span&gt;() {&lt;br /&gt;&lt;span class="line-number"&gt;31&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; &lt;span id="SPELLING_ERROR_165" class="blsp-spelling-error"&gt;createdBy&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;32&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;33&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;34&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; &lt;span id="SPELLING_ERROR_166" class="blsp-spelling-error"&gt;setCreatedBy&lt;/span&gt;(String createdBy) {&lt;br /&gt;&lt;span class="line-number"&gt;35&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.createdBy = createdBy;&lt;br /&gt;&lt;span class="line-number"&gt;36&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;37&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;38&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; Date getUpdatedDate() {&lt;br /&gt;&lt;span class="line-number"&gt;39&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; updatedDate;&lt;br /&gt;&lt;span class="line-number"&gt;40&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;41&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;42&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setUpdatedDate(Date updatedDate) {&lt;br /&gt;&lt;span class="line-number"&gt;43&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.updatedDate = updatedDate;&lt;br /&gt;&lt;span class="line-number"&gt;44&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;45&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;46&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; Date getCreatedDate() {&lt;br /&gt;&lt;span class="line-number"&gt;47&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; createdDate;&lt;br /&gt;&lt;span class="line-number"&gt;48&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;49&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;50&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setCreatedDate(Date createdDate) {&lt;br /&gt;&lt;span class="line-number"&gt;51&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.createdDate = createdDate;&lt;br /&gt;&lt;span class="line-number"&gt;52&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;53&lt;/span&gt;     @Override&lt;br /&gt;&lt;span class="line-number"&gt;54&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; String toString(){&lt;br /&gt;&lt;span class="line-number"&gt;55&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; &lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;updatedBy=[&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;+updatedBy+&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;] &lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;+&lt;br /&gt;&lt;span class="line-number"&gt;56&lt;/span&gt;                 &lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;createdBy=[&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;+createdBy+&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;] &lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;57&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;58&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;59&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;boolean&lt;/span&gt; isIsAdmin() {&lt;br /&gt;&lt;span class="line-number"&gt;60&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; isAdmin;&lt;br /&gt;&lt;span class="line-number"&gt;61&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;62&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;63&lt;/span&gt;     &lt;span class="literal"&gt;protected&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setIsAdmin(&lt;span class="literal"&gt;boolean&lt;/span&gt; isAdmin) {&lt;br /&gt;&lt;span class="line-number"&gt;64&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.isAdmin = isAdmin;&lt;br /&gt;&lt;span class="line-number"&gt;65&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;66&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;67&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;68&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;UI Layer&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a onclick="toggle('IUser')" href="#"&gt;IUser.java&lt;/a&gt; - Now this is the trick we have IUser that's required by UI layer (which is always a subset of back end object) that's being implemented by the UI model object.&lt;br /&gt;&lt;div style="DISPLAY: none" id="thecode"&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="literal"&gt;package&lt;/span&gt; ui;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;praveenm&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;interface&lt;/span&gt; IUser &lt;span class="literal"&gt;extends&lt;/span&gt; java.io.Serializable {&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt;     &lt;span class="literal"&gt;int&lt;/span&gt; getExperience();&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt;     String getEMail();&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt;     String getFirstName();&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt;     String getLastName();&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt;     String getUserName();&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt;     &lt;span class="literal"&gt;void&lt;/span&gt; setExperience(&lt;span class="literal"&gt;int&lt;/span&gt; Experience);&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt;     &lt;span class="literal"&gt;void&lt;/span&gt; setEMail(String eMail);&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt;     &lt;span class="literal"&gt;void&lt;/span&gt; setFirstName(String firstName);&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt;     &lt;span class="literal"&gt;void&lt;/span&gt; setLastName(String lastName);&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;     &lt;span class="literal"&gt;void&lt;/span&gt; setUserName(String userName);&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;21&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;22&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onclick="return toggle('UserForm')" href="#"&gt;UserForm.java&lt;/a&gt; - UI bean honouring java bean spec &amp;amp; can extend the classes like ActionFormBean representing the HTML form in the screen.&lt;br /&gt;&lt;div style="DISPLAY: none" id="UserForm"&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;\src\ui\UserForm.java&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="literal"&gt;package&lt;/span&gt; ui;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; ui.IUser;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; java.io.Serializable;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;praveenm&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt; &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;class&lt;/span&gt; UserForm &lt;span class="literal"&gt;implements&lt;/span&gt; IUser,Serializable {&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; String userName;&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; String eMail;&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; &lt;span class="literal"&gt;int&lt;/span&gt; experience;&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; String firstName;&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; String lastName;&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; String getUserName() {&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; userName;&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;21&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setUserName(String userName) {&lt;br /&gt;&lt;span class="line-number"&gt;22&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.userName = userName;&lt;br /&gt;&lt;span class="line-number"&gt;23&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;24&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;25&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; String getEMail() {&lt;br /&gt;&lt;span class="line-number"&gt;26&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; eMail;&lt;br /&gt;&lt;span class="line-number"&gt;27&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;28&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;29&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setEMail(String eMail) {&lt;br /&gt;&lt;span class="line-number"&gt;30&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.eMail = eMail;&lt;br /&gt;&lt;span class="line-number"&gt;31&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;32&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;33&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;int&lt;/span&gt; getExperience() {&lt;br /&gt;&lt;span class="line-number"&gt;34&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; experience;&lt;br /&gt;&lt;span class="line-number"&gt;35&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;36&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;37&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setExperience(&lt;span class="literal"&gt;int&lt;/span&gt; experience) {&lt;br /&gt;&lt;span class="line-number"&gt;38&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.experience = experience;&lt;br /&gt;&lt;span class="line-number"&gt;39&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;40&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;41&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; String getFirstName() {&lt;br /&gt;&lt;span class="line-number"&gt;42&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; firstName;&lt;br /&gt;&lt;span class="line-number"&gt;43&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;44&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;45&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setFirstName(String firstName) {&lt;br /&gt;&lt;span class="line-number"&gt;46&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.firstName = firstName;&lt;br /&gt;&lt;span class="line-number"&gt;47&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;48&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;49&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; String getLastName() {&lt;br /&gt;&lt;span class="line-number"&gt;50&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; lastName;&lt;br /&gt;&lt;span class="line-number"&gt;51&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;52&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;53&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setLastName(String lastName) {&lt;br /&gt;&lt;span class="line-number"&gt;54&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.lastName = lastName;&lt;br /&gt;&lt;span class="line-number"&gt;55&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;56&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;57&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;58&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;59&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;controller&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a onclick="return toggle('UserController')" href="#"&gt;UserController.java&lt;/a&gt; - Controls the logic flow b/w UI &amp;amp; the back end. Here is the place we will introduce the dependency injection. In a typical web application audit information is captured in HttpSession object, since in test envioronment we will not be having references to HttpRequest, HttpResponse etc... we will inject those data with our Guice &amp;amp; also we will inject service implementation which could be changed without disturbing the other layers.&lt;br /&gt;&lt;div style="DISPLAY: none" id="UserController"&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;\src\controller\UserController.java&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="literal"&gt;package&lt;/span&gt; controller;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; ui.IUser;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; com.google.inject.Inject;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; java.util.List;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; model.AuditInfo;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; model.IUserService;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;praveenm&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt; &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;class&lt;/span&gt; UserController {&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; &lt;span class="literal"&gt;final&lt;/span&gt; IUserService service;&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; AuditInfo info;&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt;     @Inject&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; UserController(IUserService _service){&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt;         service=_service;&lt;br /&gt;&lt;span class="line-number"&gt;21&lt;/span&gt;         System.out.println(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;UserController Instaniated &lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;22&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;23&lt;/span&gt;     @Inject&lt;br /&gt;&lt;span class="line-number"&gt;24&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; setAuditInfo(AuditInfo info){&lt;br /&gt;&lt;span class="line-number"&gt;25&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.info=info;&lt;br /&gt;&lt;span class="line-number"&gt;26&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;27&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;28&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;boolean&lt;/span&gt; save(&lt;span class="literal"&gt;final&lt;/span&gt; IUser user){&lt;br /&gt;&lt;span class="line-number"&gt;29&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; service.saveOrUpdate(user,info);&lt;br /&gt;&lt;span class="line-number"&gt;30&lt;/span&gt;    }&lt;br /&gt;&lt;span class="line-number"&gt;31&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;32&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; IUser get(String userName){&lt;br /&gt;&lt;span class="line-number"&gt;33&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; service.get(userName);&lt;br /&gt;&lt;span class="line-number"&gt;34&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;35&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;36&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;boolean&lt;/span&gt; delete(String userName){&lt;br /&gt;&lt;span class="line-number"&gt;37&lt;/span&gt;         &lt;span class="literal"&gt;if&lt;/span&gt;(!info.isIsAdmin()){&lt;br /&gt;&lt;span class="line-number"&gt;38&lt;/span&gt;             &lt;span class="literal"&gt;throw&lt;/span&gt; &lt;span class="literal"&gt;new&lt;/span&gt; IllegalAccessError(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;You don;t have the permission to delete&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;39&lt;/span&gt;         }&lt;br /&gt;&lt;span class="line-number"&gt;40&lt;/span&gt;         System.out.println(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;users&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;+service.getUsers());&lt;br /&gt;&lt;span class="line-number"&gt;41&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; service.delete(userName);&lt;br /&gt;&lt;span class="line-number"&gt;42&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;43&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; List&amp;lt;IUser&amp;gt; users(){&lt;br /&gt;&lt;span class="line-number"&gt;44&lt;/span&gt;         &lt;span class="literal"&gt;return&lt;/span&gt; (List&amp;lt;IUser&amp;gt;)service.getUsers();&lt;br /&gt;&lt;span class="line-number"&gt;45&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;46&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;47&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;48&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;49&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;Unit test layer&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a onclick="return toggle('MockBinder')" href="#"&gt;MockBinder.java&lt;/a&gt; - As I am obsessed with fluent interface, generics &amp;amp; type safety, it's really enjoyable to wire up dependencies using Guice APIs rather than through XML.&lt;br /&gt;&lt;div style="DISPLAY: none" id="MockBinder"&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;\test\MockBinder.java&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="literal"&gt;package&lt;/span&gt; test;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; com.google.inject.AbstractModule;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; java.util.Date;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; model.AuditInfo;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; model.IUserService;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; model.UserServiceMockImpl;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt; &lt;span class="comment"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;praveenm&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt; &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;class&lt;/span&gt; MockBinder &lt;span class="literal"&gt;extends&lt;/span&gt; AbstractModule {&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt;     &lt;span class="literal"&gt;final&lt;/span&gt; &lt;span class="literal"&gt;boolean&lt;/span&gt; isAdmin;&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; MockBinder() {&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt;         isAdmin = &lt;span class="literal"&gt;false&lt;/span&gt;;&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;21&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; MockBinder(&lt;span class="literal"&gt;boolean&lt;/span&gt; isAdmin) {&lt;br /&gt;&lt;span class="line-number"&gt;22&lt;/span&gt;         &lt;span class="literal"&gt;this&lt;/span&gt;.isAdmin = isAdmin;&lt;br /&gt;&lt;span class="line-number"&gt;23&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;24&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;25&lt;/span&gt;     @Override&lt;br /&gt;&lt;span class="line-number"&gt;26&lt;/span&gt;     &lt;span class="literal"&gt;protected&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; configure() {&lt;br /&gt;&lt;span class="line-number"&gt;27&lt;/span&gt;         binder().bind(IUserService.&lt;span class="literal"&gt;class&lt;/span&gt;).to(UserServiceMockImpl.&lt;span class="literal"&gt;class&lt;/span&gt;).asEagerSingleton();&lt;br /&gt;&lt;span class="line-number"&gt;28&lt;/span&gt;         &lt;span class="literal"&gt;if&lt;/span&gt; (!isAdmin) {&lt;br /&gt;&lt;span class="line-number"&gt;29&lt;/span&gt;             binder().bind(AuditInfo.&lt;span class="literal"&gt;class&lt;/span&gt;).to(DummyAuditInfo2.&lt;span class="literal"&gt;class&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;30&lt;/span&gt;         } &lt;span class="literal"&gt;else&lt;/span&gt; {&lt;br /&gt;&lt;span class="line-number"&gt;31&lt;/span&gt;             binder().bind(AuditInfo.&lt;span class="literal"&gt;class&lt;/span&gt;).to(DummyAuditInfo.&lt;span class="literal"&gt;class&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;32&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;33&lt;/span&gt;         }&lt;br /&gt;&lt;span class="line-number"&gt;34&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;35&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;36&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;37&lt;/span&gt; &lt;span class="literal"&gt;class&lt;/span&gt; DummyAuditInfo &lt;span class="literal"&gt;extends&lt;/span&gt; AuditInfo {&lt;br /&gt;&lt;span class="line-number"&gt;38&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;39&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; DummyAuditInfo() {&lt;br /&gt;&lt;span class="line-number"&gt;40&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setIsAdmin(&lt;span class="literal"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;41&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setCreatedBy(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;Praveen M&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;42&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setCreatedDate(&lt;span class="literal"&gt;new&lt;/span&gt; Date());&lt;br /&gt;&lt;span class="line-number"&gt;43&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setUpdatedBy(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;Praveen&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;44&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setUpdatedDate(&lt;span class="literal"&gt;new&lt;/span&gt; Date());&lt;br /&gt;&lt;span class="line-number"&gt;45&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;46&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;47&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;48&lt;/span&gt; &lt;span class="literal"&gt;class&lt;/span&gt; DummyAuditInfo2 &lt;span class="literal"&gt;extends&lt;/span&gt; AuditInfo {&lt;br /&gt;&lt;span class="line-number"&gt;49&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;50&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; DummyAuditInfo2() {&lt;br /&gt;&lt;span class="line-number"&gt;51&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setIsAdmin(&lt;span class="literal"&gt;false&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;52&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setCreatedBy(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;someone&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;53&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setCreatedDate(&lt;span class="literal"&gt;new&lt;/span&gt; Date());&lt;br /&gt;&lt;span class="line-number"&gt;54&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setUpdatedBy(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;someone&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;55&lt;/span&gt;         &lt;span class="literal"&gt;super&lt;/span&gt;.setUpdatedDate(&lt;span class="literal"&gt;new&lt;/span&gt; Date());&lt;br /&gt;&lt;span class="line-number"&gt;56&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;57&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;58&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;59&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;60&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onclick="return toggle('UserTest')" href="#"&gt;UserTest.java&lt;/a&gt; - &amp;amp; now finally we have unit testing code with JUnit4 test case show-casing the usage of the applications.&lt;br /&gt;&lt;div style="DISPLAY: none" id="UserTest"&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;test\UserTest.java&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 1&lt;/span&gt; &lt;span class="literal"&gt;package&lt;/span&gt; test;&lt;br /&gt;&lt;span class="line-number"&gt; 2&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt; 3&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; com.google.inject.Guice;&lt;br /&gt;&lt;span class="line-number"&gt; 4&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; ui.IUser;&lt;br /&gt;&lt;span class="line-number"&gt; 5&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; controller.UserController;&lt;br /&gt;&lt;span class="line-number"&gt; 6&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; junit.framework.Assert;&lt;br /&gt;&lt;span class="line-number"&gt; 7&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; org.junit.BeforeClass;&lt;br /&gt;&lt;span class="line-number"&gt; 8&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; org.junit.Test;&lt;br /&gt;&lt;span class="line-number"&gt; 9&lt;/span&gt; &lt;span class="literal"&gt;import&lt;/span&gt; ui.UserForm;&lt;br /&gt;&lt;span class="line-number"&gt;10&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;11&lt;/span&gt; &lt;span class="comment"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;12&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="comment"&gt;The&lt;/span&gt; &lt;span class="comment"&gt;power&lt;/span&gt;&lt;span class="comment"&gt; &amp;amp; &lt;/span&gt;&lt;span class="comment"&gt;simplicity&lt;/span&gt; &lt;span class="comment"&gt;of&lt;/span&gt; &lt;span class="comment"&gt;JUnit4&lt;/span&gt; &lt;span class="comment"&gt;test&lt;/span&gt; &lt;span class="comment"&gt;cases&lt;/span&gt;&lt;span class="comment"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;13&lt;/span&gt; &lt;span class="comment"&gt; * &lt;/span&gt;&lt;span class="ST0"&gt;@author&lt;/span&gt; &lt;span class="comment"&gt;praveenm&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;14&lt;/span&gt;  &lt;span class="comment"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;15&lt;/span&gt; &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;class&lt;/span&gt; UserTest {&lt;br /&gt;&lt;span class="line-number"&gt;16&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;17&lt;/span&gt;     &lt;span class="literal"&gt;private&lt;/span&gt; &lt;span class="literal"&gt;static&lt;/span&gt; UserController controller;&lt;br /&gt;&lt;span class="line-number"&gt;18&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;19&lt;/span&gt;     @BeforeClass&lt;br /&gt;&lt;span class="line-number"&gt;20&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;static&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; bootStrap(){&lt;br /&gt;&lt;span class="line-number"&gt;21&lt;/span&gt;         controller = Guice.createInjector(&lt;span class="literal"&gt;new&lt;/span&gt; MockBinder(&lt;span class="literal"&gt;true&lt;/span&gt;)).getInstance(UserController.&lt;span class="literal"&gt;class&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;22&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;23&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;24&lt;/span&gt;     @Test&lt;br /&gt;&lt;span class="line-number"&gt;25&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; save(){&lt;br /&gt;&lt;span class="line-number"&gt;26&lt;/span&gt;         IUser form = &lt;span class="literal"&gt;new&lt;/span&gt; UserForm();&lt;br /&gt;&lt;span class="line-number"&gt;27&lt;/span&gt;         form.setExperience(9);&lt;br /&gt;&lt;span class="line-number"&gt;28&lt;/span&gt;         form.setEMail(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;praveen.manvi@yahoo.com&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;29&lt;/span&gt;         form.setFirstName(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;praveen&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;30&lt;/span&gt;         form.setUserName(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;pmanvi&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;31&lt;/span&gt;         form.setLastName(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;Manvi&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;32&lt;/span&gt;         Assert.assertTrue(controller.save(form));&lt;br /&gt;&lt;span class="line-number"&gt;33&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;34&lt;/span&gt;         form.setExperience(10);&lt;br /&gt;&lt;span class="line-number"&gt;35&lt;/span&gt;         form.setEMail(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;praveen.manvi@yahoo.com&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;36&lt;/span&gt;         form.setFirstName(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;praveen&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;37&lt;/span&gt;         form.setUserName(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;pmanvi123&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;38&lt;/span&gt;         form.setLastName(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;m&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;39&lt;/span&gt;         Assert.assertTrue(controller.save(form));&lt;br /&gt;&lt;span class="line-number"&gt;40&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;41&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;42&lt;/span&gt;     @Test&lt;br /&gt;&lt;span class="line-number"&gt;43&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; get(){&lt;br /&gt;&lt;span class="line-number"&gt;44&lt;/span&gt;         IUser user = controller.get(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;pmanvi&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;45&lt;/span&gt;         &lt;span class="literal"&gt;if&lt;/span&gt;(user!=&lt;span class="literal"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;span class="line-number"&gt;46&lt;/span&gt;         Assert.assertEquals(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;praveen&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;, user.getFirstName());&lt;br /&gt;&lt;span class="line-number"&gt;47&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;48&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;49&lt;/span&gt;     @Test&lt;br /&gt;&lt;span class="line-number"&gt;50&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; delete(){&lt;br /&gt;&lt;span class="line-number"&gt;51&lt;/span&gt;        &lt;span class="comment"&gt;// if(controller.get("pmanvi123")!=null) &lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;52&lt;/span&gt;             Assert.assertEquals(controller.delete(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;pmanvi123&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;), &lt;span class="literal"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;53&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;54&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;55&lt;/span&gt;     @Test(expected= IllegalAccessError.&lt;span class="literal"&gt;class&lt;/span&gt;)&lt;br /&gt;&lt;span class="line-number"&gt;56&lt;/span&gt;     &lt;span class="literal"&gt;public&lt;/span&gt; &lt;span class="literal"&gt;void&lt;/span&gt; unauhorizedDelete(){&lt;br /&gt;&lt;span class="line-number"&gt;57&lt;/span&gt;         controller = Guice.createInjector(&lt;span class="literal"&gt;new&lt;/span&gt; MockBinder(&lt;span class="literal"&gt;false&lt;/span&gt;)).getInstance(UserController.&lt;span class="literal"&gt;class&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;58&lt;/span&gt;         controller.delete(&lt;span class="character"&gt;"&lt;/span&gt;&lt;span class="character"&gt;pmanvi123&lt;/span&gt;&lt;span class="character"&gt;"&lt;/span&gt;);&lt;br /&gt;&lt;span class="line-number"&gt;59&lt;/span&gt;     }&lt;br /&gt;&lt;span class="line-number"&gt;60&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;61&lt;/span&gt; }&lt;br /&gt;&lt;span class="line-number"&gt;62&lt;/span&gt;&lt;br /&gt;&lt;span class="line-number"&gt;63&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="middle"&gt;------- Final Summary-------&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;li&gt;Guice simplifies the testing a lot doing everything in java, If you just want dependency Injection, Guice beats all other frameworks (Spring...) hands down in ease of use &lt;/li&gt;&lt;br /&gt;&lt;li&gt;JUnit4 is much easy to use with annotations &amp;amp; now we don;t have to extend any class &amp;amp; don't have to write methds with test...(). I really liked the way we can test the Exceptions &lt;/li&gt;&lt;br /&gt;&lt;li&gt;Adding interface to both backend &amp;amp; UI objects we can get rid of get/set noise.&lt;br /&gt;Although it makes(or forces) back end to be aware of UI &amp;amp; other form of clients, in some cases (like we we use ORMs instead of JDBCTemplate) one time conversion logic shifts from UI to backend &amp;amp; it might put more development load on persistent layer team. My guess is these objections can be ignored because of the benefit of to cleaner &amp;amp; less error prone code. In case of distrbuted enviornment all the extra fields can be set to null to reduce the payload, but anyway number of rows are much more important than the number of columns in deciding the data size.&lt;br /&gt;&lt;br /&gt;Hope that this sample application help new comers to understand/appreciate the value of Guice &amp;amp; JUnit4 libraries.&lt;br /&gt;&lt;br /&gt;References;&lt;br /&gt;&lt;a href="http://code.google.com/p/google-guice/"&gt;Guice &lt;/a&gt;Dependency Injection Framework from Google &lt;/li&gt;&lt;a href="http://junit.org/"&gt;JUnit 4&lt;/a&gt; - with Java5 features &amp;amp; is quite different from older versions. &lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-1210653564966591995?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xCLz3I6z5o28ccQ6ES6QBeFH2eA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xCLz3I6z5o28ccQ6ES6QBeFH2eA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xCLz3I6z5o28ccQ6ES6QBeFH2eA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xCLz3I6z5o28ccQ6ES6QBeFH2eA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/vscOsmtKt6A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/1210653564966591995/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=1210653564966591995" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/1210653564966591995?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/1210653564966591995?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/vscOsmtKt6A/dependency-injection-with-guice-junit-4.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/10/dependency-injection-with-guice-junit-4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8ASXs9cSp7ImA9WxVVGUo.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-7036667528981293617</id><published>2008-08-14T09:03:00.000-07:00</published><updated>2009-03-13T12:50:48.569-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-13T12:50:48.569-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Design" /><title /><content type="html">What value could custom client &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SDK&lt;/span&gt;&lt;/span&gt; can provide over SOAP toolkit(s)?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Single library to deal.&lt;/strong&gt;&lt;br /&gt;Developers need not have to spend time in knowing or generating stubs &amp;amp; which framework to choose for for the same (XML marshaling/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;un&lt;/span&gt;&lt;/span&gt;-marshaling).This single library client can hide this implementation methodology by exposing easy to use &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;APIs&lt;/span&gt;&lt;/span&gt; &amp;amp; hiding these techniques behind the scene using some kind of dependency injection &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;APIs&lt;/span&gt;&lt;/span&gt;. (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Jax&lt;/span&gt;&lt;/span&gt;-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;ws&lt;/span&gt;&lt;/span&gt;, Axis, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;XFire&lt;/span&gt;&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;Xstream&lt;/span&gt;&lt;/span&gt; so on...). The single library can be collection of core + optional service libraries in the same fashion provided by the Spring Like spring-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;jdbc&lt;/span&gt;&lt;/span&gt;.jar, spring-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;jndi&lt;/span&gt;&lt;/span&gt;.jar so on... with spring-core.jar as &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;kernal&lt;/span&gt;&lt;/span&gt; providing infrastructure for all other services.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Handling backward &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;compatibility&lt;/span&gt; issues&lt;/strong&gt;&lt;br /&gt;Carefully designed client &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;SDK&lt;/span&gt;&lt;/span&gt; can solve backward/upward compatibility issues without compromising on the design elegance, If we don't want to use new SOAP version, it should be OK to use existing version most of the time. Client &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;SDK&lt;/span&gt;&lt;/span&gt; can be designed in such a way user is shielded from SOAP schema changes that does not require recompilation or rebuild what so ever.For using new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;APIs&lt;/span&gt;&lt;/span&gt; user just has to drop in new library(jar) that's it. Well designed Mock objects can even save the need to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;goto&lt;/span&gt;&lt;/span&gt; sandbox during development.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Easy to use fluent &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;APIs&lt;/span&gt;&lt;/span&gt;. &lt;/strong&gt;&lt;br /&gt;Domain specific &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_16"&gt;language&lt;/span&gt; (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;DSL&lt;/span&gt;&lt;/span&gt;) design can bring lot of changes &amp;amp; provide better user experience with fail safe &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;APIs&lt;/span&gt;&lt;/span&gt;. Fluent &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;APIs&lt;/span&gt; can bring lot of +&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;ve&lt;/span&gt;&lt;/span&gt; changes. For me this is the single most important feature.&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;MailBuilder&lt;/span&gt;&lt;/span&gt;.mail().&lt;br /&gt;.from(&lt;a href="mailto:praveen.manvi@yahoo.com"&gt;praveen.manvi@yahoo.com&lt;/a&gt;)&lt;br /&gt;.to(&lt;a href="mailto:pmanvi@aol.com"&gt;pmanvi@aol.com&lt;/a&gt;)&lt;br /&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;withSubject&lt;/span&gt;&lt;/span&gt;("Fluent Mail &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;API&lt;/span&gt;&lt;/span&gt;")&lt;br /&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;withBody&lt;/span&gt;&lt;/span&gt;("Fluent &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;API&lt;/span&gt;&lt;/span&gt; &amp;amp; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;DSL&lt;/span&gt;&lt;/span&gt; can make developer life simpler")&lt;br /&gt;.attach(new File("c:/test.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;txt&lt;/span&gt;&lt;/span&gt;")).&lt;br /&gt;.send();&lt;br /&gt;&lt;br /&gt;is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_27"&gt;definitely&lt;/span&gt; much easier to use. This is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;ok&lt;/span&gt;&lt;/span&gt; for 90% of users to start, if we have hooks to get into Transport &amp;amp; other Java Mail &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;APIs&lt;/span&gt;&lt;/span&gt;,it can simplify the way we code &amp;amp; importantly understand without &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_30"&gt;compromising&lt;/span&gt; the power for advanced users.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Meaningful Exception hierarchy stack for better recoverable &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;actions&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Users don't have to deal with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;SoapFault&lt;/span&gt;&lt;/span&gt; Error code. Just like Spring &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;DAOException&lt;/span&gt;&lt;/span&gt; hierarchy translating the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;SQLException&lt;/span&gt;&lt;/span&gt; &amp;amp; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;SQL&lt;/span&gt;&lt;/span&gt; error codes giving meaningful &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;RuntimeException&lt;/span&gt;&lt;/span&gt; (even &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;exteding&lt;/span&gt;&lt;/span&gt; it to hibernate, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;ibatis&lt;/span&gt;&lt;/span&gt;,&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;jpa&lt;/span&gt;&lt;/span&gt;) &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;API&lt;/span&gt; providers can make developer's life easier. Like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;SQLException&lt;/span&gt;&lt;/span&gt; &amp;amp; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;SQL&lt;/span&gt;&lt;/span&gt; error code &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;APIFaultException&lt;/span&gt;&lt;/span&gt; &amp;amp; fault code is difficult use &amp;amp; introduces lot of boiler plate code (because of checked exception) without providing the meaningful recovery options. Hibernate, Spring &amp;amp; C# have proved that checked exception is like communism, works best in theory only.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/dao.html"&gt;http://static.springframework.org/spring/docs/2.5.x/reference/dao.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Automatic logging soap XML handshake&lt;/strong&gt; (Making this switch on &amp;amp; off on need basis) between client &amp;amp; server. This comes as very handy &amp;amp; we can even make them &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_42"&gt;asynchronous&lt;/span&gt; &amp;amp; log this information to to different data sources like file &amp;amp; database by providing proper hooks. This automation improves the performance as well as avoids the need to develop auditing &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;APIs&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Most of error handling/validation&lt;/strong&gt; can done by the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;SDK&lt;/span&gt; framework, there is very less chance for error requests coming to server improving server performance. 99% of the time server will deal with valid requests&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. Meaningful defaults for all the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;APIs&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt; &amp;amp; actions, can reduce initial learning curve &amp;amp; improve the perception. It can help user to get into the the details step by step instead of throwing him everything upfront.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. Can enforce the best practices&lt;/strong&gt;. &amp;amp; develop new interfaces that are very difficult to achieve with simple plane SOAP.&lt;br /&gt;&lt;br /&gt;For example a utility can be developed to export the data in chunks from large files like Excel sheet, a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;csv&lt;/span&gt;&lt;/span&gt; file or a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;PDF&lt;/span&gt;&lt;/span&gt;., as the sending large files &amp;amp; batch processing with SOAP is not mature (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;mtom&lt;/span&gt;&lt;/span&gt;...)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9. Encourage more developer community participation.&lt;/strong&gt; Easy to use &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;APIs&lt;/span&gt;&lt;/span&gt; improves the possibility of&lt;br /&gt;developer to develop new tools &amp;amp; application using the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;SDK&lt;/span&gt;&lt;/span&gt; especially desktop tools.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;10. Get rid technical limitation of programming technique. &lt;/span&gt;SOAP inherintly not object orieneted &amp;amp; it's procedural style of programming is not what a modren developer would like to work.&lt;br /&gt;&lt;br /&gt;I just evaluated different &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;SDK&lt;/span&gt; provided by various well known &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;API&lt;/span&gt; providers &amp;amp; most of them don't really provide above facilities &amp;amp; there is very good opportunity of 3'rd party developers to fill the gap over here.&lt;br /&gt;&lt;br /&gt;Same concepts can be carried out for developing C# APIs. As for as dynamic langauges(Groovy,Ruby, PHP) concerned I guess they don't need any SDK, they are smart enough to deal with XML directly without any code generation.&lt;br /&gt;&lt;br /&gt;Many a times developers need to design wrappers over SOAP apis -- that involves substantial effort. Client &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;SDK&lt;/span&gt;&lt;/span&gt; can save the time &amp;amp; money here. Like Spring removed the necessity of having in-house framework for standard java enterprise project by not tying the implementation any specific technology but to the interface &amp;amp; also &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;DSL&lt;/span&gt; developed with business in mind can make writing code like writing an essay.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://developer.ebay.com/DevZone/XML/docs/HowTo/BestPractices/JavaToJsdkToSoap.html"&gt;http://developer.ebay.com/DevZone/XML/docs/HowTo/BestPractices/JavaToJsdkToSoap.html&lt;/a&gt; - eBay SOAP &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;SDK&lt;/span&gt;&lt;/span&gt; sample&lt;br /&gt;&lt;a href="https://www.paypal.com/IntegrationCenter/ic_sdk-resource.html"&gt;https://www.paypal.com/IntegrationCenter/ic_sdk-resource.html&lt;/a&gt; - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_57"&gt;Paypal&lt;/span&gt;&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_58"&gt;API&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/fluentmailapi/"&gt;http://code.google.com/p/fluentmailapi/&lt;/a&gt; - Fluent Mail &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_59"&gt;APIs&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.javaworld.com/javaworld/jw-08-2008/jw-08-dsls-in-java-3.html"&gt;http://www.javaworld.com/javaworld/jw-08-2008/jw-08-dsls-in-java-3.html&lt;/a&gt; - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_60"&gt;DSL&lt;/span&gt;&lt;/span&gt; in java&lt;br /&gt;&lt;a href="http://www.toolsforteams.com/code/facebook-api/"&gt;http://www.toolsforteams.com/code/facebook-api/&lt;/a&gt; - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_57"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_61"&gt;Facebook&lt;/span&gt;&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_58"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_62"&gt;APis&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/java-twitter/"&gt;http://code.google.com/p/java-twitter/&lt;/a&gt; - Twitter &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_59"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_63"&gt;APIs&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/tech/soa/mastering-soa-series/part4.html"&gt;http://www.oracle.com/technology/tech/soa/mastering-soa-series/part4.html&lt;/a&gt; - Rich &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_60"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_64"&gt;UI&lt;/span&gt;&lt;/span&gt; for web services&lt;br /&gt;&lt;a href="http://www.javabeat.net/articles/29-introduction-to-google-guice-5.html"&gt;http://www.javabeat.net/articles/29-introduction-to-google-guice-5.html&lt;/a&gt; - &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_61"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_65"&gt;Guice&lt;/span&gt;&lt;/span&gt; Samples&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-7036667528981293617?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EBnVU7FMQCkx_01YLlE-f4x4-pU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EBnVU7FMQCkx_01YLlE-f4x4-pU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EBnVU7FMQCkx_01YLlE-f4x4-pU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EBnVU7FMQCkx_01YLlE-f4x4-pU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/pfVWoZPK3is" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/7036667528981293617/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=7036667528981293617" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7036667528981293617?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/7036667528981293617?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/pfVWoZPK3is/what-value-could-custom-client-sdk-can.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/08/what-value-could-custom-client-sdk-can.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUICQXw5eip7ImA9WxVVFkQ.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-6642521323495764071</id><published>2008-07-24T10:08:00.000-07:00</published><updated>2009-03-10T06:59:20.222-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-10T06:59:20.222-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Design" /><title /><content type="html">Some wise words on design - I recently was listening to a presentation in &lt;a href="http://www.infoq.com/"&gt;&lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;InfoQ&lt;/span&gt;&lt;/span&gt; &lt;/a&gt;on  design principles of successful large scale enterprise financial application based on Spring &amp;amp; Hibernate. I noted some points while listening to that. Although these are well known established principles I thought it's easier to refer &amp;amp; document when ever we need to come up new design document.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Minimize data movement&lt;/li&gt;&lt;li&gt;Task &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-corrected"&gt;&lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;Parallel execution where ever possible&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Physically partition of data&lt;/li&gt;&lt;li&gt;Optimized reads &amp;amp; writes of volatile data&lt;/li&gt;&lt;li&gt;Minimize contention -- Different connection pooling &lt;/li&gt;&lt;li&gt;&lt;span id="SPELLING_ERROR_2" class="blsp-spelling-corrected"&gt;Asynchronous&lt;/span&gt; Decoupling &lt;/li&gt;&lt;li&gt;Complete Business Logic performed by data&lt;/li&gt;&lt;li&gt;Caching frequently  accessed data&lt;/li&gt;&lt;/ul&gt;Like all popular scalable architecture (eBay, Yahoo) the transaction (&lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;distrubuted&lt;/span&gt;) &amp;amp; state management were simple (stateless &amp;amp; &lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;transactionless&lt;/span&gt; for 90% of operations)&lt;br /&gt;&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;JDBCTemplate&lt;/span&gt;&lt;/span&gt; - fantastic example of Dependency injection&lt;br /&gt;Spring promotes good design - modularity, loose coupling &lt;span id="SPELLING_ERROR_4" class="blsp-spelling-corrected"&gt;separation&lt;/span&gt; of concerns&lt;br /&gt;Testability provides better confidence for &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;refactoring&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Hibernate promotes domain driven design - 2'&lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;nd&lt;/span&gt;&lt;/span&gt; level caching is gr8&lt;br /&gt;&lt;br /&gt;Contents of design document can be &lt;span id="SPELLING_ERROR_7" class="blsp-spelling-corrected"&gt;divided&lt;/span&gt; into following &lt;span id="SPELLING_ERROR_8" class="blsp-spelling-corrected"&gt;categories&lt;/span&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Architectural review &lt;/li&gt;&lt;li&gt;&lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;Jumpstart&lt;/span&gt;&lt;/span&gt; programs &lt;/li&gt;&lt;li&gt;Deployment strategy &lt;/li&gt;&lt;li&gt;Platform change &lt;/li&gt;&lt;li&gt;Proof of concept &lt;/li&gt;&lt;li&gt;Performance tuning &lt;/li&gt;&lt;li&gt;Development&lt;/li&gt;&lt;/ul&gt;Capacity Planning questions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;How much memory footprint the application requires &lt;/li&gt;&lt;li&gt;How many threads the application components need &lt;/li&gt;&lt;li&gt;How many connections each application has to handle &lt;/li&gt;&lt;li&gt;How many system resources like file handles are required &lt;/li&gt;&lt;li&gt;How much parallelism is attainable in a single process &lt;/li&gt;&lt;li&gt;How many &lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;CPUs&lt;/span&gt;&lt;/span&gt; can be leveraged at the same time from within the same hardware &lt;/li&gt;&lt;li&gt;What are the synchronization primitives available in case of multiple processes and nodes &lt;/li&gt;&lt;li&gt;How we coordinate shared accesses and leases &lt;/li&gt;&lt;li&gt;The allowable number of nodes that a unit of application job can cross, taking into consideration the performance criterion &lt;/li&gt;&lt;/ul&gt;I also listened to &lt;a href="http://www.youtube.com/watch?v=ZOwHiGCzZjo"&gt;Joshua Bloch's presentation&lt;/a&gt; on design guide lines, Joshua Bloch is currently Java Architect at Google &amp;amp; has great influence on Java's future&lt;span id="SPELLING_ERROR_11" class="blsp-spelling-corrected"&gt;&lt;/span&gt;. He also influenced (&lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;JDK&lt;/span&gt;&lt;/span&gt;5) &amp;amp; wrote many JDK classes as distinguished Engineer at Sun. His assertions carries lot of weight.&lt;br /&gt;Importance of &lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;API&lt;/span&gt;&lt;/span&gt; design for internal and external use.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Public &lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;APIs&lt;/span&gt;&lt;/span&gt; are forever - one chance to get it right&lt;/li&gt;&lt;li&gt;Good code is modular–each module has an &lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;API&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Thinking in terms of &lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;APIs&lt;/span&gt;&lt;/span&gt; improves code quality&lt;/li&gt;&lt;li&gt;Easy to use, even without documentation&lt;/li&gt;&lt;li&gt;Don’t let implementation details “leak” into &lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;API&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Make classes and members as private as possible&lt;/li&gt;&lt;/ul&gt;I guess the most important one was "&lt;span style="font-weight: bold;"&gt;when in doubt, don't provide the &lt;/span&gt;&lt;span style="font-weight: bold;" id="SPELLING_ERROR_18" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;API&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;, leave it&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;"There's a natural law in programming language and &lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;API&lt;/span&gt; design : as backwards compatibility increases, elegance decreases." - Bill &lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;Venners&lt;br /&gt;So be minimalist, &lt;/span&gt;because of the compatibility requirement, &lt;b&gt;it's much easier to put things in  than to take them out&lt;/b&gt;. So don't add anything to the API that you're not sure  you need&lt;br /&gt;&lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-6642521323495764071?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6Cg69pAUWcbnZq1GtTRbdjvd3Hc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6Cg69pAUWcbnZq1GtTRbdjvd3Hc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6Cg69pAUWcbnZq1GtTRbdjvd3Hc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6Cg69pAUWcbnZq1GtTRbdjvd3Hc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/5MiYWYPZhAc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/6642521323495764071/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=6642521323495764071" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/6642521323495764071?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/6642521323495764071?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/5MiYWYPZhAc/some-wise-words-on-design-i-recently.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/07/some-wise-words-on-design-i-recently.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcESHgzeip7ImA9WxdWGUo.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-8977736712289785861</id><published>2008-07-13T01:39:00.000-07:00</published><updated>2008-07-13T11:00:09.682-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-13T11:00:09.682-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SWING" /><category scheme="http://www.blogger.com/atom/ns#" term="General" /><title /><content type="html">&lt;p&gt;Bio-&lt;span id="SPELLING_ERROR_0" class="blsp-spelling-corrected"&gt;Rhythmic&lt;/span&gt; Cycles - I got curious about bio-&lt;span id="SPELLING_ERROR_1" class="blsp-spelling-corrected"&gt;rhythmic&lt;/span&gt; cycles &amp;amp; wanted to try out the the results on my life.&lt;/p&gt;&lt;p&gt;For those who don't know what bio &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-corrected"&gt;rhythmic&lt;/span&gt; cycles are, here is &lt;a href="http://en.wikipedia.org/wiki/Biorhythm"&gt;explanation:&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;The theory of biorhythms claims that one's life is affected by rhythmic biological cycles, and seeks to make predictions regarding these cycles and the personal ease of carrying out tasks related to the cycles. These inherent rhythms are said to control or initiate various biological processes and are classically composed of three cyclic rhythms that are said to govern &lt;/span&gt;&lt;/em&gt;&lt;a title="Human" href="http://en.wikipedia.org/wiki/Human"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;human&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt; behavior and demonstrate innate periodicity in natural physiological change: the &lt;/span&gt;&lt;/em&gt;&lt;a title="Body" href="http://en.wikipedia.org/wiki/Body"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;physical&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;, the &lt;/span&gt;&lt;/em&gt;&lt;a title="Emotion" href="http://en.wikipedia.org/wiki/Emotion"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;emotional&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;, and the &lt;/span&gt;&lt;/em&gt;&lt;a title="Intellectual" href="http://en.wikipedia.org/wiki/Intellectual"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;intellectual&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt; (or &lt;/span&gt;&lt;/em&gt;&lt;a title="Mind" href="http://en.wikipedia.org/wiki/Mind"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;mental&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;) cycles. Others claim there are additional rhythms, some of which may be combinations of the three primary cycles. Some proponents think that biorhythms may be potentially related to &lt;/span&gt;&lt;/em&gt;&lt;a class="mw-redirect" title="Bioelectricity" href="http://en.wikipedia.org/wiki/Bioelectricity"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;bioelectricity&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt; and its interactions in the body&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I wrote a sample application in swing, which basically takes the date of birth as input &amp;amp; generate the charts.&lt;/p&gt;&lt;a href="http://bp0.blogger.com/_uvIefXZeOnk/SHogp-j5bRI/AAAAAAAAADE/37gnye_0n28/s1600-h/bio.bmp"&gt;&lt;img style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5222522623429799186" border="0" alt="" src="http://bp0.blogger.com/_uvIefXZeOnk/SHogp-j5bRI/AAAAAAAAADE/37gnye_0n28/s320/bio.bmp" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Here is the sample screenshot, I used &lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;JFreecharts&lt;/span&gt; &amp;amp; some Date manipulating &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;APIs&lt;/span&gt; to create above application. BTW is there any way I can show applet in this blog? Please let me know.&lt;/p&gt;&lt;p&gt;The results were interesting, Most of the events in my life had some kind of correlation with the above graph &amp;amp; explanation:&lt;/p&gt;&lt;p&gt;Physical cycle - 23 days; coordination strength well-being &lt;/p&gt;&lt;p&gt;Emotional cycle - 28 days; creativity sensitivity mood perception awareness &lt;/p&gt;&lt;p&gt;Intellectual cycle - 33 days; alertness analytical functioning logical analysis memory or recall communication &lt;/p&gt;&lt;p&gt;I also tried correlate our god &lt;a href="http://stats.cricinfo.com/statsguru/engine/player/35320.html?class=2;orderby=batted_score;template=results;type=batting;view=innings"&gt;&lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;Sachin's&lt;/span&gt; best innings &lt;/a&gt;with these cycles &amp;amp; &lt;span id="SPELLING_ERROR_9" class="blsp-spelling-corrected"&gt;surprisingly,&lt;/span&gt; cycle behaviour used to match with his best time :-)&lt;/p&gt;&lt;p&gt;Anyway I will try out with some other important figures before coming to conclusion these cycles have any impact or it's just a humbug. BTW, I am little skeptical about all astrology stuff.&lt;/p&gt;&lt;p&gt;So I am planning to develop a &lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;RESTful&lt;/span&gt; sample as well sample mobile application accepting date of birth &amp;amp; generating the charts possibly using Google charts instead of Jfreecharts&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-8977736712289785861?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KLXP9DCYPcmYzMq7FMQi19WvSkM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KLXP9DCYPcmYzMq7FMQi19WvSkM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KLXP9DCYPcmYzMq7FMQi19WvSkM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KLXP9DCYPcmYzMq7FMQi19WvSkM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/by79-vOGofQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/8977736712289785861/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=8977736712289785861" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/8977736712289785861?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/8977736712289785861?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/by79-vOGofQ/bio-rhythmic-cycles-i-got-curious-about.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp0.blogger.com/_uvIefXZeOnk/SHogp-j5bRI/AAAAAAAAADE/37gnye_0n28/s72-c/bio.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/07/bio-rhythmic-cycles-i-got-curious-about.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MHQnY4cCp7ImA9WxRXEkg.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-6789853897778102097</id><published>2008-07-09T10:24:00.000-07:00</published><updated>2008-10-17T06:50:33.838-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-17T06:50:33.838-07:00</app:edited><title /><content type="html">&lt;a href="http://www.geonames.org/"&gt;&lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;GeoNames&lt;/span&gt;.org&lt;/a&gt; - provides &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;geocoding&lt;/span&gt; services. &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;GeoNames&lt;/span&gt; provide a huge databases of place names (with coordinates) organized in a hierarchy (&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;eg&lt;/span&gt;. country/state/region/province/etc...). Also there is a query that allows to retrieve the &lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;geo tags&lt;/span&gt; within a range from a specific point. &lt;span class="blsp-spelling-error"&gt;Geonames&lt;/span&gt; is integrating geographical data such as names of places in various languages,elevation, population, alternate names, Administrator division type,continent, Address,timezone &amp;amp; weather observation.&lt;br /&gt;&lt;br /&gt;Geonames provides &lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;RESTful&lt;/span&gt; based &lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;webservices&lt;/span&gt; with both XML &amp;amp; &lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;JSON&lt;/span&gt; rendering. These seems to defined by seasoned developer &amp;amp; have Style enum (Short,Medium,Long, Full) for defining result verbosity &amp;amp; many such developer friendly criteria APIs.&lt;br /&gt;&lt;br /&gt;For off-line applications, geographical database is available for download free of charge under a creative commons distrubution license &amp;amp; can leverage the service by downloading all the data. Geonames.org claims that it has already serving up to over 3 million web service requests per day &amp;amp; has the ability scale.&lt;br /&gt;&lt;br /&gt;I guess applications (especially free &amp;amp; open source ones) have excellent opportunity to integrate with this service. &lt;span id="SPELLING_ERROR_9" class="blsp-spelling-corrected"&gt;Web applications&lt;/span&gt; can be relieved from maintaining the huge database of &lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;geo&lt;/span&gt; services. They can just store the &lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;geo&lt;/span&gt;-ids &amp;amp; can rely &lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;geonames&lt;/span&gt; to fetch the details. Hierarchical data is always to difficult store &amp;amp; fetch in standard &lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;RDBMS&lt;/span&gt; &amp;amp; now there is no need to maintain this data. GeoNames includes the reference implementation in all popular languages. I just checked the java implementation &amp;amp; it was not that good. It could be have been made more easier (or fluent).&lt;br /&gt;&lt;br /&gt;The important point to note is that high-profile users of GeoNames include Slide.com &amp;amp; LinkedIn.&lt;br /&gt;&lt;br /&gt;Reference&lt;br /&gt;&lt;a href="http://www.geonames.org/export/ws-overview.html"&gt;http://www.geonames.org/export/ws-overview.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.geonames.org/export/place-hierarchy.html"&gt;http://www.geonames.org/export/place-hierarchy.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/GeoNames"&gt;http://en.wikipedia.org/wiki/GeoNames&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-6789853897778102097?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/q5kooENZjRjrBNNRhLixN3YZXE4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/q5kooENZjRjrBNNRhLixN3YZXE4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/q5kooENZjRjrBNNRhLixN3YZXE4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/q5kooENZjRjrBNNRhLixN3YZXE4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/fj7MxUdduHA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/6789853897778102097/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=6789853897778102097" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/6789853897778102097?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/6789853897778102097?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/fj7MxUdduHA/geonames.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/07/geonames.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04DQn86cSp7ImA9WxdbGEs.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-8979571561006816094</id><published>2008-06-22T08:13:00.000-07:00</published><updated>2008-08-15T23:59:33.119-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-15T23:59:33.119-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title /><content type="html">&lt;u&gt;Some notes on web services, REST &amp;amp; Fluent Interface&lt;/u&gt;. &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-corrected"&gt;Theoretically&lt;/span&gt; we can make use any language to write web service client, &amp;amp; of course that's the exact reason web service was invented offering &lt;strong&gt;loose coupling&lt;/strong&gt; for implementing &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-corrected"&gt;distributed&lt;/span&gt; computing &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-corrected"&gt;environment for businesses&lt;/span&gt;. But there were many requirements (schema definition/validaion, security,performance, service &lt;span id="SPELLING_ERROR_3" class="blsp-spelling-corrected"&gt;discovery&lt;/span&gt;, SLAs,BLAs, language etc..) to achieve &lt;strong&gt;high &lt;/strong&gt;&lt;span id="SPELLING_ERROR_4" class="blsp-spelling-corrected"&gt;&lt;strong&gt;cohesion, &lt;/strong&gt;hence SOAP, XML, UDDI &amp;amp; WSDL were necessary. I guess for most of integrations these technologies make developer's life un-necessarily tougher &amp;amp; are forced to learn/unlearn these vocabulary.They are all XML-RPC in disguise &amp;amp; may not be much better than the existing binary RPC solutions (RMI,CORBA, COM...). I am leaning towards REST proponents who are arguing that this complexity is not really worth of benefits it offers &amp;amp; is really waste of time, bandwidth &amp;amp; finally money. These are looking similar to EJBs as I am going through this &lt;a href="http://www.amazon.com/gp/product/0596529260?tag=zoomii-20"&gt;book &lt;/a&gt;(considered as first printed book on REST)&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-corrected"&gt;If we see the existing web service landscape (I am referring WSDL, SOAP only), most of them are giving SDK for different languages (eBay SDK, Google Data API...) proving that SDK is more important than the WSDL. SDK always beats the SOAP toolkit hands down.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SOAP prevent independent evolution of client &amp;amp; server. For exampleSOAP toolkits provide (Jax-ws,Axis) code generation with strongly typed APIs, even adding new optional parameter, system will break until we generate thte stub again,Which basically diefies the logic of loose coupling.&lt;br /&gt;&lt;br /&gt;With REST,HTML forms provide default &amp;amp; hidden variables,Service end point change is effortless, we can have re-directs based on situation &amp;amp; also partition, scale well depending on the requirements.Means don't have redeploy &amp;amp; test specifically for this.&lt;br /&gt;&lt;br /&gt;separating reads from writes. SOAP has no inherent support for this, although we can design.&lt;br /&gt;caching GET requests including hardware solutions, Caching @ HTTP always yields better results.&lt;br /&gt;compression: Since REST uses HTTP, you can use compression such as gzip.&lt;br /&gt;No need for additional jars or library&lt;br /&gt;explorability -clicking around a RESTful API in their browser &amp;amp; use right away.&lt;br /&gt;REST architecture serves as the basis for the most biggest and most successful information system the world has ever seen&lt;br /&gt;&lt;br /&gt;Cons of REST&lt;br /&gt;security: Though, security considered as weakest area of REST not sure why (HTTPS, authentic)&lt;br /&gt;Tools will make working with SOAP just simple, IDE &amp;amp; tools cannot provide same kind features as SOAP to REST.&lt;br /&gt;(Anyway we had same arguments for using EJB in the past as well)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-corrected"&gt;Here is a sample &lt;a href="http://searchmarketing.yahoo.com/developer/docs/V4/sample_code/YahooEWSClient.java"&gt;Java APIs &lt;/a&gt;for web service APIs to help out developer community to directly working java instead of WSDL. I noted following points from going through the code.&lt;/span&gt;&lt;br /&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;/span&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-corrected"&gt;Contains 28 methods &amp;amp; 768 lines&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-corrected"&gt;Expects user to update the Source code or use the properties file to inject startup values (Namely username, password, AccountID so on &amp;amp; so forth) &amp;amp; is not easy to pass/change these values @ runtime.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-corrected"&gt;Uses Exception, RemoteException providing little recovery options from service faults &amp;amp; forcing client code to become ugly, clearing suggesting RuntimeExceptions are better suited here to use.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-corrected"&gt;One single class for many APIs, making shpping client API size bigger if we want to deal with single API only&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-corrected"&gt;No way to see the SOAP XML files that get handshaked b/w client &amp;amp; server. &lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-corrected"&gt;Uses Axis for marshalling/unmarshiling, We have Sun benchmarks suggesting latest jax-ws API/implementaion beat Axis/xfire hands down.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-corrected"&gt;The API is not fluent (or user friendly) &amp;amp; does not make use latest JDK1.5 APIs&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span class="blsp-spelling-corrected"&gt;Uses lot of Array values as input/output params making client code &lt;span id="1" class="transl_class" title="Click to correct"&gt;uglier&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="blsp-spelling-corrected"&gt;Before providing my solution for this I do understand that I don't have much knowledge of the context (of client applications) using the APIs. So please be adviced I might have over-looked many issues. &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;I generated stub code using jax-ws APIs &amp;amp; netbeans. JAX-WS is the successor to JAX-RPC. It requires Java 5.0, and is not backwards-compatible to JAX-RPC.Netbeans has amazing plugins for about everything! I also wrote some wrappers around the &lt;em&gt;campaign service API&lt;/em&gt; &amp;amp; here is how client code looke in the JUnit test case. (BTW JUnit4 has amazing features with POJO annotations &amp;amp; I guess this unit testing library is the best testimonial of effective usage of the java annotations.)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;Now JDK6 users can turn their normal POJO in to web services and deploy it with ease without getting to deal with different web services stack. Before JDK6 one had to download some webservices toolkit and learn how to use&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;@Test&lt;br /&gt;public void testGetCampaigns() {&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;List&amp;lt;Campaign&amp;gt;campaigns = new CampaignServiceTemplate() {&lt;br /&gt;@Override&lt;br /&gt;public YAccount getYAccount() {&lt;br /&gt;return YAccount.builder.userName("uyiui")&lt;br /&gt;.password("test123")&lt;br /&gt;.license("uyiuu7687687gg")&lt;br /&gt;.masterAccountID("988533")&lt;br /&gt;.accountId("2086880350")&lt;br /&gt;.build();&lt;br /&gt;}&lt;br /&gt;}.getCampaigns(13897897l,797897l, 89678l);&lt;br /&gt;Assert.assertNotNull(campaigns);&lt;br /&gt;}&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="blsp-spelling-corrected"&gt;Above code definately looks much cleaner easy to use. It makes use of generics, varargs, SOAPHandler java-ws interceptor,template pattern &amp;amp; fluent interface to make code look simpler &amp;amp; robust by validating all the inputs that takes care of all the issues I listed above sample code. &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;One task which I wanted to avoid was generating the source using tools Axis/jax-ws, if I want to write some adhoc testing I don't think doing in java make really sense. Ruby, Groovy where dynamic class reference options are amazing solutions here.&lt;/span&gt;&lt;/p&gt;&lt;span class="blsp-spelling-corrected"&gt;For stock quote client Groovy code looks something like this.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;import groovyx.net.ws.WSClient&lt;br /&gt;proxy = new WSClient("http://www.webservicex.net/stockquote.asmx?WSDL", this.class.classLoader)&lt;br /&gt;quote = proxy.GetQuote('YHOO')&lt;br /&gt;print quote&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="blsp-spelling-corrected"&gt;We, Java programmers are unable to make use of Groovy APIs like this, we will be the losers. Coding can't be simpler/easier than this :-)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;But don't get me wrong, Java has a place &amp;amp; will continue to occupy the major portions of software development as Joshua Bloch says "One thing that makes Java such a pleasure to use is that it is a safe language."&lt;/span&gt;&lt;/p&gt;&lt;span class="blsp-spelling-corrected"&gt;So when we stick to Java,fluent interface or easy to use APIs have lot of importance.A fluent interface is a DSL embedded in a language,it consists of a set of classes that have been organized to allow you to write code that nearly reads as English essay. Beautiful Code is often associated with essay-writing.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;Reference:&lt;/span&gt;&lt;/p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;a href="http://nerddawg.blogspot.com/2004/11/close-look-at-immutable-objects.html"&gt;Immutable objects improves the code reliability. &lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;a href="http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-bloch.html"&gt;Joshua bloch discusses about the design consideration&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;a href="http://weblogs.java.net/blog/kohsuke/archive/2007/02/jaxws_ri_21_ben.html"&gt;Jax-ws faster than Axis - Benchmarks&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;a href="http://www.javaworld.com/javaworld/jw-11-2007/jw-11-webserviceclient.html"&gt;Java options for writing web service clients&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;a href="http://www.soapui.org/"&gt;SoapUI &lt;/a&gt;has wonderful set of applications &amp;amp; plugins to make web service testinf very easy task. I tried out their NetBeans plug in , It's simply amazing.SoapUI is a great tool for any developer who wants to test web services to verify that they are working correctly.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;a href="http://java.dzone.com/articles/functional-web-services-1"&gt;Good DZone link&lt;/a&gt; explaining functional testing using these APIs. I will update my experience after trying these out.&lt;/span&gt;&lt;/p&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;a href="http://www.gotapi.com/"&gt;GoAPI&lt;/a&gt; -&gt; Good for searching APIs.&lt;br /&gt;&lt;a href="http://www.dehora.net/journal/2008/08/15/rest-as-an-engineering-discipline/"&gt;Restas Architecture  &lt;/a&gt;- "&lt;/span&gt;Simpler is better, and REST is generally simpler than SOAP"&lt;br /&gt;&lt;span class="blsp-spelling-corrected"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-8979571561006816094?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2HtZYHhXWeWoSdFl_PSrRxm1A0g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2HtZYHhXWeWoSdFl_PSrRxm1A0g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2HtZYHhXWeWoSdFl_PSrRxm1A0g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2HtZYHhXWeWoSdFl_PSrRxm1A0g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/YJYzURocjo0" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/8979571561006816094?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/8979571561006816094?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/YJYzURocjo0/web-service-client-fluent-interface.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><feedburner:origLink>http://praveendiary.blogspot.com/2008/06/web-service-client-fluent-interface.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcMQ3o4eSp7ImA9WxdWGUo.&quot;"><id>tag:blogger.com,1999:blog-31568098.post-4909746846606743766</id><published>2008-06-08T07:42:00.000-07:00</published><updated>2008-07-13T11:18:02.431-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-13T11:18:02.431-07:00</app:edited><title /><content type="html">&lt;a href="http://en.wikipedia.org/wiki/Java_logging_frameworks"&gt;Java Logging Framework&lt;/a&gt;s - why to use &lt;a href="http://www.slf4j.org/"&gt;&lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;sl&lt;/span&gt;&lt;/span&gt;4j&lt;/a&gt;?&lt;br /&gt;One of my friend was asking why should I with &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;sl&lt;/span&gt;&lt;/span&gt;4j over log4j &amp;amp; java logging. My answer was "because it was written by the same author who wrote log4j &amp;amp; is now adopted by finest java framework authors (Tapestry &amp;amp; Wicket)" sl4j is the best available way to solve logging problems. It's latest &amp;amp; hence best suited for any new projects. This way some decisions are easy &amp;amp; safe to make. Logging is one of the most boring &amp;amp; non-&lt;span id="SPELLING_ERROR_2" class="blsp-spelling-corrected"&gt;debatable&lt;/span&gt; topic. At least for issues like this it's best to follow the best minds. During my initial days of coding I have seen mindless java wrappers over existing logging frameworks without any value addition. Log4j is &lt;span id="SPELLING_ERROR_3" class="blsp-spelling-corrected"&gt;definitely&lt;/span&gt; superior option to standard java logging both in terms of speed &amp;amp; availability of &lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;appenders&lt;/span&gt;&lt;/span&gt;. But when we write client apps or want to make our jar size compact &amp;amp; cannot afford to include log4j.jar java logging might be still better option which is rare case anyway. With log4j , in order to bypass the expensive string concatenation if statement was necessary. It would have been nice if &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;APIs&lt;/span&gt;&lt;/span&gt; to provide some features that would alleviate things like this, and maybe make it easier to toggle the display of log statements for code readability.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;if (log.&lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;isDebugEnabled&lt;/span&gt;&lt;/span&gt;()){ &lt;/em&gt;&lt;br /&gt;&lt;em&gt;log.debug("Logging " + String.&lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;valueOf&lt;/span&gt;&lt;/span&gt;(a) + "some information :"+&lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;someBigEntity&lt;/span&gt;&lt;/span&gt;.&lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;toString&lt;/span&gt;&lt;/span&gt;());&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;I never liked double if conditions. Less if conditions directly proportional to good code quality.&lt;br /&gt;&lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;sl&lt;/span&gt;4j utilizes &lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;parameterized&lt;/span&gt; messaging (like logger.debug("The new value {} is replacing {}.", &lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;newValue&lt;/span&gt;, &lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;oldValue&lt;/span&gt;);) &amp;amp; &lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;does'nt&lt;/span&gt; have class loader &amp;amp; memory leak problem. As &lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;JVM&lt;/span&gt;&lt;/span&gt; is becoming smarter &amp;amp; smarter with every new version, micro bench marking &lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;knowledge are&lt;/span&gt; becoming totally &lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;ir&lt;/span&gt;&lt;/span&gt;&lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_17" class="blsp-spelling-corrected"&gt;relevant.&lt;/span&gt;&lt;/span&gt; The experience is becoming baggage &amp;amp; anti pattern most of the time as for micro bench marking is concerned.&lt;br /&gt;&lt;br /&gt;Here is one &lt;span id="SPELLING_ERROR_18" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_18" class="blsp-spelling-corrected"&gt;experiment&lt;/span&gt;&lt;/span&gt; I did with latest &lt;span id="SPELLING_ERROR_19" class="blsp-spelling-error"&gt;JVM&lt;/span&gt; with decompilation .&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;public class &lt;span id="SPELLING_ERROR_20" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_20" class="blsp-spelling-error"&gt;JavaLogTest&lt;/span&gt;&lt;/span&gt; {&lt;/em&gt;&lt;br /&gt;&lt;em&gt;// Get status from Logger.&lt;span id="SPELLING_ERROR_21" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_21" class="blsp-spelling-error"&gt;isDebugEnabled&lt;/span&gt;&lt;/span&gt;(); &lt;/em&gt;&lt;br /&gt;&lt;em&gt;private static final &lt;span id="SPELLING_ERROR_22" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_22" class="blsp-spelling-error"&gt;boolean&lt;/span&gt;&lt;/span&gt; DEBUG=false; &lt;/em&gt;&lt;br /&gt;&lt;em&gt;public static void main(String[] &lt;span id="SPELLING_ERROR_23" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_23" class="blsp-spelling-error"&gt;args&lt;/span&gt;&lt;/span&gt;) { &lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;if(DEBUG) { &lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;System.out.println("Performance issue"); &lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;debug("Some Big"+"&lt;span id="SPELLING_ERROR_24" class="blsp-spelling-corrected"&gt;Concatenation&lt;/span&gt; here"+"&amp;amp; also creation of objects.... "+new java.util.Date()+" which is not good for performance"); &lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;}&lt;br /&gt;&lt;/strong&gt;debug("testing"+" ! testing again");&lt;/em&gt;&lt;br /&gt;&lt;em&gt;debug("testing"+new Integer(10).&lt;span id="SPELLING_ERROR_25" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_24" class="blsp-spelling-error"&gt;toString&lt;/span&gt;&lt;/span&gt;() +new java.util.Date()); &lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;&lt;em&gt;public static void debug(String &lt;span id="SPELLING_ERROR_26" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_25" class="blsp-spelling-error"&gt;str&lt;/span&gt;&lt;/span&gt;){ &lt;/em&gt;&lt;br /&gt;&lt;em&gt;System.out.println(str); &lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;I &lt;span id="SPELLING_ERROR_27" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_26" class="blsp-spelling-error"&gt;decompiled&lt;/span&gt;&lt;/span&gt; the class with &lt;span id="SPELLING_ERROR_28" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_27" class="blsp-spelling-error"&gt;decompiler&lt;/span&gt;&lt;/span&gt; &amp;amp; here is the result what I got;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;import java.io.PrintStream;&lt;br /&gt;&lt;em&gt;java.util.Date;&lt;br /&gt;public class &lt;span id="SPELLING_ERROR_29" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_28" class="blsp-spelling-error"&gt;JavaLogTest&lt;/span&gt;&lt;/span&gt;{&lt;br /&gt;private static final &lt;span id="SPELLING_ERROR_30" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_29" class="blsp-spelling-error"&gt;boolean&lt;/span&gt;&lt;/span&gt; DEBUG = false;&lt;br /&gt;public &lt;span id="SPELLING_ERROR_31" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_30" class="blsp-spelling-error"&gt;JavaLogTest&lt;/span&gt;&lt;/span&gt;() { }&lt;br /&gt;public static void main(String &lt;span id="SPELLING_ERROR_32" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_31" class="blsp-spelling-error"&gt;args&lt;/span&gt;&lt;/span&gt;[]) { &lt;/em&gt;&lt;br /&gt;&lt;em&gt;debug("testing ! testing again"); &lt;/em&gt;&lt;br /&gt;&lt;em&gt;debug((new &lt;span id="SPELLING_ERROR_33" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_32" class="blsp-spelling-error"&gt;StringBuilder&lt;/span&gt;&lt;/span&gt;()).append("testing").append((new Integer(10)).toString()).append(new Date()).&lt;span id="SPELLING_ERROR_34" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_33" class="blsp-spelling-error"&gt;toString&lt;/span&gt;&lt;/span&gt;()); &lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;br /&gt;public static void debug(String s) { &lt;/em&gt;&lt;br /&gt;&lt;em&gt;System.out.println(s); &lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&amp;amp; the results were interesting;&lt;br /&gt;1. It doesn't make sense to use &lt;span id="SPELLING_ERROR_35" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_34" class="blsp-spelling-error"&gt;StringBuffer&lt;/span&gt;&lt;/span&gt; for appending, &lt;span id="SPELLING_ERROR_36" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_35" class="blsp-spelling-error"&gt;JVM&lt;/span&gt;&lt;/span&gt; is &lt;span id="SPELLING_ERROR_37" class="blsp-spelling-corrected"&gt;intelligent&lt;/span&gt; to make use of &lt;span id="SPELLING_ERROR_38" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_36" class="blsp-spelling-error"&gt;StringBuilder&lt;/span&gt;&lt;/span&gt; which is not synchronized also&lt;br /&gt;2. When we append strings only there is no need to use if statement even with log4j&lt;br /&gt;3. We can take out the code from the byte code (&lt;span id="SPELLING_ERROR_39" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_37" class="blsp-spelling-error"&gt;pre&lt;/span&gt;&lt;/span&gt;-processor directive DEBUG) which can reduce the total jar size&lt;br /&gt;I found &lt;a href="http://agileskills2.org/blog/2007/10/applying_scala_to_solving_real.html"&gt;&lt;span id="SPELLING_ERROR_40" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_38" class="blsp-spelling-error"&gt;scala&lt;/span&gt;&lt;/span&gt; &lt;/a&gt;solution for this was interesting. Dynamic languages indeed bring lot of paradigm shift in thinking!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31568098-4909746846606743766?l=praveendiary.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/okcCHBc5U7ENUTFjie0SOr8xb9g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/okcCHBc5U7ENUTFjie0SOr8xb9g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/okcCHBc5U7ENUTFjie0SOr8xb9g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/okcCHBc5U7ENUTFjie0SOr8xb9g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PraveenManvisTechnicalDiary/~4/uHrG-rBodi0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://praveendiary.blogspot.com/feeds/4909746846606743766/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=31568098&amp;postID=4909746846606743766" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/4909746846606743766?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/31568098/posts/default/4909746846606743766?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PraveenManvisTechnicalDiary/~3/uHrG-rBodi0/java-logging-framework-s-why-to-use.html" title="" /><author><name>Praveen</name><uri>http://www.blogger.com/profile/06430141770319257376</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://praveendiary.blogspot.com/2008/06/java-logging-framework-s-why-to-use.html</feedburner:origLink></entry></feed>

