<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Shashi Velur's blog</title>
	<atom:link href="http://shashivelur.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://shashivelur.com/blog</link>
	<description>Software Development, Architecture, Enterprise Agile, etc.</description>
	<pubDate>Mon, 20 Jul 2009 05:07:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>My first impressions on Google Wave</title>
		<link>http://shashivelur.com/blog/2009/07/my-first-impressions-on-google-wave/</link>
		<comments>http://shashivelur.com/blog/2009/07/my-first-impressions-on-google-wave/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 05:07:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Web Technologies]]></category>

		<category><![CDATA[Google Wave]]></category>

		<category><![CDATA[Google Wave Developer Sandbox]]></category>

		<category><![CDATA[XMPP]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=36</guid>
		<description><![CDATA[I am very excited to receive my Google Wave Developer Sandbox account.
Google Wave is actually three layers - the Product, the Protocol, and the Platform. What I am seeing in the Developer Sandbox is actually the Product using the Platform and the Protocol.
After spending a couple of hours with Google Wave product, to say the least, I am [...]]]></description>
			<content:encoded><![CDATA[<p>I am very excited to receive my Google Wave Developer Sandbox account.</p>
<p>Google Wave is actually three layers - the Product, the Protocol, and the Platform. What I am seeing in the Developer Sandbox is actually the Product using the Platform and the Protocol.</p>
<p>After spending a couple of hours with Google Wave product, to say the least, I am amazed at it&#8217;s complexity and it&#8217;s richness as a comprehensive unconstrained communication platform. If we can conquer it&#8217;s complexity perhaps by using a simpler Google Wave Application, I wonder what this would become in a year.</p>
<p>I cannot help but compare Wave with the traditional communication channels. So, here it goes:</p>
<p>Wave vs. Wiki/Microblogging/Email/IM/IRC:</p>
<ol>
<li>Wave messages live on the Wave server instead of the local client.</li>
<li>A complete history of each Wave as to who did what and when is maintained on the server and it can be replayed any time.</li>
<li>Google Wave is built on the <a href="http://www.waveprotocol.org/draft-protocol-spec" target="_blank">Google Wave Federation Protocol</a> is an extension to the <a href="http://xmpp.org/rfcs/rfc3920.html" target="_blank">core of XMPP</a>.</li>
<li>Liveness: Editing a wave is immediately visible to other users as it is edited it. You can watch your contact edit a wave live.</li>
<li>Tagging and built-in search available.</li>
<li>The Wave platform supports two types of Wave extensions - Gadgets and Robots. This gives Wave a lot of potential, openness and richness.</li>
<li>Google Wave session is encrypted (https).</li>
<li>Google Wave is actually three layers - the Product, the Protocol, and the Platform.</li>
<li>The actual Google Wave UI seems to be very fast and responsive. But, is still very raw and unstable in a few areas. Some features seem to be disabled right now. This is understandable because the beta product is still possibly a few months away.</li>
<li>Google Wave is a web application and so only a browser is required. </li>
</ol>
<p> </p>
<p>I was warned that IE 8 is not a supported browser. However, after I chose the option to continue, it worked. To be safe, I used Google Chrome 2.0 <img src='http://shashivelur.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I plan to read, experiment and blog more about the Google Wave Platform, Protocol and Wave extensions in the near future.</p>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Google+Wave' rel='tag' target='_self'>Google Wave</a>, <a class='technorati-link' href='http://technorati.com/tag/Google+Wave+Developer+Sandbox' rel='tag' target='_self'>Google Wave Developer Sandbox</a>, <a class='technorati-link' href='http://technorati.com/tag/XMPP' rel='tag' target='_self'>XMPP</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/07/my-first-impressions-on-google-wave/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hibernate and Composite keys</title>
		<link>http://shashivelur.com/blog/2009/03/hibernate-and-composite-keys/</link>
		<comments>http://shashivelur.com/blog/2009/03/hibernate-and-composite-keys/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 05:34:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Hibernate]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Composite keys]]></category>

		<category><![CDATA[Composite-id]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=33</guid>
		<description><![CDATA[I like using surrogate keys for most of the database designs for the following reasons:

Simplifies design and may improve efficiency
Maintainability: Change to the meaning of the natural key could change the table structures when using natural keys
Natural key values may be recycled

Having said that, we sometimes are forced to use natural/composite keys when stuck with a [...]]]></description>
			<content:encoded><![CDATA[<p>I like using surrogate keys for most of the database designs for the following reasons:</p>
<ol>
<li>Simplifies design and may improve efficiency</li>
<li>Maintainability: Change to the meaning of the natural key could change the table structures when using natural keys</li>
<li>Natural key values may be recycled</li>
</ol>
<div>Having said that, we sometimes are forced to use natural/composite keys when stuck with a legacy database.</div>
<p>Here is a partial list of issues I have encountered when using Hibernate with composite keys on a legacy database:</p>
<ol>
<li>The documentation (or lack there-of) for Composite Keys usage poses big problems. But, the source code really helps .</li>
<li>Inserts/Updates are slightly inefficient when compared to surrogate keys if there is no versioning strategy implemented.</li>
<li>Cannot have relationships (with CRUD operations) mapped in hibernate for each of the keys in the composite primary key. A read-only collection mapping is possible by mapping the relationship with the same column (that is part of the Composite Key) and making insert=&#8221;false&#8221; and update=&#8221;false&#8221;.</li>
<li>It is impossible to determine if the object to be saved is a new one or an existing one when using &#8220;assigned&#8221; composite keys. Since the keys are &#8220;assigned&#8221;, the primary key is not null and so it is hard to determine if this is a new object without making another call in a new transaction to the DB. This becomes very cumbersome.</li>
<li>The Hibernate reference documentation uses various phrases like &#8220;discourage it for serious applications&#8221; for certain types of Composite-id mappings (<span class="emphasis"><em>embedded</em></span> composite identifier). There are several issues with using key-many-to-one mapping in the Composite-id elements, etc.</li>
<li>In older versions of Hibernate (before 3.3.x), you can&#8217;t use an IdentifierGenerator to generate composite keys. The suggested approach was to use UserType or CompsiteUserType. A lot of people choose to use &#8220;assigned&#8221; strategy to avoid the complications with custom types. I think this is resolved in the latest Hibernate version. Again, the documentation here is almost non-existent. In order to make this work in my code, I had debug through the Hibernate source code and also use the test case code attached in this <a href="http://opensource.atlassian.com/projects/hibernate/browse/HHH-2060?page=com.atlassian.jira.ext.fisheye%3Afisheye-issuepanel" target="_blank">Hibernate CR</a>.</li>
</ol>
<div>I am sure there are more, but I cannot remember them now. But, will blog as I remember them.</div>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Composite+keys' rel='tag' target='_self'>Composite keys</a>, <a class='technorati-link' href='http://technorati.com/tag/Composite-id' rel='tag' target='_self'>Composite-id</a>, <a class='technorati-link' href='http://technorati.com/tag/Hibernate' rel='tag' target='_self'>Hibernate</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/03/hibernate-and-composite-keys/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Mock objects and Testing</title>
		<link>http://shashivelur.com/blog/2009/03/mock-objects-and-testing/</link>
		<comments>http://shashivelur.com/blog/2009/03/mock-objects-and-testing/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 00:10:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Mock Objects]]></category>

		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=35</guid>
		<description><![CDATA[This has been a much discussed topic over the web in the last couple of years. I was responding to one of the emails at work about mock objects. While organizing my thoughts about Mock objects, I decided to write this post.
 
Various thought leaders in TDD promote Mock objects. I agree with some of it but not everything [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">This has been a much discussed topic over the web in the last couple of years. I was responding to one of the emails at work about mock objects. While organizing my thoughts about Mock objects, I decided to write this post.</span></span></p>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"> </p>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">Various thought leaders in TDD promote Mock objects. I agree with some of it but not everything they say. </span></span></p>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;"> </span></span></p>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">Some caution towards using Mocks extensively:</span></span></p>
<ol>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><strong style="mso-bidi-font-weight: normal;"><span style="font-family: ">Using Mock objects might affect design decisions</span></strong><span style="font-family: ">: </span></span></div>
<ul>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">The mocked classes (and the methods used to set up expectations) cannot be final. If called, their normal code may be executed. I prefer making every class either final or abstract unless there is a strong reason to not to do so.</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">A class with only private constructors cannot be instantiated.</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">The behavior for equals() and hashCode() when using mocks may not be what you normally expect.</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">Private methods cannot be mocked. I prefer making every method private unless there is a strong reason to not to do so.</span></span></div>
</li>
</ul>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-size: small;"><strong style="mso-bidi-font-weight: normal;"><span style="font-family: ">Trustworthiness &amp; ROI of Mocks</span></strong><span style="font-family: ">: Mocks may hide integration problems and push the burden on other tests. High-level and End-to-end tests give the most ROI, in my opinion. I would value these over the unit tests that use mocks extensively when constrained by Time &amp; Resources. Most of the times, I have seen that tests using mocks extensively completely miss the intent of the test..!</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-size: small;"></span><span style="font-size: small;"><strong style="mso-bidi-font-weight: normal;"><span style="font-family: ">Increased complexity and maintenance costs</span></strong><span style="font-family: "> - Setting up mock object expectations create clutter and duplication to test code. Mocking Fine-Grained or Chatty Interfaces results in a lot of brittle unit-test code. High-level tests may not require such extensive changes.</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-size: small;"></span><span style="font-family: "><span style="font-size: small;">It is a well-known fact that unit tests (that use mocks extensively) don&#8217;t catch as many bugs as the integration/high-level tests.</span></span></div>
</li>
</ol>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">I do not want leave an impression that I do not like the idea of using Mock objects for testing. We just need to use it for the right things and right places after understanding it’s rewards and risks, just like any other tool/framework.</span></span></p>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;"> </span></span></p>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">Mocking is still suitable for various scenarios that include:</span></span></p>
<ol>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">Testing sub-systems that don&#8217;t exist yet or are being developed separately. But, then after the dependent code is available, I would switch back to real code from mock objects.</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">Legacy code that does not have interfaces and is tightly coupled.</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">Sometimes we may need to mock only some methods of a class and keep the normal behavior of others.</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">Testing against slow/heavyweight components that have significant dependencies.</span></span></div>
</li>
<li>
<div class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">To simplify Unit testing when there are no alternative ways to test the same effectively (for example, if the dependent component is very hard to setup/configure, etc.).</span></span></div>
</li>
</ol>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">IMO, choosing the right scenarios objects (if any) for using Mock objects is the trickiest part. </span></span></p>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "></span> </p>
<p class="MsoPlainText" style="margin: 0in 0in 0pt;"><span style="font-family: "><span style="font-size: small;">I personally avoid using Mock Objects (unless there are no other easy options) by using good OO Design &amp; Programming practices to write my code such that it is testable without having to use Mock Objects.</span></span></p>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Mock+Objects' rel='tag' target='_self'>Mock Objects</a>, <a class='technorati-link' href='http://technorati.com/tag/Unit+Testing' rel='tag' target='_self'>Unit Testing</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/03/mock-objects-and-testing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Feedback for improvement in agility</title>
		<link>http://shashivelur.com/blog/2009/02/feedback-for-improvement-in-agility/</link>
		<comments>http://shashivelur.com/blog/2009/02/feedback-for-improvement-in-agility/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 06:33:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[pair programming]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=32</guid>
		<description><![CDATA[Last week, during a casual chat with our Agile evangelist, I asked about what could be improved in our team based on what he observed.
He quickly said that it depends on a lot of things and that it is difficult to give feedback without being part of the team. He asked me to pose that question to [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, during a casual chat with our Agile evangelist, I asked about what could be improved in our team based on what he observed.</p>
<p>He quickly said that it depends on a lot of things and that it is difficult to give feedback without being part of the team. He asked me to pose that question to the team. We already do that in retrospective meetings.</p>
<p>But, after pushing further to get some high-level things that we could improve upon, he gave me a few suggestions:</p>
<ul>
<li>Adopt pair-programming <strong>for every line of code</strong> that we write.</li>
<li>Increase the level of communication between team members</li>
<li>Everyone needs to <strong>really</strong> pay attention during stand-ups</li>
<li>Work towards overall team productivity rather than individual productivity</li>
<li>&#8230;..</li>
</ul>
<p>My immediate reaction as soon as I heard &#8220;pair-programming for every line of code&#8221; was to point out that it may not be the right thing to do all the time. Now, I realize how stupid I was..! I was asking for feedback. I should have shut my mouth and should have treated every piece of advice as a compliment. I did thank him for his time, however.</p>
<p>This was very valuable feedback. I need to apologize to him tomorrow for arguing with him even if I did not completely agree with his opinion.. <img src='http://shashivelur.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Agile' rel='tag' target='_self'>Agile</a>, <a class='technorati-link' href='http://technorati.com/tag/pair+programming' rel='tag' target='_self'>pair programming</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/02/feedback-for-improvement-in-agility/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Application Configuration properties simplified by Spring</title>
		<link>http://shashivelur.com/blog/2009/02/application-configuration-properties-simplified-by-spring/</link>
		<comments>http://shashivelur.com/blog/2009/02/application-configuration-properties-simplified-by-spring/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 05:59:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[PropertyOverrideConfigurer]]></category>

		<category><![CDATA[PropertyPlaceholderConfigurer]]></category>

		<category><![CDATA[PropertyResourceConfigurer]]></category>

		<category><![CDATA[Spring Beans]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=31</guid>
		<description><![CDATA[The combination of PropertyPlaceholderConfigurer and PropertyOverrideConfigurer classes in Spring Beans API have been invaluable for me to simplify configuration properties for a few of applications I have worked-on recently. The placeholder configurer helps us to share the properties across various pieces of the application using &#8220;placeholders&#8221;.
As recommended in the Spring reference manual, I usually setup a [...]]]></description>
			<content:encoded><![CDATA[<p>The combination of <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html" target="_blank">PropertyPlaceholderConfigurer</a> and <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/PropertyOverrideConfigurer.html" target="_blank">PropertyOverrideConfigurer</a> classes in Spring Beans API have been invaluable for me to simplify configuration properties for a few of applications I have worked-on recently. The placeholder configurer helps us to share the properties across various pieces of the application using &#8220;placeholders&#8221;.</p>
<p>As recommended in the Spring reference manual, I usually setup a &#8220;default&#8221; configuration file (app.properties.default) file that is packaged within one of the main Jar files. This keeps the actual (overriding production) properties file very short as you only override the properties that are different than the default properties file.</p>
<p>Sometimes, a simple loading of the configuration properties may not be enough. There might be a need for post-processing the properties using some custom code.</p>
<p>Certain properties may have to be:</p>
<ul>
<li>Selectively disabled/enabled</li>
<li>Translated based on the values of others</li>
<li>Set &amp; be available within the application (in the code that is not wired-up in Spring XML)</li>
</ul>
<p>Spring does have hooks for some of these to decrypt/encrypt properties, intercept the processing of each of the String values, etc. This means writing a new class that overrides the natural behavior of these Configurer classes.</p>
<p>Both of these Configurer classes are implemented as bean factory post-processors. So, if ApplicationContext is used instead of BeanFactory, these should automagically work. If you are using BeanFactory interface (eg., XMLBeanFactory class), then you will need to construct these Configurer classes and call the &#8220;postProcessBeanFactory&#8221; method by passing the BeanFactory instance as a parameter.</p>
<p>This method is also very helpful if there is a need to centralize the post-processing logic in one place and if this logic involves a lot of custom coding:</p>
<p><code>public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException</code></p>
<p>As per the Javadocs, this method is invoked after all bean definitions have been loaded, but no beans have been instantiated yet.</p>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/PropertyOverrideConfigurer' rel='tag' target='_self'>PropertyOverrideConfigurer</a>, <a class='technorati-link' href='http://technorati.com/tag/PropertyPlaceholderConfigurer' rel='tag' target='_self'>PropertyPlaceholderConfigurer</a>, <a class='technorati-link' href='http://technorati.com/tag/PropertyResourceConfigurer' rel='tag' target='_self'>PropertyResourceConfigurer</a>, <a class='technorati-link' href='http://technorati.com/tag/Spring+Beans' rel='tag' target='_self'>Spring Beans</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/02/application-configuration-properties-simplified-by-spring/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Best way to demo/learn a Java-based API</title>
		<link>http://shashivelur.com/blog/2009/02/best-way-to-demolearn-a-java-based-api/</link>
		<comments>http://shashivelur.com/blog/2009/02/best-way-to-demolearn-a-java-based-api/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 05:07:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Calling Java from JRuby]]></category>

		<category><![CDATA[Dual-API SDK]]></category>

		<category><![CDATA[Dynamic languages]]></category>

		<category><![CDATA[irbrc]]></category>

		<category><![CDATA[JPython]]></category>

		<category><![CDATA[JRuby]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=30</guid>
		<description><![CDATA[I designed and implemented a dual-API SDK at my current job. This dual-API SDK did not initially run on any application server.
During this implementation, I learnt that it is best to use a dynamic language like JRuby or JPython or Groovy for demonstrating &#38; learning the capabilities of the API as well as interactively test some edge-case scenarios that are not [...]]]></description>
			<content:encoded><![CDATA[<p>I designed and implemented a dual-API SDK at my current job. This dual-API SDK did not initially run on any application server.</p>
<p>During this implementation, I learnt that it is best to use a dynamic language like JRuby or JPython or Groovy for demonstrating &amp; learning the capabilities of the API as well as interactively test some edge-case scenarios that are not so easy to automate (randomly causing network outages, database outages, etc.). This was very useful especially at the Sprint reviews to demonstrate the new functionality.</p>
<p>It is incredibly easy it is to set up some complex scenarios interactively using the Java API calls in one of the above 3 dynamic languages. We are still using JDK 5 and so could not take advantage of the built-in scripting support in JDK 6.</p>
<p>We chose to use JRuby (due to the familiarity of Ruby to some developers) even though my favorite was JPython, especially because I have had experience building a large-scale enterprise system using Python in one of my previous jobs at a startup.</p>
<p>However, we ran in to one big problem: The APIs (API interfaces) that use Java Generics were impossible to test using JRuby. We kept the usage of generics to very minimal in our client API interfaces but for obvious reasons our SPI-side interfaces used generics heavily.</p>
<p>After a while, I also realized that it is impossible to type all of the JIRB commands correctly. Any typos in JIRB can lead to really ugly stack traces on the console. Hence, the need for tab-completion and file-based history to remember all of the commands that can be accessed by using the up-arrow/down-arrow keys.</p>
<p>Also, as a nice touch to our Sprint review demos, we customized the command prompt to display our product name (I have changed that to &#8220;MYSDK&#8221;, below). So, the following .irbrc file was created and copied to the user.home dir.</p>
<p><code><br />
# ~/.irbrc<br />
# enables Tab completion<br />
require 'irb/completion'</p>
<p>#IRB.conf[:PROMPT_MODE] = :SIMPLE<br />
IRB.conf[:USE_READLINE] = true<br />
IRB.conf[:ECHO] = false<br />
IRB.conf[:IRB_NAME] = &#8220;MYSDK&#8221;<br />
IRB.conf[:DEBUG_LEVEL] = 0<br />
IRB.conf[:AUTO_INDENT_MODE] = true</p>
<p># Setup a file-based history across sessions of irb<br />
require &#8216;irb/ext/save-history&#8217;<br />
IRB.conf[:SAVE_HISTORY] = 100<br />
IRB.conf[:HISTORY_FILE] = &#8220;#{ENV['IRBRC']}-history&#8221;</p>
<p>require &#8216;java&#8217;<br />
import java.lang.System</p>
<p># SDK stuff<br />
# My SDK imports go here..<br />
</code></p>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Calling+Java+from+JRuby' rel='tag' target='_self'>Calling Java from JRuby</a>, <a class='technorati-link' href='http://technorati.com/tag/Dual-API+SDK' rel='tag' target='_self'>Dual-API SDK</a>, <a class='technorati-link' href='http://technorati.com/tag/Dynamic+languages' rel='tag' target='_self'>Dynamic languages</a>, <a class='technorati-link' href='http://technorati.com/tag/irbrc' rel='tag' target='_self'>irbrc</a>, <a class='technorati-link' href='http://technorati.com/tag/JPython' rel='tag' target='_self'>JPython</a>, <a class='technorati-link' href='http://technorati.com/tag/JRuby' rel='tag' target='_self'>JRuby</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/02/best-way-to-demolearn-a-java-based-api/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OSGi for Web Applications?</title>
		<link>http://shashivelur.com/blog/2009/01/osgi-for-web-applications/</link>
		<comments>http://shashivelur.com/blog/2009/01/osgi-for-web-applications/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 05:43:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[OSGi]]></category>

		<category><![CDATA[Web Technologies]]></category>

		<category><![CDATA[Equinox]]></category>

		<category><![CDATA[Jetty]]></category>

		<category><![CDATA[OSGi Compendium]]></category>

		<category><![CDATA[OSGi HTTP Service]]></category>

		<category><![CDATA[Servlet Bridge]]></category>

		<category><![CDATA[SpringDM]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=29</guid>
		<description><![CDATA[Web applications are the most common type of deployments on the application servers.
So, if OSGi is going to be a serious contender in the application server market, I would expect it to have great support for deploying web applications using WAR files. So, I looked through the existing documentation on eclipse.org and played with Equinox, [...]]]></description>
			<content:encoded><![CDATA[<p>Web applications are the most common type of deployments on the application servers.</p>
<p>So, if OSGi is going to be a serious contender in the application server market, I would expect it to have great support for deploying web applications using WAR files. So, I looked through the existing documentation on eclipse.org and played with Equinox, Tomcat and Jetty. Here is what I have learned so far:</p>
<p>There are two ways to integrate Equinox&#8217;s implementation of OSGi into your server-side environment:</p>
<ol>
<li><a href="http://www.eclipse.org/equinox/server/http_in_equinox.php" target="_blank">Embed your web application server within OSGi server</a>
<ul>
<li>Native OSGi HTTP service implementation of Servlet API 2.4</li>
<li>Jetty-based implementation - Also requires the usage of the dynamic OSGi HTTP Service.</li>
</ul>
</li>
<li><a href="http://www.eclipse.org/equinox/server/http_in_container.php" target="_blank">Embed OSGi server into your existing web application server</a>
<ul>
<li>Equinox Bridge Servlet (Front controller servlet)</li>
<li>Dynamic OSGi HTTP Service using the Equinox Bridge Servlet</li>
</ul>
</li>
</ol>
<p>Option #1 means that the developer is forced to use OSGi HTTP Service. This is great for new web applications built from scratch. The user can programmatically register the servlets and add service listeners to listen for any events (if any one of these instances are started, stopped or updated, we are notified). But, this complicates the development effort required for making an existing WAR file work with this setup. Traditionally, Servlets have been considered &#8220;static&#8221; - They do not have to be installed/started/stopped dynamically. So, the &#8220;dynamic&#8221; OSGi HTTP service becomes an overkill in this particular case, IMO. The other disadvantage of this approach is that not all aspects of the Servlet spec are implemented here. For ex., Servlet Filters are not yet available in the native OSGi HTTP service implementation. I am not sure how clustering can be achieved here.</p>
<p>Option #2 uses the standard &#8220;Front-controller&#8221; pattern and uses the Bridge Servlet as a Front controller servlet. org.eclipse.equinox.servletbridge and the Servlet API are exported automatically to the underlying OSGi framework. So, the modules deployed in the OSGi server have access to the Servlet API to register/unregister servlets. This approach obviously uses the web.xml. So, you can add more servlet mappings for JSPs, if necessary. The other sub-options here revolves around using this Servlet bridge to provide the dynamic OSGi HTTP service.</p>
<p>So, I do not feel comfortable with both of the above options provided by Equinox OSGi implementations. Perhaps, other implementations might have better solutions.</p>
<p>No wonder the folks at SpringSource chose not to implement OSGi HTTP service in their SpringDM server platform for now. They support the standard WAR file deployment within their embedded Tomcat server. This seems like a pragmatic approach to me to support all the existing standard Web Application Archive (WAR) files.</p>
<p>Although I like the other dynamic services (Logging, Configuration, Event Admin Service, etc.) in the OSGi Service Compendium, I am not so sure about the HTTP Service, especially for existing web applications.</p>
<p>What do you think?</p>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Equinox' rel='tag' target='_self'>Equinox</a>, <a class='technorati-link' href='http://technorati.com/tag/Jetty' rel='tag' target='_self'>Jetty</a>, <a class='technorati-link' href='http://technorati.com/tag/OSGi+Compendium' rel='tag' target='_self'>OSGi Compendium</a>, <a class='technorati-link' href='http://technorati.com/tag/OSGi+HTTP+Service' rel='tag' target='_self'>OSGi HTTP Service</a>, <a class='technorati-link' href='http://technorati.com/tag/Servlet+Bridge' rel='tag' target='_self'>Servlet Bridge</a>, <a class='technorati-link' href='http://technorati.com/tag/SpringDM' rel='tag' target='_self'>SpringDM</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/01/osgi-for-web-applications/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Stig&#8217;s identity revealed..!</title>
		<link>http://shashivelur.com/blog/2009/01/stigs-identity-revealed/</link>
		<comments>http://shashivelur.com/blog/2009/01/stigs-identity-revealed/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 05:16:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Cars]]></category>

		<category><![CDATA[Stig]]></category>

		<category><![CDATA[TopGear]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=19</guid>
		<description><![CDATA[TopGear is one my favorite TV shows. One of the attractions about TopGear was the suspense about the Stig, especially after the hilarious introductions (&#8221;some say&#8230;..&#8221;) of the Stig by Jeremy Clarkson in almost every show.
Today, this was revealed by BBC. The facts are even more shocking. I just cannot believe it..! He is 80+ yrs old Graham [...]]]></description>
			<content:encoded><![CDATA[<p>TopGear is one my favorite TV shows. One of the attractions about TopGear was the suspense about the Stig, especially after the hilarious introductions (&#8221;some say&#8230;..&#8221;) of the Stig by Jeremy Clarkson in almost every show.</p>
<p>Today, this was <a href="http://www.topgear.com/us/blog/more/the-stig-is-revealed/" target="_blank">revealed by BBC</a>. The facts are even more shocking. I just cannot believe it..! He is 80+ yrs old Graham Hill, who won the GP World Drivers Championship in 1962 and 1968 and was reported to have died in a crash back in the 70&#8217;s..!</p>
<p>TopGear rocks..!</p>
<p>Here are some more reasons why I love them so much:</p>
<ul>
<li>In-depth knowledge &amp; expertise, great reviews of automobiles</li>
<li>Humorous and Witty</li>
<li>Camaraderie among the presenters and stereotyped characters (&#8221;Captain slow&#8221;, &#8220;Hamster&#8221;, etc..)</li>
<li>Hillarious &amp; Insane ideas and Challenges involving automobiles</li>
</ul>
<p>I guess TopGear could not hold back Stig&#8217;s identity after all the crazy speculation amongst the viewers.</p>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Cars' rel='tag' target='_self'>Cars</a>, <a class='technorati-link' href='http://technorati.com/tag/Stig' rel='tag' target='_self'>Stig</a>, <a class='technorati-link' href='http://technorati.com/tag/TopGear' rel='tag' target='_self'>TopGear</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/01/stigs-identity-revealed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hibernate direct field acess and encapsulation</title>
		<link>http://shashivelur.com/blog/2009/01/hibernate-direct-field-acess-and-encapsulation/</link>
		<comments>http://shashivelur.com/blog/2009/01/hibernate-direct-field-acess-and-encapsulation/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 22:05:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Hibernate]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[direct field access]]></category>

		<category><![CDATA[encapsulation]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=28</guid>
		<description><![CDATA[I am a big fan of the Hibernate&#8217;s direct field access functionality. I am not sure why &#8221;property&#8221; access is the default instead of &#8220;field&#8221;. Direct field access allows me to control the number of getters/setters that are actually needed from the DAO Client&#8217;s perspective.
I think using property access helps enforce better encapsulation of the data in the mapped/persistent classes. [...]]]></description>
			<content:encoded><![CDATA[<p>I am a big fan of the Hibernate&#8217;s direct field access functionality. I am not sure why &#8221;property&#8221; access is the default instead of &#8220;field&#8221;. Direct field access allows me to control the number of getters/setters that are actually needed from the DAO Client&#8217;s perspective.</p>
<p>I think using property access helps enforce better encapsulation of the data in the mapped/persistent classes. I have seen that most developers just use public getters and setters for all of the properties in the mapped class.</p>
<p>This creates problems for collections, especially. I seldom expose getters and setters for collections. I always use a combination of &#8220;addXXX(Obj)&#8221;, &#8220;removeXXX(Obj)&#8221; and &#8220;clearXXX()&#8221; (depending upon the need) instead of &#8220;get/setXXX&#8221;. This is for efficiency (as Hibernate uses a custom collection class) and better encapsulation.</p>
<p>The only situations where I do not use the direct field access are:</p>
<ul>
<li>If the DB schema data type does not directly map to the mapped attribute in Java where a translation is required. This is mostly true for Legacy Database schemas and also where custom introducing custom SQL type mapping is not an option perhaps due to inconsistent use of the same data type in legacy applications.</li>
<li>If there are dependent (child) tables that have composite primary keys (which include the primary key of the parent table). In this case, for saving a new entity I would need to intercept the setter of the primary key of the parent table to set the appropriate fields in the child tables.</li>
<li>If I use lazy initialization, I would use property access for the primary key. This allows us to call persistentObj.getId() without completely initializing the proxy. This is applicable only for the &#8220;Id&#8221; field.</li>
<li>If there is any other need to intercept the getters/setters for whatever reasons (validation, logging, debugging, etc.). This is very unlikely.</li>
</ul>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/direct+field+access' rel='tag' target='_self'>direct field access</a>, <a class='technorati-link' href='http://technorati.com/tag/encapsulation' rel='tag' target='_self'>encapsulation</a>, <a class='technorati-link' href='http://technorati.com/tag/Hibernate' rel='tag' target='_self'>Hibernate</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/01/hibernate-direct-field-acess-and-encapsulation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Agility and large Backlogs</title>
		<link>http://shashivelur.com/blog/2009/01/agility-and-large-backlogs/</link>
		<comments>http://shashivelur.com/blog/2009/01/agility-and-large-backlogs/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 06:05:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Agile Best practices]]></category>

		<category><![CDATA[Backlog]]></category>

		<category><![CDATA[large backlogs]]></category>

		<guid isPermaLink="false">http://shashivelur.com/blog/?p=26</guid>
		<description><![CDATA[Backlog is used for prioritizing, tracking and communicating the work (work items) to be done in the future Iterations/Sprints.
There may be multiple teams working from one backlog, but if there are more than 3-5 sprints worth of work items for all teams working on that backlog, then I consider that to be huge. I have [...]]]></description>
			<content:encoded><![CDATA[<p>Backlog is used for prioritizing, tracking and communicating the work (work items) to be done in the future Iterations/Sprints.</p>
<p>There may be multiple teams working from one backlog, but if there are more than 3-5 sprints worth of work items for all teams working on that backlog, then I consider that to be huge. I have noticed that if the product owner is not careful, the backlog can grow and become really huge.</p>
<p>This is not good for several reasons:</p>
<ul>
<li>It is depressing for the everyone on the team. This may lead to a belief among team members that this is a case of a large product with not enough resources.</li>
<li>Priorities change - It is a waste of effort for the product owners to endlessly sort through the work items in the backlog every Sprint to come up with a list of stories for a Sprint.</li>
<li>Some of the items in the backlog are never worked upon even after months/years. In that case why spend effort prioritizing them?</li>
<li>It is hard to react to change in the market conditions, when the teams are so focussed on possibly &#8220;stale&#8221; requirements in a backlog.</li>
</ul>
<p>So, what are the possible causes for this?</p>
<ol>
<li>Lack of clarity of product vision.</li>
<li>Disagreements between the product management and marketing about the importance of features. So, the &#8220;unimportant&#8221; ones (mostly due to disagreements) find the bottom of the backlog.</li>
<li>Product owners unable to decide on the &#8220;business value&#8221; and ROI on requirements in the backlog. This may be due to the lack of authority (to do so) or communication breakdown or just the organization culture itself.</li>
<li>Sometimes, for various reasons, a suite of products might have one product owner per product who do not necessarily agree on everything especially when it comes to the cross-product requirements.</li>
<li>Inadequate resources, unstable team, attritions, shuffled team members, not-so-well-performing teams, etc.</li>
<li>Treating defects as backlog items. Sometimes, a lot of medium defects are tossed in to the backlog.</li>
<li>Poor/Complex Technical Architecture - This means that the features get done much slower than estimated.</li>
</ol>

<!-- start wp-tags-to-technorati 0.9 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Agile' rel='tag' target='_self'>Agile</a>, <a class='technorati-link' href='http://technorati.com/tag/Agile+Best+practices' rel='tag' target='_self'>Agile Best practices</a>, <a class='technorati-link' href='http://technorati.com/tag/Backlog' rel='tag' target='_self'>Backlog</a>, <a class='technorati-link' href='http://technorati.com/tag/large+backlogs' rel='tag' target='_self'>large backlogs</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://shashivelur.com/blog/2009/01/agility-and-large-backlogs/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
