<?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;A0AAQ3o-fCp7ImA9WhRRFE4.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137</id><updated>2011-11-27T16:22:22.454-08:00</updated><category term="hibernate" /><category term="technology" /><category term="design patterns" /><category term="c++ vs java" /><category term="java" /><category term="programming" /><category term="jbosscache" /><category term="ejb3client" /><category term="thoughtworks" /><category term="oop" /><category term="ooad" /><category term="jar" /><category term="dwr" /><category term="jar-searcher" /><category term="software architecture" /><category term="interview" /><category term="jni" /><category term="mingw" /><category term="ehcache" /><category term="ejb" /><category term="spring" /><category term="unsatisfiedlinkerror" /><category term="jboss" /><category term="gcc" /><category term="eclipse" /><category term="caching" /><category term="j2ee" /><category term="c++" /><category term="extjs" /><title>Techila Shots</title><subtitle type="html">Technology, Software Architecture, Programming, Software Design, J2EE, Java, C++!</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://techilashots.blogspot.com/" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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>12</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/TechilaShots" /><feedburner:info uri="techilashots" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CUIARHs_fSp7ImA9WxFbEEo.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-4316584922287162613</id><published>2010-07-02T04:13:00.000-07:00</published><updated>2010-07-02T05:25:45.545-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-02T05:25:45.545-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c++" /><category scheme="http://www.blogger.com/atom/ns#" term="mingw" /><category scheme="http://www.blogger.com/atom/ns#" term="gcc" /><category scheme="http://www.blogger.com/atom/ns#" term="unsatisfiedlinkerror" /><category scheme="http://www.blogger.com/atom/ns#" term="jni" /><title>JNI/Win32:java.lang.UnsatisfiedLinkError</title><content type="html">&lt;div style="text-align: justify;"&gt;I spent almost two whole days trying to solve this issue. I did everything possible from altering my c++ code (changing the return types) to compiling from command line rather than the IDE. Also, I tried a number of other steps like changing the classpaths, refactoring package names to changing names of the generated header files. Finally, I found the following resolution.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Whenever the C++ compiler (GCC) generates a DLL, it is exported in the following form:&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;Java_somepackage_SomeClass_someNativeMethod@8&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Where the integer suffix suggests the byte space required by the arguments. This sort of function call makes no sense to the JVM (while invoking someNativeMethod) and hence it leads to java.lang.UnsatisfiedLinkError. The resolution is to add the following flags while &lt;i&gt;linking&lt;/i&gt; to generate unmangled names:&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;b&gt;-Wl,--add-stdcall-alias&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;This will create an alias name (pure method call name) to the generated method. This allows the JVM to invoke the right method via JNI.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I almost gave up on this issue, before I finally found this resolution. The point to note here is that this happened to me only on Win32 - I had no issues running on the UNIX platform.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-4316584922287162613?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xXQYPp-pK8Y-__ylkVBMwC0lBao/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xXQYPp-pK8Y-__ylkVBMwC0lBao/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/xXQYPp-pK8Y-__ylkVBMwC0lBao/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xXQYPp-pK8Y-__ylkVBMwC0lBao/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/PQQih2woRFU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/4316584922287162613/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=4316584922287162613" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/4316584922287162613?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/4316584922287162613?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/PQQih2woRFU/jni-mingwwin32-javalangunsatisfiedlinke.html" title="JNI/Win32:java.lang.UnsatisfiedLinkError" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2010/07/jni-mingwwin32-javalangunsatisfiedlinke.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YNQn87fyp7ImA9WxFWEU8.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-4804241168077012129</id><published>2010-05-28T22:55:00.000-07:00</published><updated>2010-05-29T02:26:33.107-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-29T02:26:33.107-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="c++" /><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="c++ vs java" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Clash of the Titans, C++ vs Java!</title><content type="html">&lt;div style="text-align: justify;"&gt;As a software engineer, the mind is  trained to seek optimizations in every aspect of development, and ooze out every bit of available cpu resource to deliver a performing application.  This begins not only in designing the algorithm or coming out with efficient and robust architecture, but right onto the choice of programming language. Most of us, as we spend years in our jobs - tend to be proficient in at least one of these.&lt;br /&gt;&lt;br /&gt;Recently, I spent some time to check on the performance (not a very detailed study) of the various programming languages. One, by researching on the internet; Two, by developing small programs and benchmarking. The legacy languages - be it ASM or C still rule in terms of performance. But these are definitely ruled out for enterprise applications due to the complexity in development, maintainability, need for object orientation and interoperability. They still will win for mission critical or real-time systems, which need performance over these parameters. There were languages i briefly read about, including other performance comparisons on the internet. These include Python, PHP, Perl and Ruby.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Considering&lt;/span&gt; all aspects and needs of current enterprise development, it is C++ and Java which outscore the other in terms of speed. According to other comparisons [Google for 'Performance of Programming Languages'] spread over the net, they clearly outshine others in all speed benchmarks. So much for my blog title :-)&lt;br /&gt;&lt;br /&gt;So when these titan&lt;span style="font-size:100%;"&gt;s &lt;/span&gt;are pit against each other in real time,  considering all aspects  of memory and execution time - Java is floored. Though I have spent last 7 years of my life coding and perfecting my Java and J2EE skill - I suddenly feel... Ahem, Slow! One of the  problem statements to verify this is given below (alongwith the associated code) and the associated execution parameters.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;font-size:78%;" &gt;[Disclaimer: Problem Statement given below is the property of www.codechef.com]&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;In Byteland they have a very strange monetary system. Each Bytelandian gold coin has an integer number written on it. A coin n can be exchanged in a bank into three coins: n/2, n/3 and n/4. But these numbers are all rounded down (the banks have to make a profit). You can also sell Bytelandian coins for American dollars. The exchange rate is 1:1. But you can not buy Bytelandian coins. You have one gold coin. What is the maximum amount of American dollars you can get for it?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Input&lt;/span&gt;&lt;br /&gt;The input will contain several test cases (not more than 10). Each testcase is a single line with a number n, 0 &lt;= n &lt;= 1 000 000 000. It is the number written on your coin.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;JAVA SOLUTION&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;C++ SOLUTION&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;RESULTS&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face  {font-family:Verdana;  panose-1:2 11 6 4 3 5 4 4 2 4;  mso-font-charset:0;  mso-generic-font-family:swiss;  mso-font-pitch:variable;  mso-font-signature:-1593833729 1073750107 16 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal  {mso-style-parent:"";  margin:0cm;  margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:12.0pt;  font-family:"Times New Roman";  mso-fareast-font-family:"Times New Roman";  mso-fareast-language:EN-US;} @page Section1  {size:612.0pt 792.0pt;  margin:72.0pt 90.0pt 72.0pt 90.0pt;  mso-header-margin:36.0pt;  mso-footer-margin:36.0pt;  mso-paper-source:0;} div.Section1  {page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-parent:"";  mso-padding-alt:0cm 5.4pt 0cm 5.4pt;  mso-para-margin:0cm;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:"Times New Roman";} table.MsoTableGrid  {mso-style-name:"Table Grid";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  border:solid windowtext 1.0pt;  mso-border-alt:solid windowtext .5pt;  mso-padding-alt:0cm 5.4pt 0cm 5.4pt;  mso-border-insideh:.5pt solid windowtext;  mso-border-insidev:.5pt solid windowtext;  mso-para-margin:0cm;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:"Times New Roman";} &lt;/style&gt; &lt;![endif]--&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 50.4pt;" valign="top" width="67"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;b style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;TIME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 54pt;" valign="top" width="72"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;b style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;MEM&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 72pt;" valign="top" width="96"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;b style=""&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;LANG&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 50.4pt;" valign="top" width="67"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;0.00&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 54pt;" valign="top" width="72"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;2.8M&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 72pt;" valign="top" width="96"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;C++ 4.3.2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 50.4pt;" valign="top" width="67"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;0.26&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 54pt;" valign="top" width="72"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;218.3M&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 72pt;" valign="top" width="96"&gt;   &lt;p class="MsoNormal" style="text-align: right;" align="right"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;JAVA&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;I am sure these results will continue to be remain in the same ratio (with slight variations for other  or benchmark problems) - even with the most optimized java code.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&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/6572388206547534137-4804241168077012129?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/m6wiB_N7X33UVxAKznYce9jtBPA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/m6wiB_N7X33UVxAKznYce9jtBPA/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/m6wiB_N7X33UVxAKznYce9jtBPA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/m6wiB_N7X33UVxAKznYce9jtBPA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/Dg7zBU_E-kM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/4804241168077012129/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=4804241168077012129" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/4804241168077012129?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/4804241168077012129?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/Dg7zBU_E-kM/clash-of-titans-c-vs-java.html" title="Clash of the Titans, C++ vs Java!" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2010/05/clash-of-titans-c-vs-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIBQns9fSp7ImA9WxVWFU0.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-2439639562069383171</id><published>2009-01-31T10:33:00.000-08:00</published><updated>2009-02-24T11:42:33.565-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-24T11:42:33.565-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="jar" /><category scheme="http://www.blogger.com/atom/ns#" term="jar-searcher" /><title>JAR Searcher Developer Tool</title><content type="html">&lt;div align="justify"&gt;As a Java/J2EE developer, I know that the most commonly faced issue in development, which has also been reported as the primary reason for developers losing hair - missing classpath files or not being able to trace a JAR which contains the file - when you know you have all JARs that could possibly exist in this world on your local file system.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Just wrote this simple tool, &lt;a href="http://www.sumsoft.co.uk/jar-searcher-1.0.tar"&gt;JarSearcher v1.0&lt;/a&gt;, which accepts the name of class file you are looking for and returns all the JARs on your system which contain this file. Also, for Windows developers, I have added a .bat file (Unix folks, kindly replicate .sh) which takes the following form for execution:&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;js [class-name] [start-in] -c&lt;class-name&gt;&lt;start-in&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;[class-name] The name of the class file to search (without .class)&lt;br /&gt;&lt;start-in&gt;[start-in] The directory in which to start looking for the files&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;-c This switch will toggle display of processing information&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;p align="justify"&gt;or you can directly invoke the program from the bundled JAR file:&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;java -jar jar-searcher.jar &lt;class-name&gt;&lt;start-in&gt;[class-name] [start-in] -c&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div align="justify"&gt;I have included the source, feel free to modify it as per your convenience.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-2439639562069383171?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2z84B-HFqERAicav1cw5JZ3kHVc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2z84B-HFqERAicav1cw5JZ3kHVc/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/2z84B-HFqERAicav1cw5JZ3kHVc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2z84B-HFqERAicav1cw5JZ3kHVc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/Rm04fHOBh4M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/2439639562069383171/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=2439639562069383171" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/2439639562069383171?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/2439639562069383171?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/Rm04fHOBh4M/jar-searcher-utility.html" title="JAR Searcher Developer Tool" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2009/01/jar-searcher-utility.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUAQnc-fyp7ImA9WxVWFE8.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-2198311288244983078</id><published>2009-01-23T09:09:00.001-08:00</published><updated>2009-02-23T14:30:43.957-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-23T14:30:43.957-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dwr" /><category scheme="http://www.blogger.com/atom/ns#" term="spring" /><category scheme="http://www.blogger.com/atom/ns#" term="j2ee" /><category scheme="http://www.blogger.com/atom/ns#" term="extjs" /><title>Spring - DWR - Ext JS Chat Application</title><content type="html">&lt;div align="justify"&gt;I was curious to explore the capabilities of Reverse Ajax. That's when I created this simple chat application using Spring/DWR/Ext JS.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;From my experience, I can easily say that DWR is easy to learn and configure, especially when you are planning to integrate with Spring on the application tier. DWR has a powerful API to perform all relevant operations, right from accessing page script sessions to util classes for sending updates to the client.&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;I used Ext JS for creating the user interface, which renders stunning display for elements like forms, buttons, etc. Ext JS has a very steep learning curve and each operation requires a lot of configuration and reference. Also, I found that the event handling mechanism, though complete, is very complex to use. I relied on external Javascript coding for handling events. On the upside, the documentation and support is really good for this framework. Inspite, I would instantly recommend use of Ext JS for large sized customer facing web-based applications, especially for the internet. For medium scale projects or enterprise based projects, I would think twice. &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 165px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5306103980830532242" border="0" alt="" src="http://3.bp.blogspot.com/_C4DoKFRTtyc/SaMRdSawopI/AAAAAAAAABw/WQGM5JXAqek/s320/kabootar_chat_login.jpg" /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;Login Screen&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;/u&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p align="center"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 400px; DISPLAY: block; HEIGHT: 142px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5306107660656339346" border="0" alt="" src="http://1.bp.blogspot.com/_C4DoKFRTtyc/SaMUze1maZI/AAAAAAAAACA/rFhhGSq5akc/s400/kabootar_chat_main.jpg" /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="font-family:courier new;"&gt;&lt;u&gt;Chat Screen&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt; &lt;/p&gt;&lt;p align="center"&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;br /&gt;Simply, drop the &lt;a href="http://www.sumsoft.co.uk/kabootar.war.zip"&gt;.war&lt;/a&gt; file in your web/app server. All dependencies are available in the archive itself. The only external reference is 'servlet-api.jar', which is part of the default lib in all latest containers. The &lt;a href="http://www.sumsoft.co.uk/source.zip"&gt;source&lt;/a&gt; is packaged separately. Once deployed, the url to access should be: &lt;a href="http://[server_name]:[server_port]/kabootar/login.kabootar"&gt;http://[server_name]&lt;server_name&gt;:[server_port]&lt;server_port&gt;/kabootar/login.kabootar&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;If you are trying to figure out what 'Kabootar' means,  it's hindi for 'Pigeon'... &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-2198311288244983078?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IdnoWUSlB_ZYoOcv6U0lGN46od4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IdnoWUSlB_ZYoOcv6U0lGN46od4/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/IdnoWUSlB_ZYoOcv6U0lGN46od4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IdnoWUSlB_ZYoOcv6U0lGN46od4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/WvNNfOE-QyI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/2198311288244983078/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=2198311288244983078" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/2198311288244983078?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/2198311288244983078?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/WvNNfOE-QyI/spring-dwr-ext-js-chat-application.html" title="Spring - DWR - Ext JS Chat Application" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://3.bp.blogspot.com/_C4DoKFRTtyc/SaMRdSawopI/AAAAAAAAABw/WQGM5JXAqek/s72-c/kabootar_chat_login.jpg" height="72" width="72" /><thr:total>6</thr:total><feedburner:origLink>http://techilashots.blogspot.com/2009/01/spring-dwr-ext-js-chat-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8ASXw7fCp7ImA9WxVREUw.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-6606208207836744426</id><published>2009-01-16T04:31:00.000-08:00</published><updated>2009-01-16T05:34:08.204-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-16T05:34:08.204-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jbosscache" /><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="spring" /><category scheme="http://www.blogger.com/atom/ns#" term="j2ee" /><title>JBoss Cache XSD Config in Eclipse</title><content type="html">&lt;div align="justify"&gt;I was facing this issue in Eclipse Europa where the Spring configuration XML was not getting validated, when i included JBoss Cache related configuration in it. This is primarily because the Namespace and the Schema URI,&lt;/div&gt;&lt;div align="justify"&gt;&lt;a href="http://www.springmodules.org/schema/jboss"&gt;&lt;em&gt;&lt;span style="font-size:78%;"&gt;http://www.springmodules.org/schema/jboss&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.springmodules.org/schema/cache/springmodules-jboss.xsd"&gt;&lt;em&gt;&lt;span style="font-size:78%;"&gt;http://www.springmodules.org/schema/cache/springmodules-jboss.xsd&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt; &lt;/em&gt;&lt;/div&gt;&lt;div align="justify"&gt;are not available at the respective locations, hence i guess these were not bundled in Eclipse Europa. I spent about 4-5 hours breaking my head on this issue before I found the solution in another blog.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;The way to get your XML to be reported as validated is:&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;1. In Eclipse, Click on Window &gt; Preferences.. &gt; Web and XML &gt; XML Catalog&lt;/div&gt;&lt;div align="justify"&gt;2. Under XML Catalog, Click on User Specified Entries and then click on Add...&lt;/div&gt;&lt;div align="justify"&gt;3. Create the following Entries/Locations &lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;&gt;&gt;&gt;&gt;&gt; [Replace pathto with the actual location of the JAR on your local machine.]&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:78%;"&gt;&gt;&gt;&gt;&gt;&gt;&gt; jar:file:&lt;u&gt;pathto&lt;/u&gt;/spring-modules-cache.jar!/org/springmodules/cache/config/springmodules-cache.xsd&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:78%;"&gt;&gt;&gt;&gt;&gt;&gt;&gt; KEY TYPE Schema Location&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:78%;"&gt;&gt;&gt;&gt;&gt;&gt;&gt; KEY &lt;a href="http://www.springmodules.org/schema/cache/springmodules-cache.xsd"&gt;http://www.springmodules.org/schema/cache/springmodules-cache.xsd&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&gt;&gt;&gt;&gt;&gt; jar:file:&lt;u&gt;pathto&lt;/u&gt;/spring-modules-cache.jar!/org/springmodules/cache/config/jboss/springmodules-jboss.xsd&lt;br /&gt;&gt;&gt;&gt;&gt;&gt; KEY TYPE Schema Location&lt;br /&gt;&gt;&gt;&gt;&gt;&gt; KEY &lt;a href="http://www.springmodules.org/schema/cache/springmodules-jboss.xsd"&gt;http://www.springmodules.org/schema/cache/springmodules-jboss.xsd&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;4. Refresh the XML file in the Project Explorer and... all XML validation errors have gone!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-6606208207836744426?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-2w3wAmxtp9Eebi54RgTwtOJ4XU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-2w3wAmxtp9Eebi54RgTwtOJ4XU/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/-2w3wAmxtp9Eebi54RgTwtOJ4XU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-2w3wAmxtp9Eebi54RgTwtOJ4XU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/SPPVUn6lfN4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/6606208207836744426/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=6606208207836744426" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/6606208207836744426?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/6606208207836744426?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/SPPVUn6lfN4/jboss-cache-xsd-configuration-in.html" title="JBoss Cache XSD Config in Eclipse" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2009/01/jboss-cache-xsd-configuration-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IGQ3ozeyp7ImA9WxVREUw.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-1331576528101824440</id><published>2009-01-15T04:56:00.000-08:00</published><updated>2009-01-16T05:12:02.483-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-16T05:12:02.483-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="caching" /><category scheme="http://www.blogger.com/atom/ns#" term="hibernate" /><category scheme="http://www.blogger.com/atom/ns#" term="spring" /><category scheme="http://www.blogger.com/atom/ns#" term="ehcache" /><title>Spring, Hibernate, EhCache Recipe</title><content type="html">&lt;div align="justify"&gt;A simple scenario explaining the usage and performance, when using EhCache along with Hibernate in a Spring environment. The performance results are taken using mySQL as the database. I started off my experiment with JBossCache, but had one hell of a time with it's configuration within Spring. [&lt;a href="http://www.sumsoft.co.uk/spring_hibernate_ehcache.jar"&gt;Download Sample Code&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;In this example, I need to retrieve close to 5,000 records in a single fetch and then cache this information. As usual, setup Spring contexts in your Spring configuration file. I have just one bean, which is a Hibernate DAO, &lt;em&gt;HibernateDoctorDAO.java. &lt;/em&gt;The dependency injection hierarchy is dataSource &lt;strong&gt;&gt; &lt;/strong&gt;sessionFactory &lt;strong&gt;&gt; &lt;/strong&gt;hibernateTemplate. hibernateTemplate is then injected into the &lt;em&gt;HibernateDoctorDAO.java &lt;/em&gt;at runtime by the Spring Framework.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;The implementations of each of these are:&lt;/div&gt;&lt;div align="justify"&gt;dataSource &gt; org.apache.commons.dbcp.BasicDataSource&lt;/div&gt;&lt;div align="justify"&gt;sessionFactory &gt; org.springframework.orm.hibernate3.LocalSessionFactoryBean&lt;/div&gt;&lt;div align="justify"&gt;hibernateTemplate &gt; org.springframework.orm.hibernate3.HibernateTemplate&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p align="justify"&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;?xml:namespace prefix = ehcache /&gt;&lt;ehcache:config configlocation="classpath:eh-cache.xml"&gt;&lt;ehcache:caching id="doctorCacheModel" cachename="doctorCache"&gt;&lt;ehcache:flushing id="doctorFlushModel" cachenames="doctorCache" when="before"&gt;The results clearly shows the difference in performance with EhCache enabled, even in this simple example:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;PERFORMANCE COMPARISON (in seconds)&lt;br /&gt;==================================&lt;br /&gt;QUERY FETCH TIME (INITIAL): 0.599&lt;br /&gt;QUERY FETCH TIME (HIBERNATE CACHE): 0.212&lt;br /&gt;QUERY FETCH TIME (2ND LEVEL CACHE): 0.091&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;The main program to run the sample is &lt;em&gt;SpringOrmIntegration.java&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;div align="justify"&gt;&lt;span style="font-size:78%;"&gt;Version Reference &gt; Spring-2.5, Hibernate-3.0, EhCache-1.4, mySQL-5.0&lt;/span&gt;&lt;/div&gt;&lt;/ehcache:flushing&gt;&lt;/ehcache:caching&gt;&lt;/ehcache:config&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-1331576528101824440?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NER5icI2E1UOtz86QprwTUsl-uo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NER5icI2E1UOtz86QprwTUsl-uo/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/NER5icI2E1UOtz86QprwTUsl-uo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NER5icI2E1UOtz86QprwTUsl-uo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/t-Dt4DSkW4k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/1331576528101824440/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=1331576528101824440" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/1331576528101824440?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/1331576528101824440?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/t-Dt4DSkW4k/spring-hibernate-ehcache-recipe.html" title="Spring, Hibernate, EhCache Recipe" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2009/01/spring-hibernate-ehcache-recipe.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcEQ3g7cCp7ImA9WxVSF04.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-4529608700951882514</id><published>2009-01-07T20:17:00.001-08:00</published><updated>2009-01-11T21:10:02.608-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-11T21:10:02.608-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="thoughtworks" /><category scheme="http://www.blogger.com/atom/ns#" term="interview" /><category scheme="http://www.blogger.com/atom/ns#" term="ooad" /><category scheme="http://www.blogger.com/atom/ns#" term="j2ee" /><category scheme="http://www.blogger.com/atom/ns#" term="oop" /><title>Thoughtworks - A Different Company!</title><content type="html">&lt;div align="justify"&gt;It might be an inappropriate entry for this blog - sharing an interview experience. But one that might help people the most [ :-) ] especially when it is about... ThoughtWorks!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;The company has a very interesting interview process, different than most i have come across, which speaks a lot of the company culture and the work that you might do there. I write this from the perspecive of an interviewee who participated in the interview process there, twice!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;1. It all starts with an online application [Unless you are the lucky one whose CV has been sourced!] &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;2. Once shortlisted, you get a call from the HR who checks your comfort submitting code and explains the interview process. &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;3. You get two problem statements by mail, and have the choice of submitting solution for either of them - focus is on object oriented design [Mars Rovers problem should be famous by now]&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;4. Next I had a Phone screen, in which i was presented with a problem again for which one has to design and implement a solution - again object oriented skills are the focus. During the course, you might be presented with a change in requirement and have to explain how easily your design can adapt to these changes. &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;5. When i was interviewed the first time, the next round was in-office and I had logical and reasoning ability tests - which are really a breeze. &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;6. The first time I did not want to proceed beyond this point due to some personal reasons... The second time around I wasn't selected [ :-) ], But what I know is that the subsequent interviews focus on how well you can code pair with other Thoughtworkers and a series of technical interviews on your primary technology skill. &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;7. The offer, I am sure once in you would never want to be out - working with the best technical minds....&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;What I love about this process, as a developer, is that unlike other interview it tests and validates all your abilities in real-time [technology knowledge, problem solving, design skills, implementation skills and most of all that you can code - no matter whether you are an architect, tech lead or a senior developer]. The other important aspects that I like [and have read or heard] about the company is the flat hierarchy, enterpreneurial culture, agile process and that it values technology.&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-4529608700951882514?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IhHsGQ5UaW2EMm1ahtF8JpbNm8s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IhHsGQ5UaW2EMm1ahtF8JpbNm8s/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/IhHsGQ5UaW2EMm1ahtF8JpbNm8s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IhHsGQ5UaW2EMm1ahtF8JpbNm8s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/Vsb2hC97ZjQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/4529608700951882514/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=4529608700951882514" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/4529608700951882514?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/4529608700951882514?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/Vsb2hC97ZjQ/thoughtworks-different-company.html" title="Thoughtworks - A Different Company!" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2009/01/thoughtworks-different-company.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIGQ3w6eSp7ImA9WxRbFEU.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-8428684368063835045</id><published>2008-12-05T04:18:00.000-08:00</published><updated>2008-12-05T05:08:42.211-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-05T05:08:42.211-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="design patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="software architecture" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Design Patterns - Series II</title><content type="html">&lt;div align="justify"&gt;My concluding write-up on design patterns, with some examples.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Adapter Pattern&lt;/strong&gt;&lt;/u&gt; &lt;strong&gt;[&lt;/strong&gt;&lt;a href="http://www.sumsoft.co.uk/adapter.jar"&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;br /&gt;What can one do if he needs to use an Asian Hairdryer in a European Country, each with different socket types? I would seek an Adapter! As in real life, when we want to plug and play with similar but incompatible interfaces we use the Adapter. The Adapter adapts the Adaptee to the desired interface, by composing the Adaptee object and inheriting the desired interface or by multiple inheritance.&lt;br /&gt;&lt;br /&gt;The attached example is a real world Computer scenario, where I want to plug in an external hard drive (pre-usb era!), SeagateDrive of interface type SeagateGeneric to an incompatible computer, SamsungComputer of type Computer. SeagateGeneric provides read() and write() methods for the specified purposes, which needs to be adapted to the actual bufferData(), flushData() and purgeData() methods of the Computer. Note that there is no equivalent of purgeData(). The ideal way to handle this scenario is to throw an exception, whenever this method is invoked on the hard drive as it would do in the real world. The adapter to perform the translation in this scenario is the SeagateAdapter, which implements the Computer interface. It encapsulates a SeagateGeneric instance reference, and adapts it to the Computer interface. Whenever a bufferData() method is invoked on the Computer interface, it actual requires three invocations of read() on the SeagateGeneric implementation to match up to the Computer’s standards. These kinds of translations are done by the adapte.&lt;br /&gt;&lt;br /&gt;PCAssembler is the main class here. Try adding your own device and its adapter to the computer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;Facade Pattern&lt;/strong&gt;&lt;/u&gt; &lt;strong&gt;[&lt;/strong&gt;&lt;a href="http://www.sumsoft.co.uk/facade.jar"&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;br /&gt;Consider a scenario where we require multiple method invocations on various classes, to achieve the desired functionality. Also, consider that this set of functionality is repeatedly being used in your code. If you are thinking of an option where you will perform direct invocations, you are bound to end up with code maintenance issues and tightly coupled code. If these invocations are remote, it is going to be worse with respect to the performance. This is where the facade comes into play, wherein multiple method invocations are encapsulated into a single method of the facade class, to achieve the desired functionality. It provides us with a single point of change and looser coupling, with respect to the individual implementations. Remote method invocation patterns like SessionFacade (EJB) adapt from here to improve the overall performance and lower complexity.&lt;br /&gt;&lt;br /&gt;The example attached is a very simple scenario of a InvoiceManagerFacade which has addInvoice() and deleteInvoice() methods. To achieve the desired result, each of these methods encapsulates the method invocations from OrderManager, LedgerManager and BillingManager classes.&lt;br /&gt;&lt;br /&gt;AccountsCentral is the main class. Try adding your own method to the facade class, or try plugging in a new type of facade.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Template Pattern&lt;/u&gt;&lt;/strong&gt; &lt;strong&gt;[&lt;/strong&gt;&lt;a href="http://www.sumsoft.co.uk/template.jar"&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;br /&gt;Imagine a real-world scenario where a factory is creating both aluminium nails and screws. Though the machine has to create both of them through similar processes, the way some steps are implemented may vary in each of these. When we think of such scenarios in software, we utilize the template pattern. Template pattern defines a way to re-use algorithms for various implementations with different or slightly different outcomes.&lt;br /&gt;&lt;br /&gt;In the attached example, the abstract class SoftwareProcessor defines a general set of algorithmic steps (functions) to deliverSoftware(). This class is my template class. Since the implementation and testing phases differ in projects based on the technology stack being used, CProcessor and JavaProcessor classes adapt this algorithm for these phases. The common methods are all implemented in SoftwareProcessor and the specific ones are left as abstract.&lt;br /&gt;&lt;br /&gt;SoftwareConsultants can be used to run this example. Try adding your own processor.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Iterator Pattern&lt;/u&gt; [&lt;/strong&gt;&lt;a href="http://www.sumsoft.co.uk/iterator.jar"&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;br /&gt;The need to have a handle to a collection of elements, without exposing its internal implementation is met by the Iterator Pattern. I would term this as a pure programming pattern, in its own right. By utilising this handle (Iterator), the client using the collection can easily process the same without any dependency on the internal logic.&lt;br /&gt;&lt;br /&gt;In the attached example, ProductMenu holds a menu or list of ProductItem. This list and its usage should be implementation agnostic to the clients. Hence, the need for a ProductIterator which implements the generic Iterator interface. The createIterator() method of ProductMenu, passes the array implementation of ProductItem to the constructor of ProductIterator.&lt;br /&gt;&lt;br /&gt;The example can be run using ProductMenuTester.&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;State Pattern&lt;/u&gt; [&lt;/strong&gt;&lt;a href="http://www.sumsoft.co.uk/state.jar"&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;br /&gt;State Pattern defines a way to maintain various steps or states of the same machine or class. The word machine comes to the mind easily, because it is the simplest example of a real-world scenario where there is a need for operating the same object in steps or set states, with the transition from one step to the next defined by a single action (or multiple actions).&lt;br /&gt;&lt;br /&gt;The example attached is a very crude but helpful one, that of an OnlineShopping site. The limitation of the site being that at any given point only a single item can be purchased and processed. The various states during the purchase and processing are SelectionState, PurchaseState, AuthoriseState, AssembleState (optional) and DispatchState. Each of these states is processed and followed in a sequential manner. OnlineShopping maintains an instance variable of each of these states and also a currentState variable. The various state methods that exist within OnlineShopping are selection(), purchase(), authorise(), assemble() and dispatch(). When client calls these methods, the actual invocations are performed on the state implementation held in the currentState variable. All state implementations implement the State interface, which specifies the lifecycle methods.&lt;br /&gt;&lt;br /&gt;ShoppingClient is the main class. Try adding your own states along with the required lifecycle method.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-8428684368063835045?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/veII6ynisd4bbAbUzfdvF9JsQtU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/veII6ynisd4bbAbUzfdvF9JsQtU/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/veII6ynisd4bbAbUzfdvF9JsQtU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/veII6ynisd4bbAbUzfdvF9JsQtU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/bGv_xLvrhcQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/8428684368063835045/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=8428684368063835045" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/8428684368063835045?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/8428684368063835045?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/bGv_xLvrhcQ/design-patterns-series-ii.html" title="Design Patterns - Series II" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2008/12/design-patterns-series-ii.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUANRHg4eip7ImA9WxRbEUw.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-8066630211737011628</id><published>2008-11-30T21:30:00.000-08:00</published><updated>2008-11-30T22:43:15.632-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-30T22:43:15.632-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="design patterns" /><category scheme="http://www.blogger.com/atom/ns#" term="software architecture" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><title>Design Patterns - Series I</title><content type="html">&lt;div align="justify"&gt;Was going through the book ‘Head First Design Patterns’, came up with my own examples to understand them further. Try downloading the code and see if it helps you in comprehending these in a better way.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Observer Pattern&lt;/u&gt; [&lt;a href="http://www.sumsoft.co.uk/observer.jar"&gt;Sample Code&lt;/a&gt;]&lt;br /&gt;&lt;/strong&gt;Observer Pattern, as the name suggests, is used in scenarios when updates need to be done at multiple points (Observers) depending on changes in state at another place (Subject). Each of the Observers has to register themselves with the Subject, individually. The Subject should also provide method which allows the Observers to remove themselves. Registered Observers are informed of changes in state through a notify method, usually.&lt;br /&gt;&lt;br /&gt;The provided example is that of a StockBroker application, which involves maintenance of various types of financial information. Subject is the interface in the application which provides a template for the Observed class. StockData is the concrete implementation of Subject and provided implementation of addObserver(), removeObserver() and notifyObservers(). Additionally, it maintains a list of registered observers. IncomeHandler, InvestmentHandler and PortfolioHandler are the various observers used to maintain income, investment and portfolio of a specific StockBroker. All these depend on the constantly fluctuating values of stocks. They are specifically interested in the stockSymbol, stockValue and stockUnits of each individual stock. Each of the observers implements the interface Observer. The Observer interface provide the update() method, which is implemented by each of these concrete classes.&lt;br /&gt;&lt;br /&gt;Use StockBroker.java to run the application, Try adding your own observer to this application. Also, you can try picking up these values from a live web service and then writing a custom observer which depends on this. &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;u&gt;Decorator Pattern&lt;/u&gt; [&lt;a href="http://www.sumsoft.co.uk/decorator.jar"&gt;Sample Code&lt;/a&gt;]&lt;br /&gt;&lt;/strong&gt;Decorator Pattern provides an elegant way to use composition for enhancing functionality, where the result expected has direct dependency on the composed and composing class. A chain relation (via composition) or decoration can be finally used to achieve the desired output at runtime. In real-time, when the functionality of one particular product is expected to be built form a base product and various other related sub-products or fixtures, we can rely on the Decorator.&lt;br /&gt;&lt;br /&gt;The attached example is that of a Pizza application. Here, the pizzas in the shop are made with various combinations of bases and topping combinations. This is a classical example for usage of the decorator pattern. Pizza is the abstract base class for each of the pizza bases to implement and ToppingDecorator is another abstract class that inherits from Pizza for each of the toppings to implement. Hawaiian, Italian and Mexican are the concrete implementation of Pizza whereas Mushroom, Onion and Chicken are the concrete implementations of ToppingDecorator. Each of these toppings encapsulates a Pizza instance. This instance, at runtime, will hold another topping or the pizza base instance. Finally, it is when the cost has to be calculated on the entire pizza that the real value of decorator pattern is seen and just one call suffices to calculate the entire bill value.&lt;br /&gt;&lt;br /&gt;PizzaWorld is the main class. Try adding more decorators and pizza base classes to see if you can get a real taste of the Decorator! &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;u&gt;Singleton Pattern&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;Singleton Pattern defines a way to maintain only single instance of a class in the entire execution of a program/application and to provide a uniform way to access it. There are numerous methods which exist in which this pattern can be implemented. I have explained three most common scenarios here:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Eager Singleton [&lt;a href="http://www.sumsoft.co.uk/singleton_eager.jar"&gt;Sample Code&lt;/a&gt;]&lt;br /&gt;&lt;/strong&gt;The simplest singleton is the one in which the instance is created at class-load time, and stored in a static instance variable. A static getter method is then used to get this instance, when required. The instantiation of an object earlier than its first use might not be a recommended approach.&lt;br /&gt;&lt;br /&gt;In the given example, MediaContract (Main Thread) works on an instance of the ProductionHouse (Singleton). The Singleton is instantiated at class-load time and maintained in the private static instance variable. getInstance() in ProductionHouse helps in retrieving the instance.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Thread-Safe Singleton (Most Common) [&lt;a href="http://www.gigasize.com/get.php?d=l6867z6x4df"&gt;Sample Code&lt;/a&gt;]&lt;/strong&gt;&lt;br /&gt;To overcome the above drawback, the recommended approach is to instantiate the object at the first access time and also to make it thread-safe to prevent concurrent thread instantiation. The disadvantage of this method is poorer performance, as the method is synchronized.&lt;br /&gt;&lt;br /&gt;As in the earlier example, the classes are MediaContract (Main Thread) and ProductionHouse (Singleton). getInstance() method is synchronized and the instance is created only if it is null.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Double-checked Locking [&lt;a href="http://www.sumsoft.co.uk/singleton_doublechecked.jar"&gt;Sample Code&lt;/a&gt;]&lt;/strong&gt;&lt;br /&gt;The disadvantage mentioned above can be critical for a highly accessed object in an application. To better this, the scope of the synchronized block is reduced to affect only the first access. This again has some disadvantages. I recommend reading on Initialization on Demand Holder Idiom.&lt;br /&gt;&lt;br /&gt;The example remains the same, the difference being in the reduced scope of synchronisation within the getInstance() method and also that it affects only the first access and not subsequent accesses.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;u&gt;Command Pattern&lt;/u&gt; [&lt;a href="http://www.sumsoft.co.uk/command.jar"&gt;Sample Code&lt;/a&gt;]&lt;br /&gt;&lt;/strong&gt;In scenarios, where we need to create a sequence of actions (or operations) and perform them at a specified (later) point in time, we have a candidate for usage of Command Pattern. Though it very closely resembles the Observer pattern in implementation, the usage is different and the command (actions) is invoked only on a single chosen receiver by an invoker, than on all observers.&lt;br /&gt;&lt;br /&gt;The example is of an Auction House where there are various items for auction, the base abstract class of which is represented by AuctionItem. The abstract method to be implemented by implementing classes is sell(). AuctionVase, AuctionFurniture and AuctionJewel are all concrete implementations of AuctionItem. Instances of each of these are created and set (mapped by an itemKey) into the AuctionControl, which can be thought of as a remote control for presenting items in the AuctionStore. Whenever the presentItem() is invoked on the AuctionControl class, passing in an itemKey, the appropriate AuctionItem instance is selected and sell() is invoked on this instance.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;u&gt;Factory Pattern&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;Factory Pattern, I am made to believe, is the most widely used and implemented pattern in software projects after the Singleton Pattern. Since Singleton is only a creational pattern at single class level, the scale of the effect of usage of Factory should be much higher. Factory Pattern deals with creation of similar type of objects and production in a centralized manner, depending on the condition or type of object requested. There are variations of the usage of factory pattern, three of which I have enlisted below:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Simple Factory [&lt;a href="http://www.sumsoft.co.uk/simple_factory.jar"&gt;Sample Code&lt;/a&gt;]&lt;/strong&gt;&lt;br /&gt;The simplest factory is the one that is used to create (instantiate) a specific type of product (object) depending on a condition. The specific types of objects that can be created in a single factory are all expected to implement a single interface.&lt;br /&gt;&lt;br /&gt;In the attached example, the factory is used to instantiate a specific type of object depending on the operating system. All the specific systems implement the System interface, which defines the common methods that the concrete class of this type should implement. SystemFactory is the factory class which provides the create() method which takes a type argument. The type argument decides which concrete factory should be instantiated.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Factory Method [&lt;a href="http://www.sumsoft.co.uk/factory_method.jar"&gt;Sample Code&lt;/a&gt;]&lt;/strong&gt;&lt;br /&gt;When there can be various families of products (objects) that which can be instantiated, but each family of these product needs to be created by a specific type of factory, we define a factory method in the base factory class. The concrete implementations of the base factory then override this method to produce concrete type of products, depending on the condition.&lt;br /&gt;&lt;br /&gt;In the example, you can notice the presence of two abstract classes, Mobile (Product) and MobileStore (Creator). One family of concrete product implementations are NokiaASeries, NokiaBSeries and NokiaCSeries to be created by the NokiaStore, which is the concrete implementation of the creator. In similar fashion another family of products such as SonyASeries, SonyBSeries and SonyCSeries are to be created by SonyStore, another concrete implementation of MobileStore. MobileStoreCentre is the main class to run this application. The createMobile() method is the abstract method (factory method) that is to be overridden by the creator implementations.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Abstract Factory [&lt;a href="http://www.sumsoft.co.uk/abstract_factory.jar"&gt;Sample Code&lt;/a&gt;]&lt;/strong&gt;&lt;br /&gt;AbstractFactory defines a template or interface for creation of similar types of objects or implementations. Usually, AbstractFactory will encapsulate a factory method or more within for actual creation of the product.&lt;br /&gt;&lt;br /&gt;Taking the same example as above, MobileAutoMechanic provides an interface for creation of similar types of mobile auto mechanics. SonyAutoMechanic and NokiaAutoMechanic provide the necessary implementations. Each of the product classes now starts taking the auto mechanic instance of their own type of family, in the constructor. Each of these mechanics has the knowhow of the pre-assembly steps and performs the same. &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-8066630211737011628?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PVklSvQZmdV0jYxlwsT8QKof71o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PVklSvQZmdV0jYxlwsT8QKof71o/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/PVklSvQZmdV0jYxlwsT8QKof71o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PVklSvQZmdV0jYxlwsT8QKof71o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/tEgeOlVhp4M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/8066630211737011628/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=8066630211737011628" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/8066630211737011628?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/8066630211737011628?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/tEgeOlVhp4M/design-patterns-series-i.html" title="Design Patterns - Series I" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2008/11/design-patterns-series-i.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIDRXk4fCp7ImA9WxRWE0k.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-4653949085045169758</id><published>2008-10-26T09:56:00.000-07:00</published><updated>2008-10-29T22:12:54.734-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-29T22:12:54.734-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="j2ee" /><category scheme="http://www.blogger.com/atom/ns#" term="ejb3client" /><category scheme="http://www.blogger.com/atom/ns#" term="jboss" /><title>EJB v3 Client for JBoss Gotcha!</title><content type="html">&lt;div align="left"&gt;If you are writing a standalone client for either a local or remotely deployed EJB v3, and face the following issue:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;javax.naming.CommunicationException&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;[Root exception is java.lang.ClassNotFoundException: org.jboss.ejb3.proxy.JBossProxy &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;(no security manager: RMI class loader disabled)]&lt;br /&gt;at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:788)&lt;br /&gt;at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)&lt;br /&gt;at javax.naming.InitialContext.lookup(Unknown Source)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The &lt;strong&gt;simple fix&lt;/strong&gt; is to include 'jbossall-client.jar' in the client classpath.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-4653949085045169758?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VcVLu53ASjhumw8HZffgHuAtx_4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VcVLu53ASjhumw8HZffgHuAtx_4/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/VcVLu53ASjhumw8HZffgHuAtx_4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VcVLu53ASjhumw8HZffgHuAtx_4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/Jrm7pAKyqRU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/4653949085045169758/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=4653949085045169758" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/4653949085045169758?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/4653949085045169758?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/Jrm7pAKyqRU/ejb-v3-client-for-jboss-gotcha.html" title="EJB v3 Client for JBoss Gotcha!" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2008/10/ejb-v3-client-for-jboss-gotcha.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEEQHw6cSp7ImA9WxRWE0k.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-5983939817822840546</id><published>2008-10-21T16:10:00.000-07:00</published><updated>2008-10-29T22:13:21.219-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-29T22:13:21.219-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ejb" /><category scheme="http://www.blogger.com/atom/ns#" term="spring" /><category scheme="http://www.blogger.com/atom/ns#" term="j2ee" /><category scheme="http://www.blogger.com/atom/ns#" term="software architecture" /><title>EJB v3 Buy-In</title><content type="html">&lt;div align="justify"&gt;Studying for my SCBCD 5 certification, I noticed these differences between the EJB v3 specification and Spring v2 framework. Thought i should share these. I will add the performance results as well, once i have something substantial. &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;In Favour of EJB v3,&lt;/strong&gt;&lt;br /&gt;Easier implementation for web services&lt;br /&gt;Time tested &amp;amp; Robust method for Remote Access&lt;br /&gt;Better instance pooling mechanisms&lt;br /&gt;Stateful session beans&lt;br /&gt;Annotations make it easier&lt;br /&gt;JEE Standard / Sun Support / Industry Affiliation&lt;br /&gt;Wide App Server Feature Support&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;In Favour of Spring v2,&lt;br /&gt;&lt;/strong&gt;JDBCTemplate and JMSTemplate&lt;br /&gt;DI even for POJO (outside container)&lt;br /&gt;AOP is feature-rich (but complex)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And no... I do not sell for Sun.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6572388206547534137-5983939817822840546?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MneRFQEbV9YYkZt3WHl0xysWryI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MneRFQEbV9YYkZt3WHl0xysWryI/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/MneRFQEbV9YYkZt3WHl0xysWryI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MneRFQEbV9YYkZt3WHl0xysWryI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/-FqwNLj1T6Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/5983939817822840546/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=5983939817822840546" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/5983939817822840546?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/5983939817822840546?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/-FqwNLj1T6Q/ejb-3-buy-in.html" title="EJB v3 Buy-In" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://techilashots.blogspot.com/2008/10/ejb-3-buy-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMEQns6eip7ImA9WxRTEE0.&quot;"><id>tag:blogger.com,1999:blog-6572388206547534137.post-352659957003196371</id><published>2008-08-29T02:12:00.001-07:00</published><updated>2008-08-29T04:13:23.512-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-29T04:13:23.512-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="technology" /><category scheme="http://www.blogger.com/atom/ns#" term="j2ee" /><category scheme="http://www.blogger.com/atom/ns#" term="software architecture" /><title>Techila Shots!</title><content type="html">&lt;a href="http://3.bp.blogspot.com/_C4DoKFRTtyc/SLfZuOB1-7I/AAAAAAAAAAU/b4ECa3FbOwU/s1600-h/techila_shots.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5239896079531899826" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_C4DoKFRTtyc/SLfZuOB1-7I/AAAAAAAAAAU/b4ECa3FbOwU/s200/techila_shots.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div align="justify"&gt;Well, that's a catchy name... you'd be thinking. This wasn't a very well thought out title or one that required a christening ceremony. Had it in my mind for a few years, tried implementing it in an organisation as well. So, What is Techila Shots?&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;Techila Shots is a measure of techie talk delivered with a dash of passion and a slice of experience, that gives a kick to my developer psyche (What a Pitch?). It is a forum that presents my thoughts on technical topics that i am most enthusiastic about. Mostly, It is about the geek in me. Hope that someone reading it will find it atleast helpful, if not as much to deliver a kick! &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/6572388206547534137-352659957003196371?l=techilashots.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vXkzyl_eCixlp8Hh_g6y9QFQka0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vXkzyl_eCixlp8Hh_g6y9QFQka0/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/vXkzyl_eCixlp8Hh_g6y9QFQka0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vXkzyl_eCixlp8Hh_g6y9QFQka0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TechilaShots/~4/EaVGJ-ASVb8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://techilashots.blogspot.com/feeds/352659957003196371/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6572388206547534137&amp;postID=352659957003196371" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/352659957003196371?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6572388206547534137/posts/default/352659957003196371?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/TechilaShots/~3/EaVGJ-ASVb8/techila-shots.html" title="Techila Shots!" /><author><name>Sumith Puri</name><uri>http://www.blogger.com/profile/18102927328466755290</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://3.bp.blogspot.com/_C4DoKFRTtyc/SLfZuOB1-7I/AAAAAAAAAAU/b4ECa3FbOwU/s72-c/techila_shots.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://techilashots.blogspot.com/2008/08/techila-shots.html</feedburner:origLink></entry></feed>

