<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6305895565483687445</id><updated>2011-12-23T07:17:13.475-08:00</updated><category term='operator'/><category term='dynamic binding'/><category term='gmail buzz'/><category term='roo'/><category term='javascript'/><category term='gag'/><category term='gwt'/><category term='gtalk'/><category term='fluiddb'/><category term='google links'/><category term='library'/><category term='grid'/><category term='buzz'/><category term='grails'/><category term='groovy multimethod'/><category term='spring'/><category term='gpath'/><category term='neo4j'/><category term='uml'/><category term='sts'/><category term='app'/><category term='tdd'/><category term='nosql'/><category term='distributed events vaadin spring jgroup'/><category term='eclipse'/><category term='vark'/><category term='bdd'/><category term='closures'/><category term='vaadin'/><category term='spread-dot'/><category term='database'/><category term='jtracert'/><category term='cassandra'/><category term='play framework'/><category term='xmpp'/><category term='java'/><category term='aardvark'/><category term='social database'/><category term='netbeans'/><category term='rest'/><category term='google ambassadors'/><category term='groovy binding'/><category term='datagrid'/><category term='jquery'/><category term='groovy basic'/><category term='category'/><category term='android'/><category term='infoq'/><category term='annotation'/><category term='appengine'/><category term='groovy'/><category term='spread'/><category term='twitter'/><category term='easyb'/><category term='framework'/><category term='sequence diagram'/><category term='google'/><category term='important callers'/><title type='text'>dhaval</title><subtitle type='html'>My experiences with Java and Open Source Technologies</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-6682084159988700065</id><published>2011-02-25T14:12:00.000-08:00</published><updated>2011-02-25T21:22:26.101-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='framework'/><category scheme='http://www.blogger.com/atom/ns#' term='play framework'/><title type='text'>Playing with the Play Framework</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="text-align: justify;"&gt;Back to blog after very long time. This post is basically about the new exciting Java web framework &lt;a href="http://www.playframework.org/"&gt;Play&lt;/a&gt;&amp;nbsp;and a small implementation of app using it:&amp;nbsp;&lt;a href="http://apps.dhavalnagar.com:8080/pptviewer"&gt;pptViewer&lt;/a&gt;&amp;nbsp;a simple PPT file viewer.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;After successfully implementing (basically porting) a small application in Play I can say that every Java programmer who wants to taste agile development must use this framework at least once. Its really simple and lighting fast to build (small to medium size) applications. I have selected this framework for few of my upcoming prototype developments.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The demo application is very trivial one. It accepts a Microsoft PPT file and shows the slide contents on pages. &amp;nbsp;&lt;a href="http://poi.apache.org/"&gt;Apache POI&lt;/a&gt; is used to extract PPT file content and stored in MySql database. The original application is intended to manage multiple format Office files over web and is currently under development using Spring MVC. I choose to rebuild a small part of it using Play to evaluate it for slightly bigger and complex application and it worked really well. The framework documentation is very clear and concise for the beginners to quickly learn and implement stuff. The Play Community is growing day by day and illustrates a lot of new features\implementations of the framework.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Play provides most of the features required by any standard web applications (just like &lt;a href="http://rubyonrails.org/"&gt;RoR&lt;/a&gt;, &lt;a href="http://www.djangoproject.com/"&gt;Django&lt;/a&gt; and &lt;a href="http://www.grails.org/"&gt;Grails&lt;/a&gt;&amp;nbsp;-&amp;nbsp;actually the search is not over yet)). Standard (Static) MVC model, no upfront compilation (a great boon), front-end scripting and full Java stack are few of them. Play infrastructure can be extended with &lt;a href="http://www.playframework.org/modules"&gt;Modules&lt;/a&gt; (plugins) and many useful modules are already available. Play can fit nicely between regular Java web framework like Spring MVC and very dynamic framework like Grails. In the end Play has many&amp;nbsp;similarities&lt;span class="Apple-style-span" style="font-family: arial, sans-serif;"&gt;&lt;b style="color: #2200c1; cursor: pointer; outline-color: initial; outline-style: initial; outline-width: 0px;"&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;to Rails and one can say that like many other modern web frameworks (Grails, Roo) Play Team is also quite inspired from RoR.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;After "playing" with &lt;a href="http://code.google.com/webtoolkit/"&gt;GWT&lt;/a&gt;, &lt;a href="http://www.vaadin.com/"&gt;Vaadin&lt;/a&gt;, &lt;a href="http://www.springsource.org/roo"&gt;Roo&lt;/a&gt; and Grails for a while and with my ongoing implementation I think Play is a very good framework in one's framework wardrobe.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;A very good discussion of Play and RoR can be found on this &lt;a href="http://bit.ly/eBnkVa"&gt;Stackoverflow link&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Although my journey with Play is quite short till now but I quite impressed at the moment (if it doesn't work then something new will come, it has always come and I will start using that :) ).&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Keep "play"ing.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;(Special credit to &lt;a href="http://www.linode.com/"&gt;Linode&lt;/a&gt; which enabled me to host the application from setup to deployment in just couple of &amp;nbsp;hours. I found Linode setup rather easy enough than to convert the application to &lt;a href="http://code.google.com/appengine/"&gt;GAE&lt;/a&gt;&amp;nbsp;&lt;a href="http://code.google.com/appengine/kb/general.html"&gt;compatible&lt;/a&gt;.)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-6682084159988700065?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/6682084159988700065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2011/02/playing-with-play-framework.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6682084159988700065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6682084159988700065'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2011/02/playing-with-play-framework.html' title='Playing with the Play Framework'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-4909759324048347401</id><published>2010-10-05T11:18:00.000-07:00</published><updated>2010-10-05T11:32:54.539-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='app'/><category scheme='http://www.blogger.com/atom/ns#' term='important callers'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Important Callers - My first android app into the wild</title><content type='html'>&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://www.appbrain.com/app/important-callers/com.dhaval.android.impcalls" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_TYf1VDTX0Kc/TKtu6OsZEzI/AAAAAAAAAKE/cY79MF5e4qQ/s1600/icon.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Important &lt;br /&gt;Callers&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;After developing several Android apps just for fun I finally developed the &lt;a href="http://www.appbrain.com/app/important-callers/com.dhaval.android.impcalls"&gt;Important Callers&lt;/a&gt; app which can be used by many app users. The app is quite simple and helps the mobile user to not miss important calls by selecting the contacts as important one through the this app.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.appbrain.com/app/important-callers/com.dhaval.android.impcalls"&gt;This&lt;/a&gt; is the review (very poor on first day) page of AppBrain for my app and if you have AppBrain installed in your mobile you can install the app from the web page itself. I am upgrading the app as I have started receiving &amp;nbsp;errors and comments as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-4909759324048347401?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/4909759324048347401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/10/important-callers-my-first-android-app.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4909759324048347401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4909759324048347401'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/10/important-callers-my-first-android-app.html' title='Important Callers - My first android app into the wild'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_TYf1VDTX0Kc/TKtu6OsZEzI/AAAAAAAAAKE/cY79MF5e4qQ/s72-c/icon.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-6661215775694720593</id><published>2010-08-17T23:28:00.000-07:00</published><updated>2010-08-17T23:28:23.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vaadin'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><title type='text'>Using jQuery with Vaadin</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;After spending some time with Vaadin and developing a small application and a usability framework the moment came in which Vaadin application had to be integrated with another existing application. The integration wasn't tough at all due to the nice work done by the Vaadin folks.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;However at my place we have separate team for Vaadin core development and jQuery / JavaScript doing the client side hacking. So to make the job easier for both the sides I developed a small &lt;/span&gt;&lt;a href="http://vaadinjquery.appspot.com/"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="background-color: #ffe599;"&gt;Contact Us&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; demo application which creates a Vaadin form and beautifies it with jQuery Effects and Tooltip plugin.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-6661215775694720593?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/6661215775694720593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/08/using-jquery-with-vaadin.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6661215775694720593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6661215775694720593'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/08/using-jquery-with-vaadin.html' title='Using jQuery with Vaadin'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-4925020462037252135</id><published>2010-07-19T23:07:00.000-07:00</published><updated>2010-07-21T14:23:14.663-07:00</updated><title type='text'>Story Board - a small app built with jQuery and jQuery UI</title><content type='html'>&lt;div style="text-align: justify;"&gt;After spending much time with Java and other Java technologies working behind the curtains in the dark and smoky rooms I started exploring front-end&amp;nbsp;dominant languages like JavaScript, HTML5 and much talked CSS.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;There are many JavaScript&amp;nbsp;&lt;a href="http://blog.reybango.com/the-big-list-of-javascript-css-and-html-development-tools-libraries-projects-and-books/"&gt;libraries and tools&lt;/a&gt; available out there but in all I really liked &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt;;&amp;nbsp;it is simple and easy to use and growing at very rapid speed. &lt;a href="http://docs.jquery.com/Sites_Using_jQuery"&gt;More and more applications&lt;/a&gt; have started using jQuery extensively.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;In this small application (I call it &lt;a href="http://mstoryboard.appspot.com/"&gt;StoryBoard&lt;/a&gt;) I have used jQuery along with equally power &lt;a href="http://jqueryui.com/"&gt;jQuery UI&lt;/a&gt; library which gives a lot of functionality and control with much less code.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I use&amp;nbsp;&lt;a href="http://jsfiddle.net/"&gt;http://jsfiddle.net/&lt;/a&gt;&amp;nbsp;along with NetBeans&amp;nbsp;to create small demo and find it really helpful to develop and test the application rapidly.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Application Url:&amp;nbsp;&lt;a href="http://mstoryboard.appspot.com/"&gt;http://mstoryboard.appspot.com&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-4925020462037252135?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/4925020462037252135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/07/story-board-small-utility-app-built.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4925020462037252135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4925020462037252135'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/07/story-board-small-utility-app-built.html' title='Story Board - a small app built with jQuery and jQuery UI'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-6985989038863216723</id><published>2010-05-10T11:12:00.000-07:00</published><updated>2010-05-12T22:18:27.775-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='rest'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><title type='text'>Twitter API with jQuery</title><content type='html'>&lt;div style="text-align: justify;"&gt;After spending some time with Twitter REST API and jQuery; I decided to develop a small application to test both of these together. The example uses jQuery Ajax commands to load the given users public timeline through Twitter REST API.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;jQuery is awesome and very popular JavaScript library which provides zillions of operations to manipulate client side objects. jQuery Ajax operations make it very easy to call the Twitter REST API and get the data in JSON format. The following line of code will call the Twitter for a user public timeline.&lt;/div&gt;&lt;br /&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;var url = "http://twitter.com/status/user_timeline/"+ $("input#tweepal").val()+".json?callback=?";&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;$.getJSON( url, function( data ){&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; // process the reply &amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;});&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For simplicity I have taken a textbox to enter the Twitter username with id "tweepal". The Twitter REST url contains a query string parameter "callback" without which Twitter reply will not be available to the Ajax function.&amp;nbsp;Once received the data can be accessed like a normal JavaScript object. The received object is an array of tweets which can be easily traversed with jQuery.each() function.&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;$.each(data, function(n, tweet){&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;$("div#tweet_time").val(tweet.created_at);&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;$("div#tweet_text").val(tweet.text);&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;});&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;This completes all the blocks required to interact with Twitter from client side only.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_TYf1VDTX0Kc/S-hP6rcsMTI/AAAAAAAAAJ0/tR2jB9HnePI/s1600/twitter_jquery_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="225" src="http://1.bp.blogspot.com/_TYf1VDTX0Kc/S-hP6rcsMTI/AAAAAAAAAJ0/tR2jB9HnePI/s320/twitter_jquery_1.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;However there are plenty of libraries available for Twitter but its always exiting to make something on your own (specially using Twitter). Well I am struggling on how to post update using OAuth in same example. Will definitely post if get success.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-6985989038863216723?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/6985989038863216723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/05/twitter-api-with-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6985989038863216723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6985989038863216723'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/05/twitter-api-with-jquery.html' title='Twitter API with jQuery'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_TYf1VDTX0Kc/S-hP6rcsMTI/AAAAAAAAAJ0/tR2jB9HnePI/s72-c/twitter_jquery_1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-2140275189316197336</id><published>2010-04-14T08:42:00.000-07:00</published><updated>2010-04-14T10:54:12.028-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='aardvark'/><category scheme='http://www.blogger.com/atom/ns#' term='xmpp'/><category scheme='http://www.blogger.com/atom/ns#' term='gtalk'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='vark'/><title type='text'>jVark - A small Java/XMPP library to play with Aardvark</title><content type='html'>After spending some time with Aardvark, i found the tool really great to get answers pretty fast. Aardvark provides many ways to interact with the service however there are no APIs available as such to interact with the service&amp;nbsp;programmatically. Meanwhile I was trying to make my hands dirty with Google GTalk service and developed a small and silly utility to interact with Aardvark service through GTalk in Java.&lt;br /&gt;&lt;br /&gt;The library is very basic and helps the developer to connect to Aardvark and fire some command and see the response from Aardvark. jVark source is available at &lt;a href="http://code.google.com/p/jvark"&gt;http://code.google.com/p/jvark&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;However the library requires significant amount of improvement for extensive use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-2140275189316197336?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/2140275189316197336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/04/jvark-small-javaxmpp-library-to-play.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/2140275189316197336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/2140275189316197336'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/04/jvark-small-javaxmpp-library-to-play.html' title='jVark - A small Java/XMPP library to play with Aardvark'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-4786939042666939295</id><published>2010-04-09T21:56:00.000-07:00</published><updated>2010-04-14T11:01:43.744-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='distributed events vaadin spring jgroup'/><title type='text'>Distributed component events</title><content type='html'>&lt;div style="max-width: 65em;"&gt;The application is inspired from the Seam Component Events and uses Spring AOP for event trapping and JGroup for event distribution. The system is divided into two parts Event Generation and Event Consumption. Simple POJOs can be turned into event generator or event consumer.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre class="prettyprint" style="border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 3px; font-size: 12px; margin-left: 2em; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;"&gt;&lt;span class="com" style="color: #880000;"&gt;// Event Generator&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="lit" style="color: #006666;"&gt;@Component&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="color: #008800;"&gt;"temperature-sensor"&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;)&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;public&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;class&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="color: #660066;"&gt;TemperatureManager&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="lit" style="color: #006666;"&gt;@Out&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;private&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="color: #660066;"&gt;Temperature&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; currentTemperature&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="lit" style="color: #006666;"&gt;@RaiseEvent&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="color: #008800;"&gt;"temperature-updated"&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;)&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;public&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;void&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; temperatureUpdated&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;(&lt;/span&gt;&lt;span class="typ" style="color: #660066;"&gt;Temperature&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; t&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;){&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;this&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;.&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;currentTemperature &lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;=&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; t&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;}&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre class="prettyprint" style="border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 3px; font-size: 12px; margin-left: 2em; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;"&gt;&lt;span class="com" style="color: #880000;"&gt;// Event Consumer&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="lit" style="color: #006666;"&gt;@Component&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="color: #008800;"&gt;"graph-generator"&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;)&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;public&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;class&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="color: #660066;"&gt;GraphGenerator&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;{&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="lit" style="color: #006666;"&gt;@In&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;private&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="typ" style="color: #660066;"&gt;Temperature&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; currentTemperature&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;;&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="lit" style="color: #006666;"&gt;@ConsumeEvent&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;(&lt;/span&gt;&lt;span class="str" style="color: #008800;"&gt;"temperature-updated"&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;)&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;public&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; &lt;/span&gt;&lt;span class="kwd" style="color: #000088;"&gt;void&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt; updateTemperature&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;(){&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; graph&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;.&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;displayTemperature&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;(&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;currentTemperature&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;);&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="com" style="color: #880000;"&gt;// refresh graph&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;}&lt;/span&gt;&lt;span class="pln" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun" style="color: #666600;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style="max-width: 65em;"&gt;&lt;br /&gt;The above two classes can be part of a single JVM or multiple JVM, with JGroup in place Event Consumer will still consume the events generated by the Event Generator running in different JVM.&amp;nbsp;Spring AOP keeps track of the RaiseEvent&amp;nbsp;annotation and does all the distribution and communication stuff.&lt;br /&gt;&lt;br /&gt;Full source code and required libraries with NetBeans project is available at : &lt;a href="http://tinyurl.com/y5lfmup"&gt;component-events.rar&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-4786939042666939295?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/4786939042666939295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/04/distributed-component-events-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4786939042666939295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4786939042666939295'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/04/distributed-component-events-with.html' title='Distributed component events'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-5928861594629902948</id><published>2010-04-07T13:12:00.000-07:00</published><updated>2010-04-09T12:08:55.137-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vaadin'/><category scheme='http://www.blogger.com/atom/ns#' term='gwt'/><category scheme='http://www.blogger.com/atom/ns#' term='appengine'/><title type='text'>A cool Vaadin application on Google App Engine</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a href="http://vaadin.com/"&gt;Vaadin&lt;/a&gt;, as we all know is a rapidly growing GWT based Java Web Framework. The coolest feature of Vaadin is that there is no client/server concept as it is in GWT. The developer can freely code anything "anywhere" and Vaadin will handle all the client/server related stuffs.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;One of our existing in-house production application is built using GWT and causing lot of difficulties for developers in terms of understanding the model and designing the proper application. So to retain all the GWT features and offload the additional burdens we (as such I) have decided to move to the Vaadin and redesign the existing application.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To convince the technical and management team and for demonstration purpose I developed a small application in Vaadin and uploaded it to the Google Application Engine (&lt;a href="http://vaadincoolapp.appspot.com/"&gt;click here&lt;/a&gt;) so that others can also get the idea and at the same time I can load test the application and get all the execution details from the App Engine dashboard. &amp;nbsp; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The application contains a simple functionality where in which the user can design her custom entry forms, enter/save form data and finally view the saved data in a table. The application was built in few hours only so it doesn't have "next big ground breaking idea" or the nice GUI but Vaadin provides fairly nice UI which can work for any application to start with.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To speed up the development I extended the basic Form functionality to a Generic Form so that UI Forms can be created not only from Java Beans but from java.util.Map also. The reason to choose this is because some of our applications are purely data centric where in which numbers of UI forms are presented to users; however the fields in every form can very even after application deployment so to reduce the repetitive development effort I have taken the model where in which forms not only can be generated at runtime but can behave line a normal pre-coded form in most of the cases.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;There are still many points to resolve before we finally switch over to Vaadin as our web application development framework but with the growing popularity of the framework and new initiative like&amp;nbsp;&lt;a href="http://vaadin.com/directory"&gt;Vaadin Directory&lt;/a&gt; acceptance would not be much difficult.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Vaadin demo application url:&amp;nbsp;&lt;a href="http://vaadincoolapp.appspot.com/"&gt;http://vaadincoolapp.appspot.com/&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-5928861594629902948?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/5928861594629902948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/04/cool-vaadin-application-on-google-app.html#comment-form' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5928861594629902948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5928861594629902948'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/04/cool-vaadin-application-on-google-app.html' title='A cool Vaadin application on Google App Engine'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-151803695109008588</id><published>2010-04-05T22:25:00.000-07:00</published><updated>2010-04-05T22:34:21.918-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='library'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='annotation'/><category scheme='http://www.blogger.com/atom/ns#' term='gag'/><title type='text'>gag - Google Annotations Gallery</title><content type='html'>&lt;a href="http://code.google.com/p/gag/"&gt;gag&lt;/a&gt; is a new exciting open source library has been released by Google for Java. Google Annotations Gallery contains handful of annotations to spice up the code. This new library is aiming to express the code in the more realistic way than just plain old non-readable Javadoc comments.&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="display: inline !important; max-width: 65em;"&gt;Not only one can leave expressive remarks in the code, but can use these annotations to draw attention to her poetic endeavors. Apart from static documentation some annotations use runtime instrumentation to perform annotated behavior also.&amp;nbsp;The annotations are divided into following different categories:&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="max-width: 65em;"&gt;&lt;b&gt;Disclaimer:&lt;/b&gt;&amp;nbsp;Disclaimer annotations allow you to disclose certain relevant facts about your code. If you want to ease your conscience with full transparency, then consider these annotations.&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;b&gt;Enforceable:&lt;/b&gt;&amp;nbsp;Enforceable Annotations are annotations enforced by dynamic bytecode instrumentation. Use the following annotations, then run your applications with the&amp;nbsp;&lt;tt&gt;javaagent:gag-agent.jar&lt;/tt&gt;&amp;nbsp;option and your annotations get enforced at runtime.&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;b&gt;Literary and Literary Verse:&lt;/b&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Coding is truly an art. These annotations can help you make your code come alive and help the artist within you be recognized.&amp;nbsp;T&lt;span class="Apple-style-span" style="font-size: small;"&gt;hese speak for themselves . . . so to speak. You'll forever be revered for your code style and your code&amp;nbsp;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;style&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. Literary Verse is a newly added sub package of Literary.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="max-width: 65em;"&gt;&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;b&gt;Remarks:&lt;/b&gt;&amp;nbsp;Remarks annotations replaces the conventional Javadoc comments. These annotations helps better expressing the code than usual Javadoc comments.&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;/div&gt;&lt;div style="max-width: 65em;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;Team:&lt;/b&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman';"&gt;This is the new category added recently. The annotations express the team behavior and can be used to express events took place during team development.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Follwing is the list of my personal favorite annotations from the &lt;i&gt;gag gallery&lt;/i&gt;:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;From Desclaimer:&lt;/i&gt;&lt;br /&gt;@com.google.gag.annotation.disclaimer.BossMadeMeDoIt("i&amp;nbsp;swear its not my fault")&lt;br /&gt;@com.google.gag.annotation.disclaimer.IAmAwesome("really, this is the coolest code i have ever written")&lt;br /&gt;@com.google.gag.annotation.disclaimer.WrittenWhile("i m lost, i m lost, omg i m lost")&lt;br /&gt;@com.google.gag.annotation.disclaimer.LegacySucks&lt;br /&gt;&lt;br /&gt;&lt;i&gt;From Enforceable:&lt;/i&gt;&lt;br /&gt;@com.google.gag.annotation.enforceable.AnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything&lt;br /&gt;@com.google.gag.annotation.enforceable.Noop&lt;br /&gt;&lt;br /&gt;&lt;i&gt;From Literary:&lt;/i&gt;&lt;br /&gt;@com.google.gag.annotation.literary.Metaphor&lt;br /&gt;@com.google.gag.annotation.literary.Oxymoron("truly a fine mess")&lt;br /&gt;&lt;br /&gt;&lt;i&gt;From Remarks:&lt;/i&gt;&lt;br /&gt;@com.google.gag.annotation.remark.WTF("this is bullshit")&lt;br /&gt;@com.google.gag.annotation.remark.LOL("this is legend...... wait for it ....ary")&lt;br /&gt;@com.google.gag.annotation.remark.ThisWouldBeOneLineIn(language="groovy",&amp;nbsp;toWit="the method isnt required at all")&lt;br /&gt;&lt;br /&gt;&lt;i&gt;From Team:&lt;/i&gt;&lt;br /&gt;@com.google.gag.annotation.team.Visionary("this will surely put the Internet back in 90's")&lt;br /&gt;@com.google.gag.annotation.team.Fired(person="asok", reason="well it wasnt his fault")&lt;br /&gt;&lt;br /&gt;Well I am enjoying this treat and if you are a gut busting coder I am sure you will also enjoy too. Besides you can also submit your brilliant annotations to the library from the project mailing list.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-151803695109008588?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/151803695109008588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/04/gag-google-annotations-gallery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/151803695109008588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/151803695109008588'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/04/gag-google-annotations-gallery.html' title='gag - Google Annotations Gallery'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-8029603993977220255</id><published>2010-03-12T13:53:00.000-08:00</published><updated>2010-03-12T13:57:13.038-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='fluiddb'/><category scheme='http://www.blogger.com/atom/ns#' term='nosql'/><title type='text'>Another NoSQL Database : FluidDB</title><content type='html'>&lt;a href="http://doc.fluidinfo.com/fluidDB/"&gt;FluidDB&lt;/a&gt; is another database in the NoSQL category. It is a cloud based data store and follows the Wiki style approach for data storage. By Wiki style user can create objects in the FluidDB space and modify the existing one. Yet it uses a permission model which differentiates the it from being exact Wiki like.&lt;br /&gt;&lt;br /&gt;FluidDB provides HTTP API interface with JSON and provides the HTTP Basic Authentication. FluidDB is in the early private Alpha stage and exposed to only limited number of users. A &lt;a href="http://doc.fluidinfo.com/fluidDB/api/sandbox.html"&gt;Sandbox&lt;/a&gt; is available where anyone can play with the database and for more detail look one can request the private access by sending the FluidDB Team a Mail request.&lt;br /&gt;&lt;br /&gt;FluidDB is basically divided into four parts: 1)User 2)Namespace 3)Tag 4)Object. The User is the primary entity like in any other case. User will create Namespaces, Tags or Objects. Namespace is a logical name and physical separation which primarily describes the Subject the User is interested in like Movie, Sport, Book, etc. Tags are the attributes which describe the subject further in detail like Genre, Year and Awards Tags in Movies Namespace. Tags can exist without Namespaces also like Event, Hot, New can be used irrespective of the subject. Objects are the key entities as they contains actual data. An Object can be created with a String value like http://twitter.com/dhavaln or Die Hard With&amp;nbsp;Vengeance&amp;nbsp;as a topic which can be expressed in detail with various Tags.&lt;br /&gt;&lt;br /&gt;An Object can be annotated with Tags from any User or any Namespace. By attaching a Tag to an Object user can provide additional information as a Tag Value for that Object like:&lt;br /&gt;&lt;br /&gt;Object: Die Hard With Vengeance&lt;br /&gt;Tags:&lt;br /&gt;&amp;nbsp;&amp;nbsp;Movie=&lt;br /&gt;&amp;nbsp;&amp;nbsp;Movie/Genre=Action&lt;br /&gt;&amp;nbsp;&amp;nbsp;Movie/Year=1995&lt;br /&gt;&lt;br /&gt;As you can see same name can be used as a Namespace and as a Tag also. Tag may not contain any value alternatively known as Marker Tags.&lt;br /&gt;&lt;br /&gt;FluidDB provides a simple query mechanism through which Objects can be search in the FluidDB space with Tag and Tag values. The following query will return all the Objects having Movie/Year value as 1995.&lt;br /&gt;&lt;br /&gt;/Movie/Year = 1995&lt;br /&gt;&lt;br /&gt;/Movie/Year &amp;gt; 1995 will return all Objects having Movie/Year value greater than 1995. There are many other conditional approaches provided by FluidDB for searching and can be found &lt;a href="http://doc.fluidinfo.com/fluidDB/queries.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Many developers has started using the interesting FluidDB and created API libraries for various languages which can be found &lt;a href="http://doc.fluidinfo.com/fluidDB/api/interface.html"&gt;here&lt;/a&gt;. I have already started using the database with &lt;a href="http://github.com/ntoll/JFluidDB"&gt;JFluidDB&lt;/a&gt;&amp;nbsp;and finding its usefulness in many cases.&lt;br /&gt;&lt;br /&gt;The simple HTTP and JSON based interface makes FluidDB widely acceptable in many problem domains in various languages and frameworks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-8029603993977220255?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/8029603993977220255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/03/fluiddb-simplified.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/8029603993977220255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/8029603993977220255'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/03/fluiddb-simplified.html' title='Another NoSQL Database : FluidDB'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-1304009855673953878</id><published>2010-03-04T22:32:00.000-08:00</published><updated>2010-04-09T07:13:44.899-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sts'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><category scheme='http://www.blogger.com/atom/ns#' term='netbeans'/><category scheme='http://www.blogger.com/atom/ns#' term='roo'/><title type='text'>Spring Roo with NetBeans</title><content type='html'>&lt;div style="text-align: justify;"&gt;I am a NetBeans user and there are no reason to change the IDE for any tool as NetBeans try to&amp;nbsp;accommodate most of the frameworks and tools. However most of the modern frameworks/tools has easy integration with the Eclipse, Spring Roo is latest in the list. I started evaluating Spring Roo for one of our internal small test application.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Due to the fact that Spring Roo integrated already with Spring Tool Suite (STS) they support using STS IDE for all development. After few here and there i could finally run as well as modify the Spring Roo application in NetBeans IDE.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Maven is a compulsory requirement (until the Ant/Ivy integration is available) for Spring Roo to run, so make sure Maven is configured and NetBeans is referring to the proper Maven repository.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;1. Create the project from &amp;nbsp;the Roo Shell and fill the required artifacts for the basic startup.&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5CRCbvXBKI/AAAAAAAAAGM/tmMpNXYO6FY/s1600-h/create_project.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="323" src="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5CRCbvXBKI/AAAAAAAAAGM/tmMpNXYO6FY/s640/create_project.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_TYf1VDTX0Kc/S5CjKZp24-I/AAAAAAAAAGU/ZD1GE6Mot-Y/s1600-h/create_entity.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="440" src="http://2.bp.blogspot.com/_TYf1VDTX0Kc/S5CjKZp24-I/AAAAAAAAAGU/ZD1GE6Mot-Y/s640/create_entity.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_TYf1VDTX0Kc/S5CjX6sLGcI/AAAAAAAAAGc/icz-3KeSZp0/s1600-h/create_web.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="268" src="http://1.bp.blogspot.com/_TYf1VDTX0Kc/S5CjX6sLGcI/AAAAAAAAAGc/icz-3KeSZp0/s640/create_web.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;2. Do perform:eclipse to generate the Eclipse artifacts and open the project in STS&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_TYf1VDTX0Kc/S5CjiILCIKI/AAAAAAAAAGk/0MGpaRmJ2d0/s1600-h/perform_ecilpse.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="252" src="http://1.bp.blogspot.com/_TYf1VDTX0Kc/S5CjiILCIKI/AAAAAAAAAGk/0MGpaRmJ2d0/s640/perform_ecilpse.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;3. Right click on the project and go to the Refactoring&lt;/b&gt;, select Push All option. A dialog box will show with number of files, select all the files and click on Ok. This will convert all the AspectJ code (.aj) to pure Java code. This is the point for which Spring Roo is considered to be non-intrusive and you can actually detach the Spring Roo from the application altogether.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_TYf1VDTX0Kc/S5Cjp7CMKuI/AAAAAAAAAGs/BMTlNmdQ1zM/s1600-h/refactor.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="452" src="http://2.bp.blogspot.com/_TYf1VDTX0Kc/S5Cjp7CMKuI/AAAAAAAAAGs/BMTlNmdQ1zM/s640/refactor.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_TYf1VDTX0Kc/S5CjywDEy8I/AAAAAAAAAG0/lmPZqcYOfTw/s1600-h/refactory_push_in.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="460" src="http://2.bp.blogspot.com/_TYf1VDTX0Kc/S5CjywDEy8I/AAAAAAAAAG0/lmPZqcYOfTw/s640/refactory_push_in.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;4. Open the created application in NetBeans&lt;/b&gt; through Import Eclipse Project/Workspace option. Do clean and build and go for Run application. If not configured anything NetBeans will ask for the Web Server which can be selected to installed Apache Server.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5Cj9W6HTMI/AAAAAAAAAG8/wQyWnlrQyyE/s1600-h/import_eclipse_in_netbeans.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="516" src="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5Cj9W6HTMI/AAAAAAAAAG8/wQyWnlrQyyE/s640/import_eclipse_in_netbeans.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5ClLAXIEPI/AAAAAAAAAHU/OdvqL51C_pc/s1600-h/project_view_in_netbeans.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5ClLAXIEPI/AAAAAAAAAHU/OdvqL51C_pc/s640/project_view_in_netbeans.bmp" width="284" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5CkD1C1e5I/AAAAAAAAAHE/TvUeCVQNF-0/s1600-h/run_roo.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5CkD1C1e5I/AAAAAAAAAHE/TvUeCVQNF-0/s640/run_roo.bmp" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Still there are many things in Spring Roo you can not do in NetBeans but for all those things, again one can go back to the command prompt or to the STS for required changes, refactor again and refresh the NetBeans project to take the new changes.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-1304009855673953878?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/1304009855673953878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/03/spring-roo-with-netbeans.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/1304009855673953878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/1304009855673953878'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/03/spring-roo-with-netbeans.html' title='Spring Roo with NetBeans'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_TYf1VDTX0Kc/S5CRCbvXBKI/AAAAAAAAAGM/tmMpNXYO6FY/s72-c/create_project.bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-7319250786612036867</id><published>2010-03-02T02:50:00.000-08:00</published><updated>2010-03-02T03:03:14.109-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='tdd'/><category scheme='http://www.blogger.com/atom/ns#' term='bdd'/><category scheme='http://www.blogger.com/atom/ns#' term='easyb'/><title type='text'>Easyb Revisited - A Groovy based BDD Testing Framework</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a href="http://easyb.org/"&gt;easyb&lt;/a&gt; is a behavior driven development framework for testing. easyb accepts the Groovy syntax for better explanation of the test scenarios. The first time i encountered easyb, i could not understand the syntactical and semantical sugar but after learning Groovy now i am finding the framework pretty good and useful.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;easyb provides two types of templates: one is Ruby RSpac based "it 'should...'" style and another is "given".."when".."then" style. I use the "given.." style because its very explanatory and yet simple make someone understand.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Let's take an example to understand the benefits of the easyb from a programmer and non-programmer's point.&lt;/div&gt;&lt;br /&gt;&lt;b&gt;// A utility class to be tested&lt;/b&gt;&lt;br /&gt;&lt;i&gt;public class StringList{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;public void add(String element){&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(element == null){&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new RuntimeException("Null values not allowed");&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // add value&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;//easyb story - given..when..then style&lt;/b&gt;&lt;br /&gt;&lt;i&gt;scenario "check StringList with null value addition", { &amp;nbsp; // scenario with a reason&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; given "an empty StringList", { &amp;nbsp;// what all things available in the scenario&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strList = new StringList()&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; when "insert null value", { &amp;nbsp; // what all operations has to be carried out in the scenario&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;insertNull = {&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strList.add(null)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; then "a runtime exception should be thrown", { &amp;nbsp;// what should be the result&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ensureThrows(RuntimeException){&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;insertNull()&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;//easyb story - it 'should..' style&lt;/b&gt;&lt;br /&gt;&lt;i&gt;description 'check StringList with null value addition'&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;before "initialize the StringList before each spec", {&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;strList = new StringList()&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;it "should throw an exception when null value inserted", {&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;ensureThrows(RuntimeException){&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; strList.add(null)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The above stories can be easily divided into two parts one who writes plain test scenarios and another who fills the valid code for testing. No additional knowledge or logic is required to write the test case. An online system can very well generate this kind of templates based on the user input.&lt;/div&gt;&lt;br /&gt;&lt;b&gt;// plain test scenario&lt;/b&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;scenario "check StringList with null value addition", { &amp;nbsp; // scenario with a reason&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; given "an empty StringList", { &amp;nbsp;// what all things available in the scenario&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; when "insert null value", { &amp;nbsp; // what all operations has to be carried out in the scenario&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; then "a runtime exception should be thrown", { &amp;nbsp;// what should be the result&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="text-align: justify;"&gt;The development or testing team can fill the scenario blocks later with actual code. easyb generates report with pending scenarios and executable scenarios. Pending scenarios are those in which no test code has been added so user can easily identify pending test cases from the reports.&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="text-align: justify;"&gt;The textual description is right available with the code and is also executable and comes in the result report. The approach helps team members to understand the test cases without much efforts or external documentation.&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The easyb comes in a .tar.gz distribution having easyb jar along with Groovy and Apache Commons CLI. So no additional Groovy dependencies are required.&lt;/div&gt;&lt;br /&gt;&lt;i&gt;...dev\tdd\easyb&amp;gt;java -cp .;$easyb_home\easyb-0.9.6.jar;$easyb_home\commons-cli-1.2.jar;$easyb_home\groovy-1.6.4.jar org.easyb.BehaviorRunner *.groovy&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The above statement will execute all the .groovy files through easyb interpreter BehaviorRunner. There are various switches for detail result of the execution.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;easyb generates the result reports in various formats like PlainText, HTML and XML, which can be integrated with any test-case reporting system.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The flexible syntax helps the business analyst and testing team to create test scenarios independent of the development team. A web-based test scenario identification system would be very helpful in generating various kinds of test cases from different users.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I use Netbeans IDE for all my development purpose. There is no plugin available for NetBeans but Eclipse and IntelliJ provides plugin for easyb. For NetBeans one can use the Ant scriptlets provided at &lt;a href="http://easyb.org/running.html"&gt;Running easyb&lt;/a&gt;.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;Additional refrences:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.easyb.org/"&gt;http://www.easyb.org&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tech.mrozewski.pl/2010/02/26/from-junit3-to-easyb/"&gt;http://tech.mrozewski.pl/2010/02/26/from-junit3-to-easyb/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://dannorth.net/introducing-bdd/"&gt;http://dannorth.net/introducing-bdd/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.dzone.com/articles/is-easyb-easy"&gt;http://java.dzone.com/articles/is-easyb-easy&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-7319250786612036867?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/7319250786612036867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/03/easyb-revisited-groovy-based-bdd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/7319250786612036867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/7319250786612036867'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/03/easyb-revisited-groovy-based-bdd.html' title='Easyb Revisited - A Groovy based BDD Testing Framework'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-5858350161119093298</id><published>2010-03-01T06:04:00.000-08:00</published><updated>2010-03-01T21:11:29.170-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='datagrid'/><category scheme='http://www.blogger.com/atom/ns#' term='grid'/><title type='text'>bsGrid - A simple HTML/Javascript/jQuery based data grid</title><content type='html'>bsGrid&amp;nbsp;is a small javascript/jquery based data grid i have developed for data visualization. The grid is Ajax enabled and for each data operation calls a special service URL.&lt;br /&gt;&lt;br /&gt;The grid provides basis functionalities like Sorting, Complex Searching, Paging, Column Freezing, etc. The server to client communication is in JSON so that simple POJOs can be used on the server side.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S4vIi6yK1oI/AAAAAAAAAF8/2wo9SevcB3g/s1600-h/bsGrid.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="377" src="http://3.bp.blogspot.com/_TYf1VDTX0Kc/S4vIi6yK1oI/AAAAAAAAAF8/2wo9SevcB3g/s640/bsGrid.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;As of now the code uses Servlet for initial rendering but soon that will be converted to a jQuery Plugin for multiple platform. For other detail refer to the Google Code project site : &lt;a href="http://code.google.com/p/bsgrid"&gt;http://code.google.com/p/bsgrid&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-5858350161119093298?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/5858350161119093298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/03/bsgrid-simple-htmljavascriptjquery.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5858350161119093298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5858350161119093298'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/03/bsgrid-simple-htmljavascriptjquery.html' title='bsGrid - A simple HTML/Javascript/jQuery based data grid'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_TYf1VDTX0Kc/S4vIi6yK1oI/AAAAAAAAAF8/2wo9SevcB3g/s72-c/bsGrid.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-6995219862147525598</id><published>2010-02-23T21:36:00.000-08:00</published><updated>2010-02-23T21:36:45.483-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nosql'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Open Source NoSQL Databases</title><content type='html'>The &lt;a href="http://java.dzone.com/articles/open-source-nosql-databases"&gt;article&lt;/a&gt; lists open-source databases falls into the NoSQL category. NoSQL is another database paradigm where conventional relational approach and SQL query has no space, rather databases follows the semi-structured, graph based or key-value pair based storage approach for new age social and distributed application requirements.&lt;br /&gt;&lt;br /&gt;Enjoy the article.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-6995219862147525598?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/6995219862147525598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/open-source-nosql-databases.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6995219862147525598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6995219862147525598'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/open-source-nosql-databases.html' title='Open Source NoSQL Databases'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-5635208314383316636</id><published>2010-02-20T22:23:00.000-08:00</published><updated>2010-02-20T22:25:03.081-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='google ambassadors'/><category scheme='http://www.blogger.com/atom/ns#' term='google links'/><title type='text'>Google Ambassadors: 45 Essential Google Links</title><content type='html'>&lt;span class="Apple-style-span" style="color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16px;"&gt;Google has many well-known and some lesser-known products that everyone who uses Google should be familiar with. The following &lt;a href="http://googleambassadors.blogspot.com/2009/12/google-for-newbies-and-advanced.html"&gt;list&lt;/a&gt; has been prepared by &lt;a href="http://googleambassadors.blogspot.com/"&gt;Google Ambassadors&lt;/a&gt;, a group responsible to promote Google products to Internet users, an explanation about the group activities can be found &lt;a href="http://googleambassadors.blogspot.com/2009/11/introducing-google-ambassadors.html"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-5635208314383316636?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/5635208314383316636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/google-ambassadors-45-essential-google.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5635208314383316636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5635208314383316636'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/google-ambassadors-45-essential-google.html' title='Google Ambassadors: 45 Essential Google Links'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-5778763155087471824</id><published>2010-02-20T05:48:00.000-08:00</published><updated>2010-02-20T06:09:46.002-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='rest'/><category scheme='http://www.blogger.com/atom/ns#' term='gwt'/><title type='text'>GWT client with REST</title><content type='html'>This article explains a small prototype i developed for a friend to show how REST services can be used can be used from the client code and avoid additional RPC call. The demo explains only two fundamental class structures to access the remote service.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;RequestBuilder&lt;/b&gt;&lt;br /&gt;GWT client API is having an HTTP request builder class which helps the application to make remote connection through HTTP request and supported methods (GET, POST).&lt;br /&gt;&lt;br /&gt;&lt;i&gt;RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, urlAddress);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;builder.sendRequest("", new RequestCallback() {&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;public void onResponseReceived(Request request, Response response) {&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; //use response.getText() to get the resulting text from the service&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;public void onError(Request request, Throwable exception) {&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; // exception handling&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;});&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;XmlParser&lt;/b&gt;&lt;br /&gt;GWT client API also provides XML parsing capabilities but to use that XML.gwt.xml has to be included in the modules file.&lt;br /&gt;&lt;br /&gt;The following code can parse the XML text and prepare complex node list which can be traversed to access the attributes and node values.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;i&gt;Document doc = XMLParser.parse(response.getText());&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Once Document instance is generated program can start traversal from the root node or can search for the particular nodes based on the name.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;i&gt;NodeList nodeList = doc.getChildNodes(); // to start from root node&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;NodeList nodeList = doc.getElementsByTagName(nodeName); &amp;nbsp;// to start from selected node&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Full source code with example services is available &lt;a href="http://code.google.com/p/gwt-client-rest"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-5778763155087471824?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/5778763155087471824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/gwt-client-with-rest.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5778763155087471824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5778763155087471824'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/gwt-client-with-rest.html' title='GWT client with REST'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-8160301360848184229</id><published>2010-02-19T11:11:00.000-08:00</published><updated>2010-02-19T11:14:36.411-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fluiddb'/><category scheme='http://www.blogger.com/atom/ns#' term='social database'/><category scheme='http://www.blogger.com/atom/ns#' term='neo4j'/><category scheme='http://www.blogger.com/atom/ns#' term='cassandra'/><title type='text'>Social Databases</title><content type='html'>&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Like many others i am not a big fan of SQL databases available today. But every application needs some or the other ways to persist the information. Being a Java programmer there are many options available to avoid raw SQL interaction during the development through Hibernate, JDO or JPA. But these all at the end lands at relational database only.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Soon i started gaining familiarity with the Google Bigtable and Amazon Dynamo for their non-relational approach and why relational database will not help for their kind of applications. Well the approach was shocking and different but fascinated and proven at the same time. Meanwhile many developers realized that they might need different kind of database altogether to help their applications grow and respond faster.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;This realization resulted into many unorthodox, simple yet powerful databases which now-a-days falls into the Social Database category.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://www.neo4j.org/"&gt;&lt;b&gt;Neo4j&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Neo4j is a graph database. It is an embedded, disk-based, fully transactional Java persistence engine that stores data structures rather than in tables. The database is quite small in size, approx &amp;lt;500k jar. It provides objected-oriented API to interact with the database.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; Besides such a small database, Neo4j provides all the usual database features like ACID transaction, durable persistence, transaction recovery and concurrency control.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;For further information you can look out this &lt;a href="http://www.infoq.com/presentations/emil-eifrem-neo4j"&gt;presentation video&lt;/a&gt;&amp;nbsp;and &lt;a href="http://www.slideshare.net/emileifrem/nosql-east-a-nosql-overview-and-the-benefits-of-graph-databases"&gt;slides&lt;/a&gt; by Neo4j creator.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://incubator.apache.org/cassandra/"&gt;&lt;b&gt;Cassandra&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Cassandra is a highly scallable second-generation distributed key-value based database. Initially developed at Facebook and now resides in Apache Incubator. Cassandra combines best features from Amazon Dynamo and Google Bigtable. Cassandra just like Neo4j is tested and proven for high-volume, high-transaction environments. Companies like Facebook, Twitter, Cisco, Mahalo and many more uses Cassandra in their applications.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Cassandra follows the decentralized model where every node in the cluster is having identical information so there is no single point failure. Like many clustered databases, Cassandra follows the Eventually&amp;nbsp;Consistent&amp;nbsp;model and supports advanced features like Read Repair and Hinted Handoff to minimize inconsistency windows.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; There are lot of &lt;a href="http://www.slideshare.net/Eweaver/cassandra-presentation-at-nosql"&gt;presentations &lt;/a&gt;for the same can be found at SlideShare.net.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a href="http://fluidinfo.com/fluiddb"&gt;&lt;b&gt;FluidDB&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;I have just started my working on this new kind of database. FluidDB is a hosted online cloud database. FluidDB follows the Wiki kind of approach where either user or application can created objects and modify the existing objects. Though it doesn't follow the Wiki model as it is and maintains certain restriction like permission and strict data type. It provides an efficient query mechanism to search through the database. The database provides simple HTTP request API for access.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;The database is in the private alpha as of now and you might get an access after sending the FluidDB team a mail API access request. As such i have not explored the database fully but there are plenty of ways this database can be used in today's applications.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;a href="http://tickery.net/"&gt;Tickery&lt;/a&gt; is a simple Twitter based application developed by team FluidDB team for demonstration purpose.&amp;nbsp;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&amp;nbsp;&amp;nbsp;With the growing amount of social applications and their complexities we might see varying amount of databases for different requires over the period of time.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Though these databases will not help you remove the relational databases altogether but will help you deliver the desired complex functionalities fast, easy and with less pain.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-8160301360848184229?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/8160301360848184229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/social-databases.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/8160301360848184229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/8160301360848184229'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/social-databases.html' title='Social Databases'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-4774103326672247714</id><published>2010-02-18T03:33:00.000-08:00</published><updated>2010-02-18T08:24:50.121-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='vaadin'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><title type='text'>Vaadin-Spring Integration</title><content type='html'>&lt;div style="text-align: justify;"&gt;I remember the time when i was trying to integrate Spring with Struts2 and GWT applications. The problem was rather documenting the integration stuff i tried to remember them and as usual tend to forgot them. So this time have decided to document the Spring integration with Vaadin.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;web.xml changes&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;So first we need to add the Spring Context listener to load the bean configuration file.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;listener&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;listener-class&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;org.springframework.web.context.ContextLoaderListener&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/listener-class&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;/listener&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&amp;lt;context-param&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;param-value&amp;gt;/WEB-INF/applicationContext.xml&amp;lt;/param-value&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;/context-param&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Add the Spring Servlet to intercept Vaadin requests&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;servlet&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;servlet-name&amp;gt;VaadinSpringServlet&amp;lt;/servlet-name&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;servlet-class&amp;gt;com.dhaval.web.vaadin.spring.servlet.SpringApplicationServlet&amp;lt;/servlet-class&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;init-param&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;param-name&amp;gt;applicationBean&amp;lt;/param-name&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;param-value&amp;gt;testApplication&amp;lt;/param-value&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/init-param&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;/servlet&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;servlet-mapping&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;servlet-name&amp;gt;VaadinSpringServlet&amp;lt;/servlet-name&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;url-pattern&amp;gt;/vaadin/*&amp;lt;/url-pattern&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;/context-param&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;Spring Servlet&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;This servlet connects the Spring with Vaadin. The servlet loads the Vaadin Application class and dispatches all the HTTP requests/responses. The &lt;a href="http://dev.vaadin.com/svn/incubator/SpringApplication/src/main/java/com/vaadin/incubator/spring/servlet/SpringApplicationServlet.java"&gt;Servlet&lt;/a&gt; is available in the Simple Application provided by Vaadin Team for Spring integration.&lt;/div&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;Spring bean configuration&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;property&amp;gt;name="driverClassName" value="${db.driver}"/&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;property&amp;gt;name="url" value="${db.url}"/&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;property&amp;gt;name="username" value="${db.user}"/&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;property&amp;gt;name="password" value="${db.pass}"/&amp;gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;/bean&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;property&amp;gt;name="dataSource" ref="dataSource"/&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;/bean&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;bean id="dao.user" class="com.dhaval.web.vaadin.spring.dao.UserDaoImpl"&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;constructor-arg&amp;gt;ref="jdbcTemplate"/&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;/bean&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;bean id="testApplication" class="com.dhaval.web.vaadin.spring.MyApplication"&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;constructor-arg&amp;gt;ref="dao.user"/&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;lt;/bean&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;testApplication&lt;/i&gt; bean id is same as we have given in the web.xml as an init-param to Spring Servlet.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;Vaadin Main Application class&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;This is my Vaadin Application class&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;public class MyApplication extends Application{&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;private UserDaoImpl userDao;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public MyApplication(UserDaoImpl userDao){&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.userDao = userDao;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;public void init() {&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Window mainWindow = new Window("Simple Vaadin Spring Integration");&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;final TextField txtUser = new TextField("Enter username");&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Button btnCheckUser = new Button("Check Username");&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;final Label lblCheckMsg = new Label("");&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;btnCheckUser.addListener(new Button.ClickListener() {&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void buttonClick(ClickEvent event) {&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;boolean result = userDao.hasUser(txtUser.getValue().toString());&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(result){&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lblCheckMsg.setValue("Available");&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}else{&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lblCheckMsg.setValue("Not Available");&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mainWindow.addComponent(txtUser);&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mainWindow.addComponent(btnCheckUser);&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mainWindow.addComponent(lblCheckMsg);&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setMainWindow(mainWindow);&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The full source code is available at &lt;a href="http://code.google.com/p/vaadin-spring-integration/"&gt;vaadin-spring-integration&lt;/a&gt;&amp;nbsp;in download section.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-4774103326672247714?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/4774103326672247714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/vaadin-spring-integration.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4774103326672247714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4774103326672247714'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/vaadin-spring-integration.html' title='Vaadin-Spring Integration'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-6615606833195915904</id><published>2010-02-17T20:54:00.000-08:00</published><updated>2010-02-17T21:07:40.275-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gpath'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Groovy GPath for complex object traversal</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;GPath is a path expression language integrated into Groovy which allows parts of nested structured data to be identified and processed. GPath is named after popular XPath functionality to traverse XML nodes. GPath can be used to process XML nodes or composite objects.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;class Person{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;String firstName&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;String lastName&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;int age&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;def personList = [&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;new Person(firstName: "dhaval", lastName: "nagar", age: 25),&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;new Person(firstName: "nachiket", lastName: "patel", age: 24),&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The easiest way to get all firstName from the above collection is to use collect{} closure:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;println personList.collect{it.firstName}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;// will print ["dhaval", "nachiket"]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;But Groovy believes in shortening the most obvious stuff so the above statement can be rewritten like the following the still get the same result.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;println personList.firstName&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;This feature becomes powerful when combined with Regular Expression. The following statement will print all the person whose first name starts with "d".&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;println personList.firstName.grep(~/d.*/)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;// will print ["dhaval"]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;However GPath is more popular to parse the XML documents effectively. Here we will take a small XML document and parse it with XmlSlurper and access it's nodes with GPath.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;def mylinks = """&lt;br /&gt;&amp;lt;links&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;link&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;id&amp;gt;1&amp;lt;/id&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;url&amp;gt;www.google.com&amp;lt;/url&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/link&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;link&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;id&amp;gt;2&amp;lt;/id&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;url&amp;gt;www.apple.co.in&amp;lt;/url&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/link&amp;gt;&lt;br /&gt;&amp;lt;/links&amp;gt;&lt;br /&gt;"""&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;def links = new XmlSlurper().parseText(mylinks)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The following statement will print all the URL ending with "com"&lt;/div&gt;&lt;div style="text-align: justify;"&gt;println links.link.url.grep(~/.*com/)&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The following statement will print all the URL ending with "co.in". One way to escape the . is to surround it with square brackets.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;println links.link.url.grep(~/.*co[.]in/)&lt;br /&gt;&lt;br /&gt;If my xml document changes radically, its affects my code very slightly.&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;def mylinks = """&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&amp;lt;links&amp;gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;link id="1" url="www.google.com"/&amp;gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;lt;link id="2" url="www.apple.co.in"/&amp;gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&amp;lt;/links&amp;gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div&gt;"""&lt;/div&gt;&lt;div&gt;&lt;br /&gt;To find out urls ending with "com" and "co.in":&lt;br /&gt;&lt;br /&gt;println links.link.@url.grep(~/.*com/)&lt;/div&gt;println links.link.@url.grep(~/.*co[.]in/)&lt;br /&gt;&lt;br /&gt;@ is the operator to access the property of a node.&amp;nbsp;Parsing XML documents in such an easy way is a dream come true for a Java programmer.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-6615606833195915904?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/6615606833195915904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/filter-unwanted-collection-data-through.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6615606833195915904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6615606833195915904'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/filter-unwanted-collection-data-through.html' title='Groovy GPath for complex object traversal'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-4674627161924209387</id><published>2010-02-15T23:40:00.000-08:00</published><updated>2010-02-15T23:40:30.831-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aardvark'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Aardvark - A Valuable Business Tool</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Couple of days before I got a news that Google acquired another popular Internet service called &lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;a href="http://www.vark.com/"&gt;Aardvark&lt;/a&gt; in nearly $50 Millions&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. Aardvark is a social search engine service that connects users live with friends or friends-of-friends who are able to answer their questions. Based on my short interaction with the tool i realized that it can become a great boon for any kind of organizations.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;I started using the Aardvark after this news and i found it really good tool to get the answers properly and pretty fast. I am using &lt;/span&gt;&lt;a href="http://answers.yahoo.com/"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Yahoo Answers&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; for all my non-technical questions and &lt;/span&gt;&lt;a href="http://www.stackoverflow.com/"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Stackoverflow&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; for technical questions as I am a software engineer. Though both of these tools are doing pretty well, I was still finding that both the services are missing something.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Now to show Aardvark from an organization perspective, I work in a quite a big organization which employs huge and diversified manpower. Such a big enterprise contains an MIS system to keep employee profile information for future references. However its really hard to keep the latest profile information of each of the employee in the organization. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Every organization generates enormous amount of industry specific problem. When the problem arise they either seek an internal help based on the employee profile information or contact external agencies for support. In any case its time consuming at first and huge investment at the end, in the worst case an organization spends huge money on an external agency who fails to do the job and eventually either the problem is dropped or they find someone from inside.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;To not cause such a heavy damage, now a days most of the companies (well software in particular) use Wiki/Forum/Blogs to tackle the situation and spread the knowledge. But this approach is limited to a set of companies and its not interactive. User seeking the information has to search through the set of services to find the answer to his problem.  &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;People tend to learn new things every now and then so their profile keeps on updating compared to organization which prefers to update the profile information every six months or a year. So this approach creates mismatch between the actual employee profile and its organizational print. Because of this match many a times Organization end up hiring brand new resource or seek for some external agency to solve the problem.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Aardvark is a tool which can really bridge the gap between this mismatch. Employee getting new knowledge every now and then can update her profile immediately. Aardvark is intelligent enough in delegating the question to right persons. Such an intelligent and fast communication medium can be used in Enterprises to solve problems immediately without investing further valuable resources.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Well while writing this Aardvark is officially part of Google so in future we might see many new features combined with existing Google services.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-4674627161924209387?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/4674627161924209387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/aardvark-valuable-business-tool.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4674627161924209387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4674627161924209387'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/aardvark-valuable-business-tool.html' title='Aardvark - A Valuable Business Tool'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-7230703681390223633</id><published>2010-02-11T04:13:00.000-08:00</published><updated>2010-02-13T23:10:36.424-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='buzz'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='gmail buzz'/><title type='text'>Google Buzz - sharing with GMail</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;a href="http://www.google.com/buzz"&gt;Buzz&lt;/a&gt; a new service just announced by Google available under the GMail account. Buzz is designed to share day to day stuffs like text, images, videos, etc. Most of the features are similar to other popular social sharing services apart from the GMail front and other Google services integration.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Following are few buzzes of the Buzz.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Two mode of sharing is available. Public sharing similar to twitter and Private sharing where update is visible to the users of selected group(s)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Many external applications can be configured as a connected sites like &lt;/span&gt;&lt;a href="http://www.youtube.com/"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;YouTube&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;, &lt;/span&gt;&lt;a href="http://reader.google.com/"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Google Reader&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;, Picasa, &lt;/span&gt;&lt;a href="http://www.blogspot.com/"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Blogspot&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;, Blogger and &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;a href="http://www.flickr.com/"&gt;Flickr&lt;/a&gt;. As such you can paste link having images or videos, Buzz will scan the media files and show you the available contents to select if there are multiple images or videos available. I tried with flickr, vimeo, wikipedia and smashingmagazine&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;All Buzz entries are available in your &lt;/span&gt;&lt;a href="http://www.google.com/profiles"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Google Profile&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; page under Buzz tab&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Any post shared in the Google Reader will be available as a Buzz entry if the Reader is configured as a connected site&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;A Buzz can be directed to user(s) through '@' symbol before the username like @dhaval.b.nagar@gmail.com&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Twitter updates are available as buzz entries if Twitter is configured as a connected site&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;To create RSS for your own Buzz entries, go to your profile page and select the Buzz tab. Copy the URL and add it in the Google Reader under Add Subscription&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Buzz allows to post Link, Images and Videos to entries. Images can be seen with presentation feature on the same page. Videos can be seen live&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Each conversation can be seen independently from the Time Link given on the top right of the dialog box&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;As such you can paste any link on the conversation dialog box and Buzz will find all the available images and videos on the page. You can select at max 4 media content to post.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Overall Buzz falls somewhere between the Google Wave and many other popular social applications. With the failure of Google Wave (or may be Buzz in near future) we will see many such applications trying to fit in the "Social Shoe" from Google.  &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-7230703681390223633?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/7230703681390223633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/google-buzz.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/7230703681390223633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/7230703681390223633'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/google-buzz.html' title='Google Buzz - sharing with GMail'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-5826435546098731634</id><published>2010-02-10T10:38:00.000-08:00</published><updated>2010-02-10T11:14:12.390-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='category'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Groovy Category and Dynamic Overriding</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;A Category class is an ordinary class which contains set of methods. The class can be used for a duration of code block and when used first parameter type of each method treats the declared method as its member method.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;class TestCategory{&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;    &lt;/span&gt;static def test(String str){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;       &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;return "testing"&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;use(TestCategory){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;// test() can be called as a member method inside the use block&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;assert "testing" == "a".test()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;A category class can contain method without any parameters but it is not possible to use such method in the &lt;i&gt;use&lt;/i&gt; block. A category class method should at least have one parameter to get called from the &lt;i&gt;use&lt;/i&gt; block. The following code will throw an exception at the time of execution.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;class EmptyMethodCategory{&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;static def emptyMethod(){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;        &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;return "empty"&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;use(EmptyMethodCategory){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;assert "empty" == emptyMethod()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Operator overriding is the most suitable use of the Category classes. In case of operator overriding, if the caller is not matching with any of the overridden methods, original method will be executed.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;class StringSumCategory{&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;static def plus(String str1, String str2){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;        &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;return str1.toInteger() + str2.toInteger()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;use(StringSumCategory){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;assert 3 == "1" + "2"&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;assert "12" == "1" + 2&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;If the category class contains a method with only one parameter of type Object, that method will be available to any possible type in Groovy.&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;class SerializeCategory{&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;static def serialize(Object obj){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;        &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;// do serialization stuff&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;        &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;return serializedObj&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;use(SerializeCategory){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;println 1.serialize()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;println "a".serialize()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;println ([1, 2, 3].serialize())&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;println this.serialize()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;println serialize()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Groovy is full of surprises. It contains some of the best features from many static and dynamic languages.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-5826435546098731634?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/5826435546098731634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/groovy-category-and-dynamic-overriding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5826435546098731634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/5826435546098731634'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/groovy-category-and-dynamic-overriding.html' title='Groovy Category and Dynamic Overriding'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-4130610415356675593</id><published>2010-02-10T08:41:00.000-08:00</published><updated>2010-02-10T09:08:08.264-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='operator'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><category scheme='http://www.blogger.com/atom/ns#' term='spread'/><title type='text'>Spread operator</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Spread operator helps Groovy collections (list, range and map) to simple comma separated values. Spread operator is so flexible which can be used anywhere. For example:&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;def test(a, b, c){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;return a + b + c&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;def numList = [1, 2, 3]&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;If you want to pass the above list of values to the test() method you have to write some boilerplate code to extract the elements and pass them in the method. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Whereas the spread operator is introduced to eliminate boilerplate code and follow clean coding. The above method can be called with the given list without a single extra line of code.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;test(*numList)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;An asterisk followed by list, range or map will spread the collection and convert all the containing values to comma separated values. The above example will work same for Range.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;def numRange = 1..3&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;test(*numRange)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;Map has different syntax compared to List and Range.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;def aMap = [a:1, b:2]&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;def bMap = [c:3, *:aMap]&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Likewise Groovy contains many such shortening facilities where development time can be reduces and code can remain clear and understandable. &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-4130610415356675593?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/4130610415356675593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/spread-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4130610415356675593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/4130610415356675593'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/spread-operator.html' title='Spread operator'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-2076985487871012640</id><published>2010-02-10T06:57:00.000-08:00</published><updated>2010-02-10T08:25:32.003-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='operator'/><category scheme='http://www.blogger.com/atom/ns#' term='spread-dot'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Groovy spread-dot operator in GPath</title><content type='html'>&lt;span class="Apple-style-span" style="font-size: small;"&gt;GPath is an expression language integrated into Groovy to process nested objects. The dot and spread-dot operators helps to build the GPath expression. The dot operator is used to access the properties and spread-dot operator is used to access property, field or method.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;class Person{&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;String firstName&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;String lastName&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;int age&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;int calc(){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;return age * 2&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;def personList = [&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;new Person(firstName: "dhaval", lastName: "nagar", age: 25),&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;new Person(firstName: "nachiket", lastName: "patel", age: 24)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;]&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;To access the firstName property one can use either of the operators:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;println personList.firstName&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;// ["dhaval", "nachiket"]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;println personList*.firstName&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;// ["dhaval", "nachiket"]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;To access the calc() method spread-dot operator has to be used, whereas dot operator will raise an exception:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;println personList*.total() &lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;// [50, 48]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Apart from the access restrictions both the operators works differently when collection contains &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;null &lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;values like:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;personList &amp;lt;&amp;lt; null &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;personList &amp;lt;&amp;lt; &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;new Person(firstName: "sandeep", lastName: "shah", age: 30)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;println personList.firstName&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;// ["dhaval", "nachiket", "sandeep"]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;println personList*.firstName&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;// ["dhaval", "nachiket", null, "sandeep"]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;The spread-dot operator will add the null value for each null element in the resulting list. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Both the operators works same when the list element is not null but the requested property is null.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;personList.clear()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;personList &amp;lt;&amp;lt; &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;new Person(firstName: "dhaval", lastName: "nagar", age: 25)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;personList &amp;lt;&amp;lt; &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;new Person(lastName: "nagar", age: 25)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;println personList.firstName&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;// ["dhaval", null]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;println personList*.firstName&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;// ["dhaval", null]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;To avoid such null values in the resulting list, grep expression can be used.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;println personList.grep{it?.firstName}.firstName&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;// ["dhaval"]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Here grep will try to evaluate the true boolean condition, as per the Groovy Truth if an object is NULL it will be considered as FALSE. So above expression will reject all the objects where firstName property value is null.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-2076985487871012640?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/2076985487871012640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/groovy-spread-dot-operator-in-gpath.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/2076985487871012640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/2076985487871012640'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/groovy-spread-dot-operator-in-gpath.html' title='Groovy spread-dot operator in GPath'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-2280665617520386386</id><published>2010-02-09T08:53:00.000-08:00</published><updated>2010-02-09T09:17:24.822-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='closures'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Calling Groovy closure from Java</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:small;"&gt;After spending some time with Groovy alone i thought to mix Groovy code with Java. As closures seems the most weird in Groovy i tried to access a closure method from the Java class.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;b&gt;// Groovy code&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;class ClosureTest{&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;     &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;String firstName&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;     &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;String lastName&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;     &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;def proc(Closure closure){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;          &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;closure.call(firstName, lastName)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;     &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;} &lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;b&gt;// Groovy client&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;def ct = new ClosureTest()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ct.firstName = "dhaval"&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ct.lastName = "nagar"&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ct.proc{fn, ln -&gt; println "$fn, $ln"}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;b&gt;// Java client&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;import groovy.lang.Closure;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;class JavaClosureClient{&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;    &lt;/span&gt;public static void main(String[] args){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;       &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ClosureTest ct = new ClosureTest();&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;       &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ct.setFirstName("dhaval");&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;       &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ct.setLastName("nagar");&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;       &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ct.proc(new Closure(ct){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;           &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public Object call(Object[] argument){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;              &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;System.out.println(argument[0] + ", " + argument[1]);&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;              &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;return null;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;           &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;       &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;});&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;    &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Well the difference shows the verbosity of the Java client compared to the Groovy one. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;At my workplace we are not in a position to use Groovy extensively but with such silent integration between the two i am sure we can leverage some of the Groovy features.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-2280665617520386386?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/2280665617520386386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/calling-groovy-closure-from-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/2280665617520386386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/2280665617520386386'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/calling-groovy-closure-from-java.html' title='Calling Groovy closure from Java'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-8158026638497583846</id><published>2010-02-09T07:51:00.000-08:00</published><updated>2010-02-09T08:39:46.517-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dynamic binding'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy multimethod'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy binding'/><title type='text'>Dynamic Typing in Groovy</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Groovy like many other features works different from Java when it comes to method binding. Java uses the static binding at compile time to bind the method with the caller based on the parameter types. On the other hand Groovy does method binding at runtime based on the value type of the variable.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Java method binding&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public class BindingTest{&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public static void main(String[] args){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;&lt;/span&gt;Object obj1 = 1;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Object obj2 = "hello";&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;proc(obj1);&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;proc(obj2);&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public static void proc(Object obj){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;System.out.println("object");&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public static void proc(String str){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;System.out.println("string");&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;} &lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;At execution, the above Java program will print "object" for both the method calls. The reason is Java does "proc()" method binding based on the variable type defined in the call and ignores the actual values.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;On the other hand the same Groovy code will print the output based on the variable values at the runtime.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Groovy method binding&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;def proc(Object obj){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;println "object"&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;def proc(String str){&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;println "string"&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;proc 1&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;proc "hello"&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;The above Groovy program will print "object" followed by "string" output upon execution. This capability makes the code clear and concise. Developer can avoid unnecessary type casting in case of method overriding. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;One such boilerplate code a Java programmer has to write while overriding the equals() method, which can be avoided with this approach.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;// Java way&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;public boolean equals(Object obj){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;if(!(obj instanceof MyType)){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;return false;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;MyType mt = (MyType) obj;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;// do equality check&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;return result;&lt;/i&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;// Groovy way&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;public boolean equals(MyType mt){&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;// do equality check;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;i&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;i&gt;return result;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;The Groovy code is quite simple as no type checking or type casting is involved. Besides if the caller will pass any other type of object; the super class version of equals() will be called and as the base equals() checks identity (==, reference equality), it will return false without any additional line of code.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;So such small but effective techniques makes Groovy more popular in Java world.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-8158026638497583846?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/8158026638497583846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/dynamic-typing-in-groovy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/8158026638497583846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/8158026638497583846'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/dynamic-typing-in-groovy.html' title='Dynamic Typing in Groovy'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-3113579525911005632</id><published>2010-02-09T04:28:00.001-08:00</published><updated>2010-02-09T05:25:23.630-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='groovy basic'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Java Programmer's first look on Groovy</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Like many Java programmers i started learning Groovy for some fascinated stuffs like Dynamic Typing, Closures, functional programming, etc. Overall the first experience with the Groovy was mind blowing. It has many new things to learn. To start with i am using &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;a href="http://www.manning.com/koenig/"&gt;Groovy in Action&lt;/a&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; its an excellent book for Groovy beginners.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;My first encounter with Groovy started with the conventional "Hello World" program. The Hello World example finished and as such i didn't learn anything.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;println "Hello, World" &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;But meanwhile i found that there are various ways to execute the above groovy code snippet:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;1. From command prompt&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;groovy -e "println 'Hello, World'"&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;2. From .groovy file&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;// HelloWorld.groovy&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;println "Hello, World"&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;// on prompt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;// .groovy extension is optional&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;groovy HelloWorld.groovy&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;3. From Groovy Interactive Console&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;// on prompt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;groovyConsole&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;A GUI application will open where in the upper half part developer can write the Groovy script and on lower half can see the script result.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;4. From Groovy Shell&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;Though i haven't explored the Shell much but i could execute one line at a time and "Hello World" needs one line only. Following is the command to open the Groovy Shell:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;/ on prompt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&gt;groovysh&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Seemingly it would look quite simple to a new learner, but the real magic starts when the above code is either executed by Java interpreter or used by a Java program.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;Convert Groovy files to .class files&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;// on prompt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;// .groovy extension is NOT OPTIONAL this time&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;groovyc HelloWorld.groovy&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;And the above command will create a .class file which can be executed with:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;// on prompt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&gt;java -classpath .;{groovy home}\&lt;groovy&gt;embeddable\groovy-all-1.6.7.all.jar HelloWorld&lt;/groovy&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;And it works correctly. The same way this class file can be access by any Java program, it can create an instance or call the main() method directly.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;So overall my first experience with Groovy was really good and i am quite sure to spend some time with this emerging language.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;References&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;1. Groovy &lt;/span&gt;&lt;/span&gt;&lt;a href="http://groovy.codehaus.org/"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Home&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;2. Scott Davis' &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;a href="http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=practically+groovy:"&gt;articles on IBM DeveloperWorks&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;3. Lots of links at &lt;/span&gt;&lt;/span&gt;&lt;a href="http://groovy.dzone.com/"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Groovy DZone&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;4. &lt;a href="http://www.groovymag.com/"&gt;Groovy Magazine&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-3113579525911005632?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/3113579525911005632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/java-programmers-first-look-on-groovy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/3113579525911005632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/3113579525911005632'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/java-programmers-first-look-on-groovy.html' title='Java Programmer&apos;s first look on Groovy'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-6231286790171556816</id><published>2010-02-08T04:33:00.000-08:00</published><updated>2010-02-08T04:45:34.838-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='infoq'/><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Getting Started with Grails, Second Edition</title><content type='html'>The second edition of Getting started with Grails has just released. As the name says the book gives the step-by-step knowledge for the Grails framework and its fundamentals. The book is very well written and a must read for Grails beginners.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Scott Davis and Jason Rudolph both are very well known in Groovy and Grails world. The book will surely help you understand the power of Grails.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;The book is available in the infoq.com bookshelf &lt;a href="http://www.infoq.com/minibooks/grails-getting-started"&gt;http://www.infoq.com/minibooks/grails-getting-started&lt;/a&gt;.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;If you are a Groovy/Grails beginners like me, read Mastering Grails article series by Scott Davis at &lt;a href="http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=mastering+grails"&gt;http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=mastering+grails&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;&lt;span class="Apple-style-span" style="font-family: Lucida, 'Lucida Grande', Tahoma, sans-serif; font-size: 11px; line-height: 16px; "&gt;&lt;strong style="color: rgb(28, 73, 123); padding-top: 0px; padding-right: 2px; padding-bottom: 0px; padding-left: 2px; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Georgia, serif; font-weight: normal; line-height: normal; font-size: 16px; "&gt;  &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-6231286790171556816?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/6231286790171556816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/getting-started-with-grails-second.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6231286790171556816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6231286790171556816'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2010/02/getting-started-with-grails-second.html' title='Getting Started with Grails, Second Edition'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-6609988491265273710</id><published>2009-08-02T22:14:00.000-07:00</published><updated>2009-08-02T22:33:46.467-07:00</updated><title type='text'>Google Wave Free Account Access</title><content type='html'>&lt;div&gt;I received my Google Wave just a day before. But i found not all got this invitation and many are frustrated because they didn't got it and someone from their group has got it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am making my wave account open to those who doesn't have, so that they can use the application. This step to not to gain any kind of publicity but to help those who truly want to use.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;username: dhaval.b.nagar&lt;/div&gt;&lt;div&gt;password: for password mail me at dhaval.b.nagar@gmail.com&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am a java developer and google fan and hopping everyone going to use this account having the same purpose as i have, to make this much better.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-6609988491265273710?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/6609988491265273710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2009/08/google-wave-free-account-access.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6609988491265273710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/6609988491265273710'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2009/08/google-wave-free-account-access.html' title='Google Wave Free Account Access'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-803644120279574585</id><published>2009-07-01T23:45:00.001-07:00</published><updated>2009-07-01T23:48:26.715-07:00</updated><title type='text'>Maven setup behind firewall and NetBeans</title><content type='html'>&lt;span xmlns=''&gt;&lt;p&gt;Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Installation and Usage guidelines:&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Goto the download section of &lt;a href='http://maven.apache.org'&gt;http://maven.apache.org&lt;/a&gt;, download and extract it to your apache home folder in your computer (c:\program files\Apache Software Foundation\).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Create listed environment variables:&lt;br /&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;M2 with {Maven folder path}\bin&lt;br /&gt;&lt;/li&gt;&lt;li&gt;M2_HOME with {Maven folder path}&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Update the "PATH" environment with the {Maven folder path}\bin value.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;If you are accessing the internet through a Proxy server, you need to provide proxy information to the Maven installation also. Go to the {Maven folder path}\conf, open the &lt;em&gt;settings.xml &lt;/em&gt;file and update the proxy value in the following tag:&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;proxies&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;    &amp;lt;proxy&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;      &amp;lt;id&amp;gt;optional&amp;lt;/id&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;      &amp;lt;active&amp;gt;true&amp;lt;/active&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;      &amp;lt;protocol&amp;gt;http&amp;lt;/protocol&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;      &amp;lt;username&amp;gt;{your user name}&amp;lt;/username&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;      &amp;lt;password&amp;gt;{your password}&amp;lt;/password&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;      &amp;lt;host&amp;gt;proxy-server&amp;lt;/host&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;      &amp;lt;port&amp;gt;proxy-server-port&amp;lt;/port&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;      &amp;lt;nonProxyHosts&amp;gt;127.0.0.1&amp;lt;/nonProxyHosts&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;    &amp;lt;/proxy&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;/proxies&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;p style='margin-left: 36pt'&gt;&lt;br /&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Go to the command promp and type "mvn install", it should start installing basic modules required to run maven in {user home directory}\.m2 folder.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You can change the default home folder path from {user home directory}\.m2 to anything else like "c:\m2" from the {Maven folder path}\conf\settings.xml file by giving the new path in &lt;em&gt;&amp;lt;localRepository&amp;gt;&lt;/em&gt; tag. Once you change the path you need to fire the "mvn install" again to generate the basic maven structure or copy it from the old repository structure.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;Early NetBeans IDEs are providing the Maven interface with the additional plug-in support. Moreover new IDEs (6.5 onwards) Maven is integrated in the basic installation.&lt;br /&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;NetBeans also required Maven configuration to use integrated or external installation. For external Maven go to the "Tools -&amp;gt; Options -&amp;gt; Miscellaneous -&amp;gt; Maven" and provide external Maven home path.If using the integrated Maven of NetBeans one has to configure the Proxy settings of NetBeans to allow central repository access.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You can create Maven project by "File -&amp;gt; New Project -&amp;gt; Maven -&amp;gt; Maven Quickstart Archetype".&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Sub-project or Third-party dependencies can be easily given by "Add dependency" option in the "Libraries" node of the project.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;For further information go to &lt;a href='http://maven.apache.org'&gt;http://maven.apache.org&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style='color:red'&gt;Maven encourages the Test Driven Development, so please start understanding and writing the Junit test cases for the code.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-803644120279574585?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/803644120279574585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2009/07/maven-setup-behind-firewall-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/803644120279574585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/803644120279574585'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2009/07/maven-setup-behind-firewall-and.html' title='Maven setup behind firewall and NetBeans'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6305895565483687445.post-7515349535988178995</id><published>2009-02-04T05:52:00.001-08:00</published><updated>2009-02-04T06:13:36.520-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uml'/><category scheme='http://www.blogger.com/atom/ns#' term='sequence diagram'/><category scheme='http://www.blogger.com/atom/ns#' term='jtracert'/><title type='text'>Automatic Sequence Diagram with jTracert</title><content type='html'>In my early days of programming apart from the usual source people used to expect nice set of system diagrams specially with UML notations. UML, i always used to think, made for a computer scientist and not for a programmer like me. Fuzzy looking notations always turned down my programming exitements.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But soon i realized that documentation plays an important role in a software system. After spending couple of years in the industry i realized the importance of standard software practices. Documentation was my first assignment. By the time i start working on this seriously, i realized that the system is having hundrads of classes having thousands of methods. As the team follows the practice to document each part of the code with code-level comments the task was not that difficult. There are many tool available in the market which can generate diagrams like class, collaboration, dependencies chart, etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;jTracert is a lightweight, powerful tool to generate sequence diagrams from the running code without thouching any part of the code. It provides online drawing as well as offline drawing. The tool runs as a java agent with the application. jTracert generates diagram script compatible with &lt;sdedit&gt; a Sequence Diagram editor (available in sourceforge.net).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;jTracert supports various output file formats like local file system, real time sd server, web file system, etc. It is open source so code modifications can be made to satisfy custom requirements.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://code.google.com/p/jtracert/"&gt;http://code.google.com/p/jtracert/&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6305895565483687445-7515349535988178995?l=dhaval-n.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhaval-n.blogspot.com/feeds/7515349535988178995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dhaval-n.blogspot.com/2009/02/automatic-sequence-diagram-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/7515349535988178995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6305895565483687445/posts/default/7515349535988178995'/><link rel='alternate' type='text/html' href='http://dhaval-n.blogspot.com/2009/02/automatic-sequence-diagram-with.html' title='Automatic Sequence Diagram with jTracert'/><author><name>dhaval</name><uri>http://www.blogger.com/profile/14480306487650042716</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/-HBWeARc5efk/ToRB0t6ZFZI/AAAAAAAAAL8/HxKabLdtILk/s220/personal.jpg'/></author><thr:total>0</thr:total></entry></feed>
