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

<channel>
	<title>Source Allies Blog &#187; Sudhakar Ramasamy</title>
	<atom:link href="http://blogs.sourceallies.com/author/sramasamy/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sourceallies.com</link>
	<description>Technical and process thinking from Source Allies employees</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:45:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Moving to a new home</title>
		<link>http://blogs.sourceallies.com/2011/04/moving-to-a-new-home/</link>
		<comments>http://blogs.sourceallies.com/2011/04/moving-to-a-new-home/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 02:36:05 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=2125</guid>
		<description><![CDATA[As of May 2nd I will no longer be employed at Source Allies. My blog has a new home at http://blog.sudr.info. Feel free to follow me there.
]]></description>
			<content:encoded><![CDATA[<p>As of May 2nd I will no longer be employed at Source Allies. My blog has a new home at <a href="http://blog.sudr.info">http://blog.sudr.info</a>. Feel free to follow me there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2011/04/moving-to-a-new-home/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploring Design Patterns in the JDK</title>
		<link>http://blogs.sourceallies.com/2010/11/exploring-design-patterns-in-the-jdk/</link>
		<comments>http://blogs.sourceallies.com/2010/11/exploring-design-patterns-in-the-jdk/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 02:42:17 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[patterns]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=1690</guid>
		<description><![CDATA[Design Patterns are software design solutions that can be applied in our daily software development to help us develop code that is flexible, resilient to change and easily understood (when you are familiar with the pattern). The JDK APIs employ patterns in several areas. So even if you aren&#8217;t familiar with patterns if you&#8217;ve programmed [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)">Design Patterns</a> are software design solutions that can be applied in our daily software development to help us develop code that is flexible, resilient to change and easily understood (when you are familiar with the pattern). The JDK APIs employ patterns in <a href="http://stackoverflow.com/questions/1673841/examples-of-gof-design-patterns">several areas</a>. So even if you aren&#8217;t familiar with patterns if you&#8217;ve programmed in Java, you&#8217;ve been developing against APIs that have been built using patterns.</p>
<p><span id="more-1690"></span></p>
<p>One of the JDK APIs that has always thrown me for a spin is <a href="http://download.oracle.com/javase/6/docs/api/java/io/package-summary.html">java.io</a> with its gamut of InputStream and OutputStream classes. I never had a full grasp of how the API was meant to be used until recently. I knew just enough to get what I needed to get done without going down the rabbit hole. While reading the excellent <a href="http://headfirstlabs.com/books/hfdp/">Head First Design Patterns</a> book, the chapter on the <a href="http://sourcemaking.com/design_patterns/decorator">Decorator Pattern</a> demonstrated how the java.io API is built on the Decorator Pattern. Once I made this connection, the complexity of java.io disappeared. This also explained why the API seems like a mess to begin with. If you&#8217;ve used the decorator pattern you can quite easily discern that the apparent API complexity is one downside to this pattern.</p>
<p>I intend to start a blog series on exploring the patterns that exist in the JDK APIs. The JDK APIs are fertile terrritory to see patterns as applied in the real world instead of the text book examples found in many design pattern books. The goal is two-fold. One to understand the APIs from our understanding of the patterns. And two to understand the patterns from our understanding of the APIs. Hopefully with this double-ended approach our understanding and appreciation of both the pattern and the API will be enhanced.</p>
<p>Please use the comments to point out any patterns/APIs that you would like to see in this series. My first post will be on the java.io APIs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2010/11/exploring-design-patterns-in-the-jdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoid merge hell when committing from Git to a Subversion repository</title>
		<link>http://blogs.sourceallies.com/2010/10/avoid-merge-hell-when-committing-from-git-to-an-svn-repository/</link>
		<comments>http://blogs.sourceallies.com/2010/10/avoid-merge-hell-when-committing-from-git-to-an-svn-repository/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 06:34:08 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[git svn subversion]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=1644</guid>
		<description><![CDATA[Previously (I sound like an episode of desperate housewives!) we saw how we can easily commit an existing Git repository into Subversion. That was great and we can commit changes to our git repository and execute git svn dcommit all day long to send the changes up to Subversion. Now things get a little hairy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.sourceallies.com/2010/09/how-to-commit-an-existing-git-project-into-subversion/">Previously</a> (I sound like an episode of desperate housewives!) we saw how we can easily commit an existing Git repository into Subversion. That was great and we can commit changes to our git repository and execute <strong>git svn dcommit</strong> all day long to send the changes up to Subversion. Now things get a little hairy when you throw a second developer into the mix who is committing to the same Subversion repository.<br />
<span id="more-1644"></span><br />
If you&#8217;ve seen the <em>Merge conflict during commit: Your file or directory&#8230;</em> error message when doing a git svn dcommit don&#8217;t panic yet. See <a href="http://stackoverflow.com/questions/629048/git-svn-dcommit-error-restart-the-commit">here</a> on how to resolve this. I&#8217;m not going to talk about how to fix this issue. Instead we will look at what the appropriate workflow should&#8217;ve been to begin with once we got our Git repository committed into Subversion.</p>
<p>If you don&#8217;t have a Git repository that is linked up with a Subversion location, here are the Git commands that will bring down a project in Subversion into a Git repository on your workstation:</p>
<p><code>$ mkdir myproject<br />
$ cd myproject<br />
$ git svn init --trunk=http://my.svnserver.com/repos/myproject/trunk \<br />
--tags=http://my.svnserver.com/repos/myproject/tags \<br />
--branches=http://my.svnserver.com/repos/myproject/branches \<br />
--username &lt;your svn username&gt;<br />
$ git svn fetch -r &lt;starting subversion revision # to fetch from&gt;</code></p>
<p>Note: I&#8217;ve had much better luck using a more recent revision number in Subversion than trying to checkout the entire project history.</p>
<p>Now that we have our repositories laid out lets get to work. The key point to remember is we never commit to the master branch in our Git repository. Instead we use master to simply keep up with the project&#8217;s trunk in Subversion. So the only git commands that get executed on the master are <strong>git svn fetch</strong> followed by <strong>git rebase trunk</strong>. We&#8217;ll go into these in more detail below.</p>
<p>We have a bunch of changes to make in the project. Here&#8217;s what our workflow is going to look like:</p>
<p>Step 1: Create a separate branch (say local-dev) from master where we make our changes.<br />
<code>$ git checkout master    # make sure you are on the master branch<br />
$ git checkout -b local-dev            # the new branch where we make all our changes</code></p>
<p>Step 2: Proceed to make changes on the local-dev branch<br />
<code>$ git add FileThatChanged<br />
$ git commit -m 'your commit message'</code></p>
<p>Step 3: Now stash away any changes in our working copy that we haven&#8217;t committed into git and that we don&#8217;t want pushed up to Subversion<br />
<code>$ git stash</code></p>
<p>Step 4: Update our master branch with any changes that have happened on Subversion trunk since the last time we fetched from Subversion.<br />
<code>$ git checkout master #switch back to the master branch since that's what we use to track Subversion trunk<br />
$ git svn fetch           # pull down the changes from Subversion into the remotes/trunk<br />
$ git rebase trunk      # apply any changes from Subversion onto the master branch<br />
$ git log                   # to view the changes we got from Subversion</code></p>
<p>Note: See this <a href="http://www.jukie.net/bart/blog/pimping-out-git-log">post</a> for a sweet tip on customizing your git log messages to be more easily readable.  </p>
<p>Step 5: Update local-dev with the changes from master<br />
<code>$ git checkout local-dev # switch to our local development branch<br />
$ git rebase master       # apply all the changes that were brought down from Subversion trunk into master into our local-dev resolving any conflicts<br />
$ git log                      # notice how the Git rebase command moved our commit to be last commit on this branch</code></p>
<p>Step 6: Push our commit to Subversion trunk<br />
<code>$ git svn dcommit</code></p>
<p>Step 7: Bring back our changes that were stashed<br />
<code>$ git stash pop</code></p>
<p>Rinse and repeat. It probably reads like a lot more work that it really is especially once you&#8217;ve gotten the hang of the workflow. But this should avoid the merge hell &#8230;or impasse rather when syncing with Subversion. Now, what are you waiting for. Go Git that project from Subversion!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2010/10/avoid-merge-hell-when-committing-from-git-to-an-svn-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to commit an existing git project into Subversion</title>
		<link>http://blogs.sourceallies.com/2010/09/how-to-commit-an-existing-git-project-into-subversion/</link>
		<comments>http://blogs.sourceallies.com/2010/09/how-to-commit-an-existing-git-project-into-subversion/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 00:32:03 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[git svn subversion]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=1640</guid>
		<description><![CDATA[In my last post I mentioned how Git&#8217;s stash feature finally convinced me that it made sense in my subversion world. Well, once I was well underway on my new project, I&#8217;d reached the point where I was ready to commit version 0.1 to subversion. Googling for how to commit a Git project into Subversion [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://blogs.sourceallies.com/2010/09/one-good-reason-why-git-makes-sense/">last</a> post I mentioned how Git&#8217;s stash feature finally convinced me that it made sense in my subversion world. Well, once I was well underway on my new project, I&#8217;d reached the point where I was ready to commit version 0.1 to subversion. Googling for how to commit a Git project into Subversion will lead you to a few resources. The one that was spot on with a minor wrinkle was <a href="http://brandon.dimcheff.com/2009/01/04/commit-a-linear-git-history-to-subversion.html">this</a> post. I&#8217;ve taken what Brandon posted there and condensed it here with the update for the &#8211;root option for the rebase command.<br />
<span id="more-1640"></span></p>
<p><strong>Step 1:</strong> Create the project folder in svn with the recommended layout<br />
http://my.svnserver.com/repos/myproject<br />
http://my.svnserver.com/repos/myproject/trunk<br />
http://my.svnserver.com/repos/myproject/tags<br />
http://my.svnserver.com/repos/myproject/branches</p>
<p><strong>Step 2:</strong> Backup your project&#8217;s git repo just in case. From within your project&#8217;s root directory run<br />
$ git branch master.bak master</p>
<p><strong>Step 3:</strong> Link your git repo to the newly created svn location<br />
$ git svn init -s http://my.svnserver.com/repos/myproject<br />
$ git svn fetch</p>
<p><strong>Step 4:</strong> Put all our commits onto the remote trunk repo<br />
$ git rebase &#8211;onto trunk &#8211;root master</p>
<p><strong>Strp 5:</strong> Finally commit everything to subversion<br />
$ git svn dcommit</p>
<p>All git commits along with the commit history will make it to svn. Except the timestamp of the individual commits will not be preserved.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2010/09/how-to-commit-an-existing-git-project-into-subversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>One good reason why Git makes sense</title>
		<link>http://blogs.sourceallies.com/2010/09/one-good-reason-why-git-makes-sense/</link>
		<comments>http://blogs.sourceallies.com/2010/09/one-good-reason-why-git-makes-sense/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 22:45:38 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=1585</guid>
		<description><![CDATA[When I first heard about distributed version control systems and Git about a year and a half ago, I was very much a Subversion user both at work and at home. I knew how to setup Subversion, it&#8217;s ACLs and make it available over http via Apache. You could say I was committed (pun intended). [...]]]></description>
			<content:encoded><![CDATA[<p>When I first heard about distributed version control systems and <a href="http://git-scm.com/">Git</a> about a year and a half ago, I was very much a <a href="http://subversion.tigris.org/">Subversion</a> user both at work and at home. I knew how to setup Subversion, it&#8217;s ACLs and make it available over http via Apache. You could say I was committed (pun intended). And then all this noise about <a href="http://en.wikipedia.org/wiki/Distributed_revision_control">DVCS</a> and in particular Git and I was wondering why in the world would anyone give away control over their code repository. If I wanted to work disconnected from the network (say on the airplane like everyone seemed to want) I would just work and worry about checking things back in when I connected to the network next.</p>
<p>In spite of being a non-believer I stayed with Git and what seemed like the hype around it. I read up on it and I even got myself an account on <a href="http://github.com/">github</a> and setup a few projects there. Git seemed interesting but it wasn&#8217;t really solving any problems for me that Subversion wasn&#8217;t already. And then I had my first ah ha! moment yesterday. </p>
<p><span id="more-1585"></span></p>
<p>So I was building out a new application at work where we use Subversion. Instead of checking in the initial project skeleton into Subversion like I normally would&#8217;ve I did a <a href="http://www.kernel.org/pub/software/scm/git/docs/git-init.html">git init</a> on the project and decided to use git till I was ready to commit it to Subversion (btw stay tuned for how easy this is in a later post). I noticed with Git I was committing much more frequently and much smaller changes. Probably because I knew that when I was ready to push the code to Subversion and share it with the rest of the team I could easily collapse my commits. This is nice but not my ah ha! moment yet. </p>
<p>After one such frequent <a href="http://www.kernel.org/pub/software/scm/git/docs/git-commit.html">git commit</a>, I started working on a new feature and half way through realized I didn&#8217;t want to go that route and needed to implement it differently. But I didn&#8217;t want to lose all the things I put in place for this feature if I ever needed to come back to it or to refer to it in the future. And so here it comes &#8211; I used the <a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html">git stash</a> command to save away my uncommitted changes and revert my working copy back to the last commit. So now I had a fresh starting point and I also had all the work that I&#8217;d done saved away for the future if I needed it. I could not imagine doing this in Subversion as easily having to deal with it in the past. You could use branches in Subversion but it is a much more heavy weight solution for this.</p>
<p>So there you go, my first Git ah ha! moment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2010/09/one-good-reason-why-git-makes-sense/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Musings of a SpringOne 2009 Attendee – Day 4</title>
		<link>http://blogs.sourceallies.com/2010/03/musings-of-a-springone-2009-attendee-%e2%80%93-day-4/</link>
		<comments>http://blogs.sourceallies.com/2010/03/musings-of-a-springone-2009-attendee-%e2%80%93-day-4/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 16:00:53 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[SpringOne]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=535</guid>
		<description><![CDATA[This is the last and final part on my SpringOne 2009 experience. It&#8217;s late catching up to the 3 earlier posts but it&#8217;s here now. This post summarizes the sessions I attended from day 4 and wraps up with a summary of my take aways. If you want to catch up here are the three [...]]]></description>
			<content:encoded><![CDATA[<p>This is the last and final part on my SpringOne 2009 experience. It&#8217;s late catching up to the 3 earlier posts but it&#8217;s here now. This post summarizes the sessions I attended from day 4 and wraps up with a summary of my take aways. If you want to catch up here are the three earlier posts:</p>
<ol>
<li><a href="http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-day-1">Musings of a SpringOne 2009 Attendee Day 1</a></li>
<li><a href="http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-day-2">Musings of a SpringOne 2009 Attendee Day 2</a></li>
<li><a href="http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-day-3">Musings of a SpringOne 2009 Attendee Day 3</a></li>
</ol>
<p>Read on for day 4.</p>
<p><span id="more-535"></span></p>
<h2><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15408">OSGi and Groovy Jump Start</a></h2>
<p>The presentation started with a <a href="http://www.youtube.com/watch?v=eTRM5n3khw8">5 minute youtube video</a> preview which I thought was pretty innovative.</p>
<p>The first half was around what is OSGi, some of which I&#8217;ve had experience with. I did pick up on a few key concepts that I didn&#8217;t know i wasn&#8217;t communicating earlier in my own presentations on OSGi.</p>
<p>We covered how a groovy POGO has groovy types in the public API. So if your groovy bundle has the groovylib in it&#8217;s classpath then it has to export the groovy package. Also when using Groovy in OSGi, if possible use POJOs for your applications type system since POGOs force you to expose couple groovy types in the bundle&#8217;s API.</p>
<p>The examples were done using <a href="http://www.gradle.org/">gradle</a> and this was my first live example of using gradle. This is a key benefit of conferences &#8212; being exposed to technologies you may otherwise not have the time to take a peek at.</p>
<p>I liked how the presenter took the path of not making things look complex but rather simplifying the concepts. He did this with concepts such as the  OSGi bundle lifecycle.</p>
<p>Some of the tools covered in this session were:</p>
<ul>
<li>bnd to create a groovy manifest</li>
<li>osgi bundle for gradle uses bnd</li>
<li>junit4osgi</li>
</ul>
<h2><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=16462">Expand your business with Groovy &#8211; Case Study</a></h2>
<p>This session was a case study on how a monolithic application was extended to provide customizations using groovy. A major customer had approached  HypericQ wanting a custom dashboard.</p>
<p>HypericQ developed a architecture around attach point&#8217;s which are places within the UI where plugins can connect to.</p>
<p>Custom UI was provided by gsp templates for customer specific dashboards.</p>
<p>Groovy templates was used as the templating framework that allowed clients to build their own using GSP  pages.</p>
<p>A Web Services API was provided as part of the core platform that enabled several benefits:<br />
- hqapi command line interaction<br />
- allows integration testing of the application<br />
- embedding a groovy console inside the application<br />
- console gives you a HQL way to query the domain and not worry about the end customers database environment</p>
<p>The talk was an interesting exercise in how a dynamic plugin architecture could be implemented. <a href="http://docs.codehaus.org/display/GROOVY/Groovy+Categories">Groovy categories</a> was heavily used to enable this.</p>
<h2><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15779">Re-factoring a Spring Application for SOA using Spring technologies in 40 min</a></h2>
<p>The current focus of SOA is really software architecture. SOA is neither static nor predictable. The architectural pattern of any application must be reflective of the business. SOA is preparing the stuff that is critical to your business to stand the test of time. </p>
<p>Architecture involves the courage to be wrong while minimizing the impact of being wrong. It is about making educated decisions between speed and perfection. The longer it takes to deliver the software the higher the client&#8217;s expectations of that software is.</p>
<p>The foundation of SOA is highly cohesive, loosely coupled modules. One must practice</p>
<ol>
<li>strategy first programming</li>
<li>process life-cycle dynamics</li>
<li>process collaboration</li>
<li>loose coupling promotes a network based architecture over a hierarchical one &#8211; composition over inheritance</li>
</ol>
<p>SOA and OSGi enable embracing change by making versioning a runtime concept.</p>
<p>There is an argument to be made for deploying a process as a whole in BPEL. But what about flexible orchestration via simple messaging. We were given the American football analogy. Each play is scripted, but between plays we need to adjust strategy to meet the overall goal. </p>
<p>Modern event driven architecture was mentioned as a composite process linked together in a linear fashion through the use of rule based pathing.</p>
<p>The second half of this talk was the Spring booking demo from Spring Web Flow project. There are 3 OSGi bundles:</p>
<ol>
<li>war bundle</li>
<li>service bundle</li>
<li>datasource bundle</li>
</ol>
<p>The demo was using STS and it&#8217;s DM Server tooling. The entire development workflow was very seamless with SpringSource having done an awesome job of the tooling.</p>
<p>We saw an example of a transparent failover. So there is a need to take down the primary database for maintenance work without taking the application down. A backup datasource bundle is started and the primary datasource bundle is stopped. The datasource bundle is a simple datasource definition and an osgi service with ranking. Because of a higher rank the backup datasource bundle takes precendence and the primary datasource bundle can be safely stopped. Bundles can also take advantage of filtering besides ranking. </p>
<p>Spring Integration builds on pipes and filters. You can expose OSGi services as pipes. It provides the ability to change the behavior of a modularized application by changing how the modules are hooked up in the XML as opposed to modifying source code or in cases where the source code is not available.</p>
<h2>Conference Wrap Up</h2>
<p>Here are my key take aways:</p>
<ul>
<li>It is time for Grails</li>
<li>Need to investigate Spring Faces</li>
<li><a href="http://www.owasp.org/index.php/Category:OWASP_WebGoat_Project">Webgoat</a></li>
<li>Spring Web Flow</li>
<li>Spring Integration</li>
<li>Spring DM Server</li>
</ul>
<p>Overall it was a very productive conference and I would recommend it for anyone looking to attend it next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2010/03/musings-of-a-springone-2009-attendee-%e2%80%93-day-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running a Technical Book Club &#8211; Take 1</title>
		<link>http://blogs.sourceallies.com/2010/02/running-a-technical-book-club-take-1/</link>
		<comments>http://blogs.sourceallies.com/2010/02/running-a-technical-book-club-take-1/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 16:00:48 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[book club]]></category>
		<category><![CDATA[continuous learning]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=1044</guid>
		<description><![CDATA[Last year I coordinated a technical book club here at Source Allies. This was my first experience doing one and I wanted to share my experience for the benefit of others who may be looking at starting one.
The fact that we even started a book club was a big positive because it is one great [...]]]></description>
			<content:encoded><![CDATA[<p>Last year I coordinated a technical book club here at Source Allies. This was my first experience doing one and I wanted to share my experience for the benefit of others who may be looking at starting one.</p>
<p>The fact that we even started a book club was a big positive because it is one great way to geek out with very smart people. You get the opportunity to voice your opinion on a certain topic and hear counter-points or similar views that expand your own perspective.<span id="more-1044"></span></p>
<p>We went through 2 books in the span of about 6 months. The first book was <a href="http://search.barnesandnoble.com/Test-Driven-Development/Kent-Beck/e/9780321146533">Test Driven Development: By Example</a> by Kent Beck. It&#8217;s a very good book by itself. But we found it didn&#8217;t make for very good book club discussion. The material didn&#8217;t really provide much fodder for critical thinking and exploration in my opinion. But it was a start.</p>
<p>We then picked up <a href="http://java.sun.com/docs/books/effective/">Effective Java</a> by Joshua Bloch as our second book. Java is currently my bread and butter and this book was very appropriate with it&#8217;s tip based approach. The material was a little dense in some areas, but overall an extremely good book for a book club discussion because it provided enough room for critical thinking and discussion. Unfortunately though well intentioned I thought we fell off the wagon due to a few different reasons:</p>
<ul>
<li>We met in a cafeteria location which was noisy and had it&#8217;s own share of distractions making it difficult to have any sustained discussion</li>
<li>Not a whole lot of discussion around the topic because each of us read a different chapter in the book and we didn&#8217;t really have common ground</li>
<li>We had participants in the discussion who hadn&#8217;t read the book and would understandably drive the conversations off topic</li>
<li>We didn&#8217;t have a standing meeting time which we were committed to. Sometimes I felt we were scrambling just to get a common meeting time organized. We did get better about this towards the later half of last year.</li>
</ul>
<p><strong>Going forward into 2010</strong><br />
Learning from last year, we are making some changes to derive more out of the book club this year. </p>
<ul>
<li>Meet in a quiet location &#8211; This year we will be meeting in a conference room with little distractions</li>
<li>A once a week standing meeting &#8211; This way everyone in the group is aware of the weekly commitment and can be prepared</li>
<li>Be more pro-active about our book selection &#8211; Maintain a <a href="http://www.goodreads.com/review/list/2958611-sud?shelf=bookclub">list</a> of potentially interesting books and select books at the regular meeting</li>
<li>More structured discussion format &#8211; We all have views and opinions on what we&#8217;ve read. So all of us must have the opportunity to voice our thoughts</li>
<li>Book review &#8211; This year we are going to attempt to publish a blog post reviewing each book that we discussed at the book club</li>
<li>Limit the book club to a maximum of 6 members &#8211; any more and the 1-hour will be insufficient for everyone to participate fully</li>
</ul>
<p>We&#8217;ve already had two meetings so far this year with the above format and I thought it went very well. And am looking forward to a more rewarding book club this year.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2010/02/running-a-technical-book-club-take-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unplugging an LVM partitioned USB drive</title>
		<link>http://blogs.sourceallies.com/2009/12/unplugging-an-lvm-partitioned-usb-drive/</link>
		<comments>http://blogs.sourceallies.com/2009/12/unplugging-an-lvm-partitioned-usb-drive/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 14:00:57 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[usb drive]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=829</guid>
		<description><![CDATA[Recently I had the heartbreaking experience of having to reboot a Linux server. Normal usage should almost never require you to reboot the OS like you have to so frequently in Windows. In this case I had an external USB drive partitioned with LVM humming along on a Linux server. I needed to pull the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had the heartbreaking experience of having to reboot a Linux server. Normal usage should almost never require you to reboot the OS like you have to so frequently in Windows. In this case I had an external USB drive partitioned with <a href="http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)">LVM</a> humming along on a Linux server. I needed to pull the drive, so like I&#8217;ve done with other drives I unmounted all partitions on the drive. Then proceeded to unplug it from the USB port. All well and good. But when I plugged it back in, the <a href="http://linux.die.net/man/8/lvs">lvs</a> command was showing error messages on the partitions and I was unable to mount them.</p>
<p>Some Google searches later I found that when it comes to LVM partitions the OS keeps references to it unless you explicitly tell it to unhook them. Only then can you tell the OS to hook the LVM partitions back up when you&#8217;ve plugged the drive back in. In my case I had to resort to rebooting the server in order for the OS to hook all the pieces together for the LVM partitions. Short of this I would have to manually delete certain files and move things around to get the LVM partitions to work again. So here are the magic incantations that will save you the headache.</p>
<p>Before you unplug an LVM partitioned USB drive, you must run the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
lvchange <span style="color: #660033;">-an</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>your_volume_group_name
vgexport <span style="color: #660033;">-a</span></pre></div></div>

<p>Use the man command to explore what these commands do.</p>
<p>Now you should be able to unplug the drive. When you are ready to plug it back in, stick it back in the USB port and run the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
vgimport <span style="color: #660033;">-a</span>
lvchange <span style="color: #660033;">-ay</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>your_volume_group_name</pre></div></div>

<p>You should now be able to run lvs and see you LVM partitions on the USB drive without any errors and proceed to mount the partitions.</p>
<p>Hope you found this useful. Are there other or different ways of doing this? Please add your comments below and Happy Holidays! </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2009/12/unplugging-an-lvm-partitioned-usb-drive/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Musings of a SpringOne 2009 Attendee &#8211; Day 3</title>
		<link>http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-day-3/</link>
		<comments>http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-day-3/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:20:05 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=187</guid>
		<description><![CDATA[Agile Architecture &#8211; Technologies and Patterns &#8211; Kirk Knoernschild
Some of the questions this session set out to attempt to answer were

What is architecture?
What defines architecture?
What are architectural decisions?
Is architecture a forward only decision?

 Several definitions of Architecture were quoted from prior literature. Such as architecture being the the shared understanding of the system being built. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15662"><strong>Agile Architecture &#8211; Technologies and Patterns &#8211; Kirk Knoernschild</strong></a></p>
<p>Some of the questions this session set out to attempt to answer were</p>
<ol>
<li>What is architecture?</li>
<li>What defines architecture?</li>
<li>What are architectural decisions?</li>
<li>Is architecture a forward only decision?</li>
</ol>
<p><em> </em>Several definitions of Architecture were quoted from prior literature. Such as architecture being the the shared understanding of the system being built. Shared understanding between a group of people who need to communicate about it &#8212; developers and architects, or technical and management etc.<br />
Lean principles are you delay <span id="more-187"></span>the decision till it is required and till after you have enough information to make an effective decision. Does this mean you should not make decisions based on incomplete information? I disagree on the &#8220;effective decision&#8221;. How do you even know what is effective decision? Something that is effective today more than likely will not be effective tomorrow. The world we live in is a naturally changing world. You delay the decision till the last responsible minute. But when you have to make the decision you do it based on the best available information at that point.<br />
The goals of architecture were then discused. I thought this was a very insigtful analysis. We were first shown how the impact of change and the cost of change influence architecture and design. Hgh impact and high cost of change require architecture and design. If the change has high impact, but low cost then architecture may not be as important as long as you have measures to mitigate the change such as unit and functional tests. Or if the change has low impact but high cost, if you are prepared to absorb the cost, then architecture may not be as important either though this is more unlikely. The end goal of architecture is to reduce the impact and cost of change.<br />
Are flexibility and complexity opposing goals? Higher flexibilty introduces higher complexity. It goes back to choosing your battles. If the impact of change is not significant then it doesn&#8217;t have to be flexible and thus not complex. So the question is which parts of the system needs to be flexible.<br />
The <a href="http://c2.com/cgi/wiki?ReuseReleaseEquivalencePrinciple">release-reuse equivalence principle</a> is that the unit of release is the unit of resue. We see this in daily practice. And consequently reuse fits nicely into modularity. In other words, what is modular can be released as a unit and reused.<br />
So then what correlations can be made between agility and modularity?</p>
<ul>
<li> Structural flexibility which defines modularity</li>
<li> Temporality or the ability of the system to accommodate future change which defines agility</li>
</ul>
<p>(This stuff is good I&#8217;m thinking!)</p>
<p>A jar file</p>
<ul>
<li> unit of resuse</li>
<li> unit of composition</li>
<li> unit of deployment</li>
<li> unit of management</li>
</ul>
<p>So why not make jar files first class citizens on the java platform? Why do we have to package a jar inside a WAR or a EAR? Why are we flattening these modular units.<br />
Increasing a system&#8217;s modularity leads to easier to maintain and extendable software. In a non-modular system, being afraid to make changes to the code base causes us to do things such a copy/paste, or write duplicate code which further degrades the codebase. Guilty as charged!<br />
Modularity helps in assessing the impact and cost of change. When we know what other modules depend on the module that needs to be changed, we have a more clearer understanding of the risks, impacts and cost of that change. I wonder if the roadblock to modularity is our platforms.  What if the WAS and Glassfish and Weblogics of the world allowed us to deploy our applications as sets of OSGi bundles?</p>
<p>There was a comment about how WAS 7 has made giant strides towards being modular internally by adopting OSGi under the hood. Apparently it starts under 5 seconds for a non-ejb application. I had to recently run WAS 7 in development mode inside my RAD workspace. And I can vouch for the fact that startup time was certainly several magnitudes more than 5 secs. Maybe I&#8217;m missing something here.<br />
So what are benefits realized in the runtime because of modularity?</p>
<ol>
<li> Dynamic deployment</li>
<li> Multiple versions</li>
<li> Enforce dependencies</li>
</ol>
<p>&#8230;.and all at runtime.<br />
Modular tension is higher ease of use of an artifact makes it more difficult to reuse. Higher ability for reuse (i.e. finer grained artifacts) makes it more difficult to use. Are reuse and use always inversely related?</p>
<p>A few thoughts around this:</p>
<ol>
<li> Public methods shouldn&#8217;t necessarily be published methods. Currently this is enforced via Javadocs unless you are using OSGi</li>
<li> Interfaces should be close to their usage and not close to the implementations. This makes sense for framework APIs. It probably applies to business applications as well. What&#8217;s good for the  goose is  good for the gander.</li>
<li> Separate the interface from the implementations not just at the package level but also as deployment artifacts. You see this in framework apis now (javaee-api.jar is separate from its implementation jar). But not so much in business applications. If we did, it would aid in providing more predictable API evolution. We would be able to fix a defect or enhance an internal function in the implementation and then release just the newer version of the implementation built against the same old version of the API. The consumers of this API would not see any suprises since the API itself hasn&#8217;t changed. Instead when we package both the interface and implmentation as a single artifact, it is more difficult to avoid suprising the consumers of the API.</li>
<li> Exceptions should be close to where they are thrown. So they should be part of the API.</li>
</ol>
<p>So is OSGi the holy grail of runtime modularity?<br />
Yes and no. It forces runtime modularity but we are still required to design our apps modularily. A sample application (kcode.googlecode.com) that echoed these principles was demoed. Another tool that was mentioned was JarAnalyzer which gives us a visual image of our jar dependencies by analyzing the project. It can be included in the build script. The tool was built by the author.<br />
Overall I really liked this session because of how it tied all the buzz and technical mumbo-jumbo around modularity and OSGi into business speak, something you can pitch to management.</p>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15653">That old Spring magic has me in its SpEL: DI Wizardy with the Spring Expression Language &#8211; Craig Walls</a></strong></p>
<p>Spring Expression Language or SpEL is probably the most prevasive feature in Spring 3.0. From what I&#8217;ve seen so far it can be used in DI, in Spring Web Flow, in Spring Security, Spring Integration. So if you are looking at taking advantage of Spring 3.0 you should probably look at SpEL. A SpEL expression is provided within a #{ } similar to the JSF EL. The source code (http://spring.habuma.com/examples/SpEL-examples.zip) contains well documented examples of the different forms of SpEL expressions. Here is a sampling:</p>
<p>Instead of having to use environmentPlaceHolderConfigurer you could do:</p>
<p>#{systemProperties['region']}<br />
#{systemEnvironment.region}</p>
<p>You can refer to the following:<br />
#{bean.property}<br />
#{request.getParamenter(&#8221;action)}<br />
#{request.getAttribute(action&#8221;)}<br />
You can inject these directly into bean properties instead of having to do it in code. Very cool! This is just scratching the surface. Go now and checkout the source. There are some amazing things you can do with collections similar to what you can do with the Bean predicate except more succintly. SpEL can be used as a configuration tool (both in applicationContext.xml as well as with Spring annotations) as well as a general purpose parser a la apache commons beanutils via the SpELAntlrExpressionParser.</p>
<p>SpEL is nice but there is no type safety or syntax checking. It seems to impart a funtional flavor when used with collections.<br />
Craig had one test class with individual test methods that showcased each of the capabilities of SpEL. He would make a change in the test method and hit save and the test would be automatically run giving him immediate feedback on pass or fail. He was using <a href="http://infinitest.org/web/guest/home">Infinitest</a> who are handing out free licenses for individual developers. It uses JUnit. I hope they also provide TestNG support.</p>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15643">Working with Spring Web Flow &#8211; Keith Donald</a></strong></p>
<p>I was convinced to attend this session after the Spring Faces session. Spring Web Flow is a stateful web conversation framework. The flow persistence strategy is pluggable. By default it uses Session but it doesn&#8217;t necessarily have to be session. Useful in a multi-step progression type user interaction as well as in single page AJAXy interactions.<br />
Keith showed how pages are bookmarkable and how the browser Back button works as it  should. Web flow uses an encrypted key in the URL parameter for the key. Example e5s1 where the 5 indicates the execution of time of this execution and the 1 indicates the snapshot or step in the flow. You can modify the key in the URL and the URL is still addressable.<br />
The execution has a lifecycle and upon completion it is garbage collected which means it is no longer active. It does automatic session cleanup after the flow ends. Spring Web Flow can replace t:saveState and all the extra coding that goes with it to maintain state particularily in multi-page flows.<br />
There was a question about where we can introspect the flow execution repository for use cases such as bread crumbs navigation. Apparently you can but it is still very involved and this is being addressed in the next version. Keith demonstrated the hotel web application sample from Spring and the flow for the booking scaenario. External flow definition modules are compiled and refreshed upon changing without app server restarts. Code completion is available in the editor (STS?)</p>
<p>Can use evaluate to execute some method and assign to a scoped varaible. SpEL can be used in Web Flow. The model attribute on view-state is used to bind form parameters to bean properties. I didn&#8217;t quite catch the validation part of it.</p>
<p>I definitely need to take a good look at Spring Web Flow and it&#8217;s integration with JSF.</p>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15654">Spring Integration 2.0 Preview &#8211; Mark Fisher</a></strong></p>
<p>Spring integration provides an embedded message bus that lives within an applicationContext with all components being Spring managed objects. Many of the patterns from the Enterprise Integration Patterns books are implemented. A message wraps around a payload (XML/java Object) along with headers. A Message Channel is the communication link between producers and consumers and provides loose coupling.</p>
<p>This is another one of those core technologies that I think can underpin the architecture of a flexible enterprise application.</p>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15651">Case Study: SRM 2.0 &#8211; A next generation shared resource management system built on SpringSource dm Server &#8211; Matt Stine</a></strong><br />
This session was about how St. Jude Children&#8217;s Research Hospital rebuilt their Shared Resource Management System as a modular application to be extensible to meet growing business needs. The business need was to track samples as they progressed through the different stages in a laboratory. There are several labroatories and each usually has it&#8217;s own set of unique requirements.<br />
The previous system consisted of:</p>
<ol>
<li> Core domain model</li>
<li> Core services platform</li>
<li> Web platform</li>
<li> Laboratory specific extensions
<ol>
<li> DB Schema &#8211; extendable by hanging tables of existing tables</li>
<li> Domain model</li>
<li> Services</li>
</ol>
</li>
</ol>
<p>Overall the shema had 200 tables that was becoming unmanageable. And they had to follow a monolithic deployment model. When it was decided that they need to rethink the application it was based around extensiblity</p>
<ol>
<li>primarily by configuration</li>
<li> feature modularity</li>
</ol>
<p>An <a href="http://en.wikipedia.org/wiki/Entity-attribute-value_model">EAV data model</a> was chosen for it&#8217;s extensibility. The system was built around some core concepts such as a kernel and business activity source. Using OSGi as the underlying  platform, they were able to introduce new technologies behind an OSGi service without running risks of breaking other parts of the application. From a development perspective OSGi lets them ship the interface out to a 3rd party team and have them implement it.</p>
<p>Used 3 to 4 days of consulting work from SpringSource the team was able to ramp up on OSGi, Spring dm server and STS starting in January &#8216;09. They then spent the first 3 to 4 months working out the kinks since the tools were still in their 1.0.0 version. In their experience, adopting OSGi led to a short time fall-of in productivity as they ramped up on the technology but they are now reaping the long term benefits of modularity. Their reporting solution was implemented against a real time data mart that is relational and using messaging via Spring Integration and a databus architecture.</p>
<p>It was pretty awesome to see that they had developed a modular enterprise application based on OSGi leveraging Spring Integration. After the presentation I got the chance to talk to the technical lead on this project from St. Jude. He told me how respecting the small set of simple tenets of good application design enforced by OSGi, depending on interfaces, and use of shared bundles was really the reason for their success. OSGi is not complex and there is no need to make it complex. Wise words.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-day-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Musings of a SpringOne 2009 Attendee – Day 2</title>
		<link>http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-%e2%80%93-day-2/</link>
		<comments>http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-%e2%80%93-day-2/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 02:12:54 +0000</pubDate>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[sud]]></category>

		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=129</guid>
		<description><![CDATA[Running a day late on my posts. Here&#8217;s day two (yesterday)
Grails Quick Start &#8211; David Klien
David walked through the creation of a Grails web application to track a JUG&#8217;s meeting schedule. I liked his presentation style or maybe because the room wasn&#8217;t very crowded things just registered better. Picked up a few tips such as [...]]]></description>
			<content:encoded><![CDATA[<p>Running a day late on my posts. Here&#8217;s day two (yesterday)</p>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=16412">Grails Quick Start &#8211; David Klien</a></strong></p>
<p>David walked through the creation of a Grails web application to track a JUG&#8217;s meeting schedule. I liked his presentation style or maybe because the room wasn&#8217;t very crowded things just registered better. Picked up a few tips such as the Bootstrap class. Grails still has a ways to go in the eclipse tooling. It would&#8217;ve been nice to have been able to File &#8211;&gt; New Project and follow along. Too bad <a href="http://www.jetbrains.com/idea/nextversion/editions_comparison_matrix.html">IntelliJIDEA CE</a> doesn&#8217;t support grails though there has been plenty of buzz on the latest <a href="http://www.springsource.com/products/sts">STS</a>. Downloading this right now. Only 3 more hours for the download to complete!</p>
<p>I think I&#8217;m beginning to dig duck typing. All in all the presentation encouraged me to put my head down and hammer out a sample app to start building some grails knowledge. More homework!<span id="more-129"></span></p>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=16414">XML and Web Services with Groovy &#8211; Paul King</a></strong></p>
<p>XMLParser and XMLSlurper were covered. I&#8217;d attended a similar talk by Scott Davis at NFJS. So I wasn&#8217;t all oo-ahh about it. But I did pick up on a few things. Like the XMLSlurper&#8217;s lazy evaluation. Apparently lazy evaluation is more pervasive in Groovy and you see it in sql resultset processing as well. This actually makes groovy faster than Java in these use cases. We also saw how existing Java XML libraries such as DOM4J can be used within groovy.</p>
<p>For the web service half GroovyWS was shown. In literally three lines of code you can standup a POJO/POGO as a web service endpoint. Not likely to be used in production but this shows how you can easily take an existing Spring bean and expose it&#8217;s responsibilities as a web service for a proof of concept. A simple SOAP webservice consumer was shown in 4 lines too. Also learnt that Synapse and ServiceMix have groovy support built into them.</p>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15640">Simplifying Java Server Faces Development with Spring Faces &#8211; Jeremy Grelle</a></strong></p>
<p>I probably got most out of this presentation. At times I felt like Jeremy was speaking directly to me. My day job involves JSF 1.2 and Jeremy was pointing out all the (anti) patterns we employ in order to overcome the limitations of JSF 1.2.</p>
<p>He pointed out two ways to integrate JSF with Spring</p>
<ol>
<li>JSF centric &#8211; where Spring simply replaces the managed bean functionality of JSF. With the caveat that if you need to dynamically inject a Spring bean it is not possible using Spring 2.5. In those situations you&#8217;ll need to revert to JSF managed beans. You could still use the JSF managed beans for view action classes and inject Spring service beans into the action classes. The JSF centric approach is the one I&#8217;m familiar with.</li>
<li>The Spring centric on the other hand does all of the following:
<ol>
<li> JSF plugs into Spring as the View layer</li>
<li> Does not use the FacesServlet</li>
<li> Spring MVC + Web Flow together replace the</li>
</ol>
<ul>
<li> managed bean provider</li>
<li> request dispatcher</li>
<li> navigation handler</li>
<li> state manager</li>
</ul>
</li>
</ol>
<p>Spring Web Flow provides the conversation scope (more than Request but less than Session scope) that is sorely missing in JSF.</p>
<p>In the Spring centric approach one would use the Spring MVC DispatcherServlet for Controllers for stateless intrerations (basically selecting JSF views for rendering) and Spring Web Flow for stateful interactions.</p>
<p>He demoed what I think was JSF 2.0 Custom components. And how one can wrap them with Spring Faces components to do client side validation etc. The Spring Faces components wrap Dojo under the hood and this same technique can be used by us to wrap other Dojo components that are not already available in Spring Faces.</p>
<p>Another issue we run into frequently in JSF 1.2 is being able to initialize a view. The framework does not provide a built-in way to do this. Spring Web Flow has a clean way to do this using on-Render in the flow definition. Web flow also has viewScope allowing you to do multiple interactions with the same page without having to go back to the database.</p>
<p>The big benefit of Spring Faces is it&#8217;s integration with Web Flow. And Web Flow makes the restarts due to changes in faces config a thing of the past.</p>
<p>There was a slide that compared the pet clinic application built using Spring Faces and pure JSF. The Spring Faces application used 1/3rd the lines of code &#8212; which was believable considering how the faces config was completely trimmed and how a lot of the workaround code was eliminated. Some of the new features requires JSF 2.0.</p>
<p>What about Seam? Not sure if and how Seam would work in a Spring web stack.</p>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=16448">Grails Security &#8211; Ken Sipe</a></strong></p>
<p>This session covered SQL injection attacks and XSS attacks. Made me wonder how many of us building applications that live behind the firewall really code for this. Ken also showed examples of how an enterprising hacker can discover the data structure of your application using SQL injection. O/R frameworks solve most of the SQL injection problems but apparently there are edge cases where these frameworks still spit out un-parameterized queries and how we need to always verify the SQL being generated. Another question about input validation and what is it that you are validating. This is still a hazy area and there was no definitive answer on this. Also Stories and Abuse Stories &#8212; are we writing code that prevents the user from breaking (nicer word for hacking?) the application? Does this need to be part of the story acceptance criteria.</p>
<p>We then got to look at security in Grails and how we need to add the html codec in the Config.groovy to escape out the HTML.</p>
<p><em>grails.views.default.codec = &#8220;html&#8221;</em> in <em>/conf/Config.groovy</em>.</p>
<p>Ken mentioned the <a href="http://www.intelligrape.com/blog/?p=49">Command Object</a> and treating the interaction with the data store as different from the interaction with the web. We then looked at Cross Field validation in Groovy which was pretty sweet.</p>
<p>It was mentioned that we should never show error pages to users which to me makes absolute sense in a public facing web application. But are there internal applications that we may need to expose the error message to the end user &#8212; such as when we cannot duplicate the issue in the  support or development environments and it is a fairly complex interaction that is quicker to have the user send you the stack trace or walk you through the steps to reproduce the issue. We are trading security for ease of troubleshooting. How big a risk is this in internal apps?</p>
<p>Ken said something interesting about handling <a href="http://palisade.plynt.com/issues/2006Aug/session-riding/">session riding attacks</a> &#8212; upon login expire the newly authenticated session and create a new one based on the expired session. For requests that are highly sensitive, using encrypted tokens with a timeout. So if the following request doesn&#8217;t provide the token and doesn&#8217;t meet the time expectation then you can invalidate it.</p>
<p>Few resources that were mentioned:</p>
<ol>
<li> Spring security for Grails (SecurityConfig.groovy)</li>
<li> <a href="http://cwiki.apache.org/confluence/display/SHIRO/Index;jsessionid=1C1152DB0161A823BE61ACB60A1C8780">Apache Shiro</a></li>
<li> <a href="keylength.org">keylength.org</a></li>
<li> <a href="http://www.amazon.com/Writing-Secure-Second-Michael-Howard/dp/0735617228">Writing Secure Code</a> &#8211; best book on security as per Ken (believe it or not from Microsoft press)</li>
<li> <a href="http://www.owasp.org/index.php/Category:OWASP_WebGoat_Project">Webgoat</a> &#8211; learning tool to learn about securing Java EE applications. This looks like something I need to check out. More homework again!</li>
<li> <a href="http://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API">EASPI</a> from owasp attempts to solve the security concern at the framework level.</li>
</ol>
<p><strong><a href="http://www.springone2gx.com/conference/new_orleans/2009/10/session?id=15636">Case Study: RESTful Web Services at Orbitz &#8211; Alex Antonov</a></strong></p>
<p>Alex talked about solving the problem of management of shared, versioned dependencies with serializable objects in a highly distributed environment. And the pain involved in keeping about 60 to 70 systems in sync during upgrades.</p>
<p>The original maze of systems were implemented in JINI. But since Sun is no longer behind JINI and JINI is no longer evolving they have had to ditch it. They actually won an award for their use of JINI. But they have migrated to a REST based architecture using Google Protocol Buffers for the messages across the wire instead of XML or JSON. I should  have paid attention during Octavian&#8217;s protocol buffers presentation! So protocol buffers is a substitution for java serialization. It is 7 to 10 times faster than JSON and even faster than JINI/JERI.</p>
<p>Protocol buffers provides transparent versioning where if a message needs to flow through System A &#8211;&gt; System B &#8211;&gt; System C, you can upgrade the message structure (upto a certain extent) in System A and  System C and not have to modify System B. Protocol buffers lets connected systems mesh both backwards and forwards at the joints without the developer having to put in any effort.</p>
<p>We were then introduced to REST API best practices. Didn&#8217;t see much new stuff that I hadn&#8217;t seen before. Speaks for REST which is supposed to be simple with a few guiding principles. One thing I did learn about writing REST APIs was to use query strings for optional filtering. Another was to let the client define what message format they will accept via the Accept header. You can then use plugins for protocol buffers to send down the message in the requested format.</p>
<p><strong>TECHNICAL KEYNOTE &#8211; Adrian Colyer</strong></p>
<p>Adrian Coyler&#8217;s keynote started of very entertaining when he walked acros the stage with just the handle of his new roll-on bag. Story about how his luggage got ripped out and disappeared on his way to SpringOne. We heard about some of the new things in Spring. But he moved quickly to showing SpringSource&#8217;s last acquisition, <a href="http://www.cloudfoundry.com/">Crowd Foundry</a> and it&#8217;s capabilities. Having seen Google&#8217;s App Engine before I wasn&#8217;t very impressed. Essentially Crowd Foundry provides a developer centric way to deploy Java applications on Amazon EC2 including a plugin for Eclipse (or does this require STS?).</p>
<p>VMware then took over explaining their technology blueprint that leverages Spring tc server running in virtualized environments. Looks like VMware which has till date been visibile mostly in the infrastructure and operations space will soon be surfacing virualization and the cloud to developers. Some of the technologies that were showcased were:</p>
<ol>
<li> <a href="http://www.vmware.com/products/vmotion/">vMotion</a></li>
<li> <a href="http://www.vmware.com/products/drs/">Dynamic Resource Scheduling</a></li>
</ol>
<p>Interesting stuff. I later on learnt that on of the organizations that was implementing an enterprise OSGi application was using vMotion at the infrastructure layer for fail over.</p>
<p><strong>Spring Core BOF</strong></p>
<p>Spring ESB? More like Environment Specific Beans may be coming in a future release of Spring 3.x.This should eliminate the need to use environment placeholder configurers for environment specific beans. Learnt that spring-oxm can be used outside of the spring-ws.</p>
<p>http://www.springbyexample.com was suggested as a useful resource for learning.</p>
<p><strong>Wrap up</strong></p>
<p><a href="www.manning.com/">Manning</a> was running a treasure hunt of sorts all through the conference with free book vouchers hidden around the conference areas. I had absolutely no luck!</p>
<p>One of the best parts of this SpringOne conference is rubbing shoulders with guys who&#8217;ve written the books, written the code, and give talks about the technologies that we use. These guys literally sit around with the attendees and are there to geek out with us regular joes. I got the chance to meet Craig Walls and talk about OSGi and Venkat and pick his brain on functional languages. And of course there is the always helpful SpringSource team easily recognized by their &#8220;uniforms&#8221;.</p>
<p>Looking forward to more. Also got my first <a href="http://twitter.com/sudr">re-tweet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sourceallies.com/2009/10/musings-of-a-springone-2009-attendee-%e2%80%93-day-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

