<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUcFR3c4eCp7ImA9WhRUGU4.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435</id><updated>2012-01-30T16:23:36.930+01:00</updated><category term="teradata" /><category term="quartz" /><category term="installation" /><category term="ext-core" /><category term="multi-tenant" /><category term="javamelody" /><category term="localization" /><category term="img" /><category term="maven" /><category term="selenium" /><category term="camel" /><category term="joining parts" /><category term="phalanger" /><category term="ikvm" /><category term="wtf" /><category term="msbuild" /><category term="api" /><category term="M2TS" /><category term="nunit" /><category term="Mercurial" /><category term="ExP" /><category term="grails" /><category term="css" /><category term="git" /><category term="code coverage" /><category term="ratpack" /><category term="spring" /><category term="rails" /><category term="Delphi" /><category term="PIPA" /><category term="fxcop" /><category term="DynamicData" /><category term="eclipse" /><category term="closures" /><category term="asp.net mvc" /><category term="future" /><category term="hazelcast" /><category term="java" /><category term="java 7" /><category term="webservices" /><category term="vmware" /><category term="example" /><category term="ffmpeg" /><category term="faq" /><category term="warbler" /><category term="class library" /><category term="MTS" /><category term="visual studio" /><category term="spark-java" /><category term="PostgreSQL" /><category term="devkit" /><category term="Agile" /><category term="groovy" /><category term="cors" /><category term="easyb" /><category term="sinatra" /><category term="unit testing" /><category term="stylecop" /><category term="asp.net" /><category term="JSF" /><category term="stuff-not-use" /><category term="javaee6" /><category term="ubuntu" /><category term="testing" /><category term="plugins" /><category term="TenThingsIHateWithAPassion" /><category term="extjs" /><category term="SOPA" /><category term="hello-world" /><category term="nhibernate" /><category term="json" /><category term="freepascal" /><category term="subversion" /><category term=".NET" /><category term="unity" /><category term="servicemix" /><category term="phpPgAdmin" /><category term="ruby" /><category term="mail" /><category term="mvc controls" /><category term="proxy" /><category term="javascript" /><category term="esxi" /><category term="dynamic" /><category term="driving on empty" /><category term="cxf" /><category term="tomcat" /><category term="re-encoding" /><category term="MyBlog" /><category term="conference" /><category term="gorm" /><category term="IDE" /><category term="33rd degree" /><category term="ldap" /><category term="ICEfaces" /><category term="software-development" /><category term="licensing" /><category term="spark" /><category term="WVD" /><category term="web controls" /><category term="rake" /><category term="polyglot-programming" /><category term="hibernate" /><category term="modelbinder" /><category term="brain dump" /><category term="php" /><category term="4Developers" /><category term="updatemodel" /><category term="pico" /><category term="COM" /><category term="PDC09" /><category term="sql server" /><category term="jtk" /><category term="gsp" /><category term="C#" /><category term="express" /><category term="jquery" /><category term="ext.direct" /><category term="ruby-on-rails" /><category term="tags" /><category term="history" /><category term="MyFaces" /><category term="esx" /><category term="jruby" /><category term="c# 4.0" /><category term="spring.net" /><category term="AVCHD" /><title>Padcom's blog</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://padcom13.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>174</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/PadcomsBlog" /><feedburner:info uri="padcomsblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DUcFR3c_fyp7ImA9WhRUGU4.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-8952286748791562034</id><published>2012-01-30T16:19:00.001+01:00</published><updated>2012-01-30T16:23:36.947+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T16:23:36.947+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="software-development" /><title>The quality of software - part four</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WypfHE7fDK_O108HjkpDLtm_sWQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WypfHE7fDK_O108HjkpDLtm_sWQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WypfHE7fDK_O108HjkpDLtm_sWQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WypfHE7fDK_O108HjkpDLtm_sWQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In today's installment we're going to look at the quality of code from a broader perspective taking into account all &lt;a href="http://padcom13.blogspot.com/2012/01/modern-state-of-software-development.html"&gt;the&lt;/a&gt; &lt;a href="http://padcom13.blogspot.com/2012/01/alchemy-of-software-development-part.html"&gt;previous&lt;/a&gt; &lt;a href="http://padcom13.blogspot.com/2012/01/you-dont-get-to-drive-part-three.html"&gt;installments&lt;/a&gt;. I'll try to outline the difference between a good project vs a bad one, even though they both make money.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;What is software quality&lt;/h2&gt;&lt;br /&gt;
There is and always have been a huge gap between the end product and the code. That gap has been introduced some ages ago with tapes and cards. They didn't make any sense whatsoever to the end user as much as the code today makes no sense whatsoever to the user of your next brilliant application. Let's face it: programming is an art not everyone can do and even less people can understand (even if they are in fact doing it). So what makes up for a quality product?&lt;br /&gt;
&lt;br /&gt;
There are 2 sides of the story: one is the "make it to the market ASAP" side which tends to solve the problem of competing with others. Depending on the size of the project it might seem like it is a good idea to rush developers into doing the least that'll actually work or to push in some features that'll make the customers so much happier. &lt;br /&gt;
&lt;br /&gt;
The other side of it is that software is created by human beings and that in turn reveals the weakest link in the process of creation. Even though we can be extremely creative in our brilliant ideas we tend to make mistakes, tons of them. The faster you write code the less careful you are and the more bugs sneak in into the final creation...&lt;br /&gt;
&lt;br /&gt;
Sure there are people that get it right the first time, always, but there's so few of them you could put them into the "exception" group for a rule that programming is a very error-prone activity.&lt;br /&gt;
&lt;br /&gt;
So quality in the broader sense is something that is good for both the end user of our software as well as the agility to fix any bugs or introduce new features into the project.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;I can fix any bug in the projects I wrote - and do it FAST!&lt;/h2&gt;&lt;br /&gt;
That's a common misunderstanding that one can find bugs within software product they wrote. It is so because we, humans, don't stay the same for the duration of our lives. We tend to learn new things even if we don't admit it to ourselves. Let me tell you that looking at the code that I created 10 years ago scares the hell out of me! And I'm not the only one...&lt;br /&gt;
&lt;br /&gt;
So even though we'd like to think that if we'd be the only ones creating the software we will at some point face the danger that our old idea was plain wrong. Due to the changes that happened to our lives we tend to think differently and curse that brain-dead monkey that wrote this stuff some years ago.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Uncle Bob says: &lt;i&gt;Why did you write it?!&lt;/i&gt;&lt;/h2&gt;&lt;br /&gt;
One should always try to be at ones best when writing code. Period. There's no excuse for writing unsustainable code - be it for private use or for the company you work in. There's no excuse to write code that will make you ask &lt;i&gt;WTF&lt;/i&gt; every 5 moments. That'll make your life and the life of your fellow developers a living hell. And the worst part of it that it is not only you, the programmer, that will suffer from it - it's everyone in the chain starting with the guy that wrote it and ending with the programmer's worst enemy - the end user... How come? Well first of all you will curse the day you entered the project, then your architect will throw thunders at you for writing that piece of crap, then your manager will tell you that you need to go faster and cut corners and at the end of all this there is the customer that will probably go ahead and buy another solution that will not break as often as the piece of crap you and I created.&lt;br /&gt;
&lt;br /&gt;
My old boss when asked about what is software quality explained it more/less like this: &lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;The quality itself is not a goal for itself. But at the same time it is vital in order to sustain the company and the products it delivers&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
What it says is there's no one or the other. The world is not gray in this regard. If you make a loan in the code you'll have to pay it back in order to go further... &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Summary&lt;/h2&gt;&lt;br /&gt;
The summary of the whole series is quite simple: do TDD, do continuous integration, do pair programming, do code reviews, do make the querulous customer happy! They deserve it. You deserve it. You deserve to do the right thing. And if you can't do that then quit now and never look at software development again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-8952286748791562034?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/4SqOJr7G7Uk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/8952286748791562034/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=8952286748791562034" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/8952286748791562034?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/8952286748791562034?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/4SqOJr7G7Uk/quality-of-software-part-four.html" title="The quality of software - part four" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2012/01/quality-of-software-part-four.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0ANQXk6eCp7ImA9WhRUGEU.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-1977734602621712336</id><published>2012-01-29T14:19:00.008+01:00</published><updated>2012-01-30T02:09:50.710+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T02:09:50.710+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="grails" /><category scheme="http://www.blogger.com/atom/ns#" term="ratpack" /><title>Grails and Ratpack</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/I7dhCIZOB4G1HwdVkjTcOU9k-cM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/I7dhCIZOB4G1HwdVkjTcOU9k-cM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/I7dhCIZOB4G1HwdVkjTcOU9k-cM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/I7dhCIZOB4G1HwdVkjTcOU9k-cM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Today I've found out about the &lt;a href="https://github.com/bleedingwolf/Ratpack"&gt;Ratpack&lt;/a&gt; &lt;a href="http://grails.org/plugin/ratpack"&gt;plugin&lt;/a&gt;. Being a huge &lt;a href="http://www.sinatrarb.com/"&gt;Sinatra&lt;/a&gt; fan I was quite fond of the Ratpack framework to begin with and naturally I was amazed to see it incorporated into &lt;a href="http://grails.org"&gt;Grails&lt;/a&gt; as a plugin. And it works!&lt;br /&gt;
&lt;br /&gt;
Let me walk you through a very simple example of using Ratpack inside Grails.&lt;br /&gt;
&lt;br /&gt;
We start by enabling the Ratpack plugin in our application. I called mine app "example" so all the URLs will be prefixed with "/example". To include the plugin you need to add it to &lt;code&gt;grails-app/conf/BuildConfig.groovy&lt;/code&gt; like this:&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1698742.js?file=BuildConfig.groovy"&gt;&lt;/script&gt;With that in place we'll create a domain class to have some data to display. I'll go with the simplest possible class that represents a person &lt;code&gt;grails-app/domain/Person.groovy&lt;/code&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1698742.js?file=Person.groovy"&gt;&lt;/script&gt;Simple enough, right? Let's go an make some use of it in a Ratpack file. Create a folder &lt;code&gt;grails-app/ratpack&lt;/code&gt; and inside of it a file called &lt;code&gt;PersonRatpack.groovy&lt;/code&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1698742.js?file=PersonRatpack.groovy"&gt;&lt;/script&gt;As you can see here all we're doing is responding to the GET method on some root URL. Ratpack uses &lt;a href="http://groovy.codehaus.org/Groovy+Templates"&gt;SimpleTemplateEngine&lt;/a&gt; from Groovy. We have to tell it where to look for templates &lt;code&gt;Config.groovy&lt;/code&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1698742.js?file=Config.groovy"&gt;&lt;/script&gt;So let's create one to display the people from database &lt;code&gt;grails-app/ratpack/templates/list.html&lt;/code&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1698742.js?file=list.html"&gt;&lt;/script&gt;Simple enough, right? It almost looks like a mix of ERB and expression language from JSP. I think you'd have to ask the authors of SimpleTemplateEngine if those similarities have been made on purpose of if this syntax just seemed to be the only one that made sense... &lt;br /&gt;
&lt;br /&gt;
Anyways, with all that in place we can add some people to the database in our &lt;code&gt;grails-app/conf/BootStrap.groovy&lt;/code&gt; file like this:&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1698742.js?file=BootStrap.groovy"&gt;&lt;/script&gt;And that's it! start the application, navigate to &lt;a href="http://localhost:8080/example/ratpack"&gt;http://localhost:8080/example/ratpack&lt;/a&gt; and you should see the list of two people on the screen. &lt;br /&gt;
&lt;br /&gt;
Needless to say you can accomplish the exact same thing using a controller and a view. The idea here however is to show you that there is life beyond the standard artifacts and that the &lt;a href="http://grails.org/plugin/wicket"&gt;beauty&lt;/a&gt; &lt;a href="http://grails.org/plugin/scala"&gt;lies&lt;/a&gt; &lt;a href="http://grails.org/plugin/haml"&gt;in&lt;/a&gt; &lt;a href="http://grails.org/plugin/jsf2"&gt;diversity&lt;/a&gt;!&lt;br /&gt;
&lt;br /&gt;
Hope this will help someone get started with this awesome piece of code!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-1977734602621712336?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/LPlOpiX4q1k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/1977734602621712336/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=1977734602621712336" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/1977734602621712336?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/1977734602621712336?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/LPlOpiX4q1k/grails-and-ratpack.html" title="Grails and Ratpack" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>5</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2012/01/grails-and-ratpack.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4NQ3Y7eip7ImA9WhRVGU8.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-2588010781990821752</id><published>2012-01-19T00:20:00.001+01:00</published><updated>2012-01-19T00:23:12.802+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-19T00:23:12.802+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SOPA" /><category scheme="http://www.blogger.com/atom/ns#" term="PIPA" /><title>Intermission</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/GooRuN6aeKprPnmu9Z_WT1alFk8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GooRuN6aeKprPnmu9Z_WT1alFk8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/GooRuN6aeKprPnmu9Z_WT1alFk8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/GooRuN6aeKprPnmu9Z_WT1alFk8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Today's protest against SOPA and PIPA acts have had a tremendous impact on Internet traffic around the globe. Millions of people have been made aware of the irresponsible propositions of attack on freedom in the Network. You can't name it any other way than censorship which is the public enemy number one by any definition.&lt;br /&gt;
&lt;br /&gt;
I support Wikipedia, WordPress and all the others in their campaign against SOPA and PIPA! &lt;br /&gt;
&lt;br /&gt;
God help us all when the time comes to kill the last free medium on the planet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-2588010781990821752?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/BDZQOxg8aVI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/2588010781990821752/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=2588010781990821752" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/2588010781990821752?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/2588010781990821752?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/BDZQOxg8aVI/intermission.html" title="Intermission" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2012/01/intermission.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkECRHk-fSp7ImA9WhRVFEQ.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-5650039216383839441</id><published>2012-01-13T23:28:00.005+01:00</published><updated>2012-01-13T23:44:25.755+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-13T23:44:25.755+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="software-development" /><title>You don't get to drive - part three</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/99DYaU_j580BSpPo0SaLiMLJ4vg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/99DYaU_j580BSpPo0SaLiMLJ4vg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/99DYaU_j580BSpPo0SaLiMLJ4vg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/99DYaU_j580BSpPo0SaLiMLJ4vg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In the recent installments we've looked at software development as a discipline that has its own way of working. Its history, however brief, didn't leave any room for being mistaken with anything else. It is the single, most dynamic part of our modern society. But how do people handle it?&lt;br /&gt;
&lt;br /&gt;
If you're young, in Poland it'd be under 18 years old, you don't technically get to drive a car without adult supervision. That's pure theory nowadays but at least that's how it should be. Being young and funky gets lots of stupid ideas into your head like driving over 100km/h in town chasing a friend without knowing the road ahead. Been there, done that. It doesn't mean I was in my right mind when I did it.&lt;br /&gt;
&lt;br /&gt;
There are places where being wild is good. Certainly things where life is at stake are not the kind of ones where you'd expect one to go all in without training but that's what is actually happening all the time. People (including me) are by definition reckless and unpredictable and nothing is going to change that. There's a reason for that: had we been reasonable all the time no big discoveries would have happened. We wouldn't know about the continents of America, we most probably wouldn't know that radiation is actually bad and finally we'd probably die of hunger had there been no brave hunters risking their lives to master hunting animals.&lt;br /&gt;
&lt;br /&gt;
In today's modern world however we do have the opportunity to make less mistakes - at least less of those obvious ones. And with that let me present you with a definition of two words in German:&lt;br /&gt;
&lt;br /&gt;
Verfügen über - to have the knowledge about something, used in the sense "I do have a driving license"&lt;br /&gt;
&lt;br /&gt;
Beherrschen - to have the ability to do something, used in the sense "I do know how to drive a car"&lt;br /&gt;
&lt;br /&gt;
With those two there's little difference, right? Usually if you do have a driving license you should be capable enough to drive a car. But can you? Is that really what is going on?&lt;br /&gt;
&lt;br /&gt;
Let's try to apply that to software development for a moment. It is obvious you need to study to get the diploma to be a software developer. But does it mean you can do software with it? Can you actually make a living with it? As it turns out yes, you can. The discipline is so vast and by all means so naively taken by so many companies that the moment you step out of school you're ready to go, hot shot! You are the man with the skills. But are you?&lt;br /&gt;
&lt;br /&gt;
In my experience with young graduates and with students it was seldom the case when a young developer right after school was really ready to go. Actually I know only two people that when they came to work at a company with me I felt respect for the wealth of knowledge and humility for things they don't know. And so far it was just the two people I know this far that were open to the suggestion to learn new stuff. There's been sooo many cases where the lack of will to learn new technical skills was demonstrated along with arrogance (not to be confused with confidence) I couldn't even count.&lt;br /&gt;
&lt;br /&gt;
The worst thing about it is they really do get hired! And believe me when I say there are companies where a fresh graduate hired almost off-the-shelve gets the ability to flush the project they are working on literally down the toilette. That means a very young in terms of experience person gets commit access to software that costs hundreds, sometimes even millions of dollars! And we're not talking sporadically - it's how certain companies operate! There's a saying that "there's no person that can't be replaced with a finite number of students". That's how the new markets for software developers came to be.&lt;br /&gt;
&lt;br /&gt;
Obviously in every rule there are exceptions. I know that in the area there are maybe 15%-25% people that really get what software development is all about. And that's actually a very good ratio considering that software development has been announced one of the best paid jobs for graduates and is also viewed as one of the easiest ones in terms of rules.&lt;br /&gt;
&lt;br /&gt;
Yes, rules... What kind of rules are there?&lt;br /&gt;
&lt;br /&gt;
Among those professions I just mentioned there's an MD and a lawyer. Once you're done with your study you don't get to cut-open anybody for any reason, right? You need to gain practice under a trained eye of someone with that experience already there. Otherwise nobody would trust you with a knife doing god knows what to the body of a living soul! Same thing with lawyers. I hope you catch my drift here.&lt;br /&gt;
&lt;br /&gt;
But is it like this with software developers? Do they need to undergo a practice to get certified as software developers that can cut-open (refactor), create and destroy (god-like powers) and provide real value to customers earning big big money for their employers? I think not. I'm sure there are companies that do tend to forbid new hires (freshly out of school or not) to commit anything until they have been long enough with the company to get what they are doing. But it's not always the case. They are hired to do the job, to be resources, not engineers. They are just numbers that mostly do not add up. But there's hope that not everyone is as mad in their doing as the ones I've just mentioned. There's the opensource community that follows exactly the kind of path that it should. You start small, familiarize yourself with the code, maybe submit a patch or two, become a contributor first, gain the trust of other team members and finally if you prove yourself worthy you get the commit access. By the time you get it you'd do harsh things to people for causing harm to the project. I wonder why people do put the information about being a commiter to some opensource project on their CV.. Interesting, isn't it?&lt;br /&gt;
&lt;br /&gt;
More than anything else one needs to remember that software development is about learning and practicing. It's not always something new you need to learn. A lot of times it is something really, really old. Without knowing and above all without practicing it is not possible to "beherrschen" something. Nobody was born with the ability to drive an F1 car. You might "feel it" but you need to train to be good at it. You do need to get your hands dirty!&lt;br /&gt;
&lt;br /&gt;
Have a nice weekend!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-5650039216383839441?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/NoGjBfCHG3w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/5650039216383839441/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=5650039216383839441" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/5650039216383839441?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/5650039216383839441?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/NoGjBfCHG3w/you-dont-get-to-drive-part-three.html" title="You don't get to drive - part three" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2012/01/you-dont-get-to-drive-part-three.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MBQXc8fSp7ImA9WhRWGEs.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-1282214649611155167</id><published>2012-01-06T15:20:00.009+01:00</published><updated>2012-01-06T16:57:30.975+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-06T16:57:30.975+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="software-development" /><title>The alchemy of software development - part two</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wCKrdnP0GUEaBF3UzIGlJFGUJaM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wCKrdnP0GUEaBF3UzIGlJFGUJaM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wCKrdnP0GUEaBF3UzIGlJFGUJaM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wCKrdnP0GUEaBF3UzIGlJFGUJaM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In this installment let me walk you through the valley of shadows nobody using computers wants to look at. Let’s have a look at what creating software feels like, what it actually is and why at the end of the day you should care how it’s done.&lt;br /&gt;
&lt;br /&gt;
Software isn’t some forbidden science. It might be hard to understand by mare mortals but it definitely is not something that you can’t do even if you’re not very much into it. But should you? How does it feel like to be a &lt;a href="http://en.wikipedia.org/wiki/Software_developer"&gt;software developer&lt;/a&gt;?&lt;br /&gt;
&lt;br /&gt;
Imagine you have this completely obedient &lt;a href="http://en.wikipedia.org/wiki/Computer"&gt;servant&lt;/a&gt; ready to do everything without hesitation. You tell it to jump of a 100-story building without parachute and it does it. Right down on its face. Splash! Boom! There’s blood everywhere, &lt;a href="http://durak.org/sean/pubs/kfc/"&gt;harsh words&lt;/a&gt;,... But nobody cares - it was your servant and you have had complete control over him. The ultimate power! That’s you and the machine. And programmers do that sort of things every minute of every day when they create software. Up to the point when they figure out that the servant lives longer when he has a parachute that actually opens. Sometimes the servant goes haywire and does things the developer does not expect him to do. Suddenly he might refuse to jump even when all the precautions are in place and ready to go. Jump! Jump! Damn it! Then a moment of revelation happens: the developer instructed the servant not to jump if it’s raining, which makes perfect sense. He just didn’t realize the definition of rain was actually not very precise.&lt;br /&gt;
&lt;br /&gt;
The problem with your servant is that he understands only a very specific language. That language has only two words: a zero (0) and a one (1). Fortunately enough scientists realized that ages ago and created human-to-servant translators called &lt;a href="http://en.wikipedia.org/wiki/Compiler"&gt;compilers&lt;/a&gt;. Other mad scientists though that telling your servant to jump without parachute is a bad idea all along and created safe nets forbidding you to do that at all. That’s how runtime environments like &lt;a href="http://www.internetnews.com/dev-news/article.php/3373751/James+Gosling+Creator+of+Java.htm"&gt;Java&lt;/a&gt; or &lt;a href="http://microsoft.com/net"&gt;.NET&lt;/a&gt; came to be... All of the sudden your servant isn’t so obedient anymore. He has more than one master now and your word means nothing compared to the rules enforced by “The Creator”, be it the one that taught you and your servant to communicate or the one that thinks you’re complete moron that needs to be controlled as much as possible.&lt;br /&gt;
&lt;br /&gt;
In the center of all this there’s the programmer. But he’s not alone! There comes the &lt;a href="http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks"&gt;light at the end of the tunnel&lt;/a&gt;! The new hope! The solution to every problem he has ever had.. Miracle! A new technology has been created that is supposed to take the pressure of his back. It’s not a few moments later when he realizes that the light he saw was actually coming from a train heading his way and he starts feeling much more like he was before.&lt;br /&gt;
&lt;br /&gt;
The battle continues. Things are getting complicated because some other programmer comes in. The new guy might actually help but he doesn’t speak the language. Well, they both speak English but in a different way. They have different opinions about the side of the building the servant should be jumping from. Finally &lt;a href="http://en.wikipedia.org/wiki/Compromise"&gt;they agree&lt;/a&gt; that going from a corner makes the most sense. After all it’s the fact of landing that counts, right? It’s not the fact of flying itself (even though the most interesting one) but the safe landing that the crowd will observe. So it even makes sense to go a bit crazy and to tell the servant to wait until he’s about half the way through to open the parachute. This way the crowd will be even better entertained and get the result quicker.&lt;br /&gt;
&lt;br /&gt;
There’s that one last thing the team didn’t take into account. The original developer left and with him the original reason for the servant to exist. He was the one knowing all the why’s and how’s about the jump. The rest (and now there’s like a &lt;a href="http://en.wikipedia.org/wiki/Software_development_process"&gt;100 people working the servant&lt;/a&gt;) tries really hard to overcome all the tangled cords. Some of the Gordian knots can’t be solved so they cut them out replacing them with new ones, of a different nature, or even leaving the parachute crippled counting on the fact that the remaining strings will still do the job.&lt;br /&gt;
&lt;br /&gt;
Of course since there’s a huge group of developers some of them are more aware of the actual power they have and others don’t. People are different and that’s actually a good thing. From variety comes evolution, right? Well... If you want to jump on a parachute you wouldn’t put your life in the hands of some young inexperienced fast-food assistant, right? After all he knows nothing about jumping! But hey, that’s what happens all the time! After all how the young will learn if not by killing the servant just a couple of hundred times more? That’s not something the more experienced developers like so they manifest their position very strongly. They say they need to be treated like &lt;a href="http://manifesto.softwarecraftsmanship.org/"&gt;professionals&lt;/a&gt; because they “know”. They create &lt;a href="http://agilemanifesto.org/"&gt;manifests&lt;/a&gt;, meet to grizzle about colours of the parachute when at the same time their younger colleagues &lt;a href="http://www.youtube.com/watch?v=TjAOkLNdU50"&gt;help the servant meet his destiny&lt;/a&gt; a couple times more. The servant has many masters. He tries to listen to all of them but there’s just to many. He becomes the hooker trying to fulfill everyone’s dream...&lt;br /&gt;
&lt;br /&gt;
At the end of all this no one knows why the servant needed to jump. That’s perfectly normal and to be expected. The beauty of software development though is that there’s now a servant on every single tall building because everyone wants to have one! It doesn’t matter if you sell condoms or make cars... Just make the freak jump! We need this! &lt;br /&gt;
&lt;br /&gt;
Hope you’ve enjoyed the trip!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-1282214649611155167?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/575sKgSJcRc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/1282214649611155167/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=1282214649611155167" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/1282214649611155167?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/1282214649611155167?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/575sKgSJcRc/alchemy-of-software-development-part.html" title="The alchemy of software development - part two" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2012/01/alchemy-of-software-development-part.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQCR3o5eip7ImA9WhRWGEg.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-3133677473251209652</id><published>2012-01-06T13:19:00.000+01:00</published><updated>2012-01-06T13:19:26.422+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-06T13:19:26.422+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="software-development" /><title>Modern state of software development - part one</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MkXkJ0oxGnLO0t-BtV4ezPHKM4U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MkXkJ0oxGnLO0t-BtV4ezPHKM4U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MkXkJ0oxGnLO0t-BtV4ezPHKM4U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MkXkJ0oxGnLO0t-BtV4ezPHKM4U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Throughout the history the software industry has undergone a number of changes in moods, best practices, reinventions of the wheel, reincarnation of old ideas and sunset of countless technologies. Looking back at what has happened in the last two decades in both software development as well as software complexity is really astonishing.&lt;br /&gt;
&lt;br /&gt;
The evolution has truly changed the world as we know it. The foretold End Of The World “scheduled” for this year by Mayan calendar is actually a work in progress. The world as our parents knew it doesn’t exist anymore. Cars are capable of performing maneuvers one had to learn alone (like parking) and it doesn’t take The Great Oracle to be almost certain that in the near future controlling a car will become obsolete all together. Same thing with TV sets becoming not a view-only experience but communication centres, refrigerators controlling the state of food by (almost) themselves or finally cell phones being sold without the capability to make phone calls  but with a 24/7 Internet connectivity. All those things exist because there’s a need and all of them are driven by software.&lt;br /&gt;
&lt;br /&gt;
Since the early 70’s the software industry is the single, most energetic part of our western society. The only other one capable of keeping up is its twin brother, the hardware industry. But even hardware is designed with software these days. Ironic, is it not?&lt;br /&gt;
&lt;br /&gt;
In the middle of that is the most incredible, demanding and abstract profession out there, a program writer. Oh wait - we’re not program writers anymore! We are software developers!&lt;br /&gt;
&lt;br /&gt;
That brings me to the merit of this blog series: what is actually software development? Is it really a profession, like a carpenter or shoemaker? A shoe is something I can wear, right? It’s a real thing made of real components. I can use a table made by some carpenter to have the evening meal with my family. Or maybe it’s more like a T-Shirt? But can I touch the software?&lt;br /&gt;
&lt;br /&gt;
Certainly you can have fun with it! Games are the biggest time devourer ever :) I'd argue that if it wasn't for computer games the whole computerization wouldn't take place at all. It's through games that we have shed the fears of our parents about a computer being the Satan's tool of mass destruction. Who knows? Maybe they were right? The fact however remains unchanged that current generation of western civilization can't live without computers. And computers need software...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Have a nice day!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-3133677473251209652?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/ebfNr2y-3NQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/3133677473251209652/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=3133677473251209652" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/3133677473251209652?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/3133677473251209652?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/ebfNr2y-3NQ/modern-state-of-software-development.html" title="Modern state of software development - part one" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2012/01/modern-state-of-software-development.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEFQ38zcCp7ImA9WhRWFk4.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-8877191068647181471</id><published>2012-01-03T23:14:00.004+01:00</published><updated>2012-01-04T00:16:52.188+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-04T00:16:52.188+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="json" /><title>jQuery and posing JSON data to the server</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JvPOXqTZiUz3lcSfi_F3iepmPYY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JvPOXqTZiUz3lcSfi_F3iepmPYY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JvPOXqTZiUz3lcSfi_F3iepmPYY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JvPOXqTZiUz3lcSfi_F3iepmPYY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Today a good friend of mine asked me how to post JSON data to the &lt;a href="http://grails.org/plugin/json-rest-api"&gt;json-rest-api&lt;/a&gt; plugin using jQuery. As it turned out using &lt;code&gt;$.post()&lt;/code&gt; doesn't do the trick...&lt;br /&gt;
&lt;br /&gt;
Well it's not impossible but very inconvenient if you have to do it a lot. First you need to use the &lt;code&gt;$.ajax()&lt;/code&gt; method, not the &lt;code&gt;$.post()&lt;/code&gt; one. Secondly you need to specify the &lt;code&gt;contentType&lt;/code&gt; parameter for the receiver to be notified that the data is in that format. And last but not least it is crucial to properly serialize your object to string.&lt;br /&gt;
&lt;br /&gt;
The last part can be done using &lt;code&gt;JSON.stringify()&lt;/code&gt; but writing this over and over again is painful. Here's a &lt;a href="https://gist.github.com/1557142"&gt;gist&lt;/a&gt; (&lt;a href="https://raw.github.com/gist/1557142/jquery.post-json.js"&gt;raw&lt;/a&gt;) you can use that adds a sister version of &lt;code&gt;$.post&lt;/code&gt; called &lt;code&gt;$.postJSON&lt;/code&gt; that does exactly the same thing as the original one but sends data in JSON format instead of form post.&lt;br /&gt;
&lt;br /&gt;
&lt;script src="https://gist.github.com/1557142.js?file=jquery.post-json.js"&gt;&lt;/script&gt;Parameters are exactly the same with the single difference that the default expected data format is "json", which makes sense if you're working with JSON services.&lt;br /&gt;
&lt;br /&gt;
Happy coding!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-8877191068647181471?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/9TzR8ZrCeIU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/8877191068647181471/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=8877191068647181471" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/8877191068647181471?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/8877191068647181471?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/9TzR8ZrCeIU/jquery-and-posing-json-data-to-server.html" title="jQuery and posing JSON data to the server" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2012/01/jquery-and-posing-json-data-to-server.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMCQXw9fCp7ImA9WhRWEU0.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-7907602346289651613</id><published>2011-12-28T21:01:00.000+01:00</published><updated>2011-12-28T21:01:00.264+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-28T21:01:00.264+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="grails" /><title>Grails, Heroku and spring-security-core</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/i-gAIWJ89aQgGZlaNVusduTAbzM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i-gAIWJ89aQgGZlaNVusduTAbzM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/i-gAIWJ89aQgGZlaNVusduTAbzM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i-gAIWJ89aQgGZlaNVusduTAbzM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;This one is going to be quick, but made me spent almost 2 hours to google it...&lt;br /&gt;
&lt;br /&gt;
If you install the &lt;a href="http://grails.org/plugin/spring-security-core"&gt;spring-security-core&lt;/a&gt; plugin and want to deploy your application o &lt;a href="http://heroku.com"&gt;Heroku&lt;/a&gt; you'll end up with a nasty-looking exception like this:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
If you google for &lt;i&gt;No thread-bound request found&lt;/i&gt; you'll &lt;a href="http://jira.grails.org/browse/GRAILS-7583"&gt;find&lt;/a&gt; &lt;a href="http://jira.grails.org/browse/GPSPRINGSECURITYCORE-98"&gt;some&lt;/a&gt; Jira issues that'll tell you pretty much nothing besides that it is a Grails issue.&lt;br /&gt;
&lt;br /&gt;
Among other search results is also &lt;a href="http://grails.1312388.n4.nabble.com/IllegalStateException-with-spring-security-core-and-resources-plugins-on-Heroku-td4209124.html"&gt;this one&lt;/a&gt; stating that the actual issue is with the webxml plugin being snatched in the wrong version and that you need to force Grails to use the right one like this:&lt;pre&gt;&lt;code&gt;BuildConfig.groovy:
compile ":webxml:1.4.1"&lt;/code&gt;&lt;/pre&gt;I have no idea why Burt Beckwith will not upgrade the webxml plugin dependency to 1.4.1 (which does fix this bug). Until that happens just put the line above in your build config and life is good again.&lt;br /&gt;
&lt;br /&gt;
See ya!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-7907602346289651613?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/2C-ZwL7nT0w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/7907602346289651613/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=7907602346289651613" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/7907602346289651613?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/7907602346289651613?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/2C-ZwL7nT0w/grails-heroku-and-spring-security-core.html" title="Grails, Heroku and spring-security-core" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/12/grails-heroku-and-spring-security-core.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUFQ3c6cCp7ImA9WhRRGU4.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-4023919887530776664</id><published>2011-12-03T19:33:00.000+01:00</published><updated>2011-12-03T19:33:32.918+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-03T19:33:32.918+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="grails" /><title>Grails routing plugin family updated</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QUOm6H7s1eygLbacC4no9wFUFwI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QUOm6H7s1eygLbacC4no9wFUFwI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QUOm6H7s1eygLbacC4no9wFUFwI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QUOm6H7s1eygLbacC4no9wFUFwI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;It's about time the &lt;a href="https://github.com/padcom/grails-routing"&gt;routing plugin&lt;/a&gt; providing EIP functionality for Grails be updated to work with the latest version of Grails which at the time of writing is 2.0.0.RC3. And so today the plugin has been updated to 1.1.4-SNAPSHOT with the plan to release 1.1.4 by the time Grails 2.0.0 final will be out. &lt;br /&gt;
&lt;br /&gt;
Here are the highlights of 1.1.4-SNAPSHOT:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Apache Camel core libraries updated to 2.9.0-RC1 (with the plan to upgrade to 2.9.0 final once it gets out)&lt;/li&gt;
&lt;li&gt;Apache ActiveMQ (&lt;a href="https://github.com/padcom/grails-routing-jms"&gt;routing-jms plugin&lt;/a&gt;) upgraded to 5.5.1&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Also &lt;a href="https://github.com/padcom/grails-routing-jms-example"&gt;the example project&lt;/a&gt; has undergone some extensive upgrade:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;rewrite from ground up with Grails 2.0.0.RC3 (so all the bells and whistles like resource plugin and webxml plugin are there)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/padcom/grails-routing-jms-example/commit/13125a00a293e8266e0dd021f3e70c0b68f8ebab"&gt;extended the example route with an example of processor&lt;/a&gt; that's defined as Spring bean.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
The last feature is a response to an &lt;a href="https://github.com/padcom/grails-routing/issues/4"&gt;issue posted on GitHub&lt;/a&gt; that had to do with providing access to services from processors which Camel is already capable of - it just requires some additional work but it is so not without reason.&lt;br /&gt;
&lt;br /&gt;
I hope you'll enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-4023919887530776664?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/utjnqtxu3O8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/4023919887530776664/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=4023919887530776664" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/4023919887530776664?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/4023919887530776664?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/utjnqtxu3O8/grails-routing-plugin-family-updated.html" title="Grails routing plugin family updated" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/12/grails-routing-plugin-family-updated.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUMRnYycSp7ImA9WhRRFEk.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-8921372681858917417</id><published>2011-11-28T02:21:00.000+01:00</published><updated>2011-11-28T02:21:27.899+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-28T02:21:27.899+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="grails" /><title>Grails 2.0 - the power is back</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/70L7M0uWObLju4tfesK3K_T9khA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/70L7M0uWObLju4tfesK3K_T9khA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/70L7M0uWObLju4tfesK3K_T9khA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/70L7M0uWObLju4tfesK3K_T9khA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Recently I've been bitching about the stability of Grails 2.0 and specifically the lack of it. Tons of stuff was just wrong: the new GSP parser was buggy like hell, hot-reloading using the new agent just didn't work - you name it. But with the RC1 release most of it is gone and the new version of Grails starts to look like something you could actually use!&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Hot reloading.&lt;/h2&gt;Since its early days Grails was the number one framework and that in most part due to its hot-reloading capabilities. You could just change a view, controller or service, wait just a few seconds and the result would emerge after refreshing the page. That presented a huge advantage over classic Java EE development where a single change in the code forced the developer to recompile and restart the whole application. That's why I hate regular Java EE development with a passion. Sure there's the Java Rebel thingy but it costs money - a lot of money! &lt;br /&gt;
&lt;br /&gt;
Grails 2.0 uses a different approach than the one in 1.x series but a similar one to Java Rebel. There's a Java agent that does all the heavy lifting of incorporating new code into existing application. So let's summarize what works and what doesn't:&lt;br /&gt;
&lt;br /&gt;
- reloading controller - check&lt;br /&gt;
- reloading services - check&lt;br /&gt;
- reloading url mappings definition - check (with the exception of mapping to HTTP codes)&lt;br /&gt;
- reloading domain classes - not working&lt;br /&gt;
- reloading Groovy sources under /src/groovy - check!&lt;br /&gt;
- reloading Java sources under /src/java - check!&lt;br /&gt;
&lt;br /&gt;
There might be other areas but the general impression is really awesome!&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;New scaffolding templates&lt;/h2&gt;&lt;br /&gt;
Well.. they are nice and green and dandy and... well I liked the old ones better (from the general look-and-feel point of view). The new ones still use the word "main" for everything: CSS, template and the application.js. Does anyone knows who made that stupid decision to call "main" or "application" something that should be called "scaffold"??? In the current state of things if you're thinking about doing anything serious with Grails you should install the templates and rename them to something that makes sense, like for example main.gsp -&gt; scaffold.gsp or main.css -&gt; scaffold.css. Other than that it's looking really good! Just the fricken naming...&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Resources and other capabilities&lt;/h2&gt;&lt;br /&gt;
Well, finally the resources plugin made it into the core! So from now on the problems like having lots of small JavaScript or CSS files and cramming'em together for the release version are gone. This is probably the only platform out there (besides ASP.NET :D) that does it right from the start. Granted it doesn't come for free - you need to configure it properly and it can be an unpleasant experience all along (unlike in ASP.NET where it's actually a part of the page itself). But at the end of the day it is really useful and you should use it.&lt;br /&gt;
&lt;br /&gt;
Also the &lt;code&gt;Datasources&lt;/code&gt; plugin found its sibling in the new release! This will be a blessing for everyone that needs to work with multiple databases in their Grails applications. In the databases plugin configuration was "almost" like the one you'd normally have but different enough to make you curse the creator more than once. I'm delighted to say that this has been unified and finally all datasources can be specified in the same configuration file, &lt;code&gt;DataSource.groovy&lt;/code&gt;. Yay!!!&lt;br /&gt;
&lt;br /&gt;
And last but not least - testing. Finally someone took the hard dependency on old 3.x JUnit and flushed it down the toilette! Man that was really what I was looking for. All test cases are now JUnit version independent and use the coolest Groovy feature ever: Mixins!&lt;br /&gt;
Finally testing domain classes in isolation is possible and doesn't make you puke at the &lt;code&gt;mockDomain()&lt;/code&gt; call every time you see it. Finally the power is back!&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Plugins&lt;/h2&gt;&lt;br /&gt;
I've received some notifications that the plugin architecture has change a bit and that some of my plugins (namely the json-rest-api) don't work properly. It's sad but not unexpected. The general idea is that plugin authors will have to take a good look into regression before they can 'certify' their plugins as 2.0-ready.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Summary&lt;/h2&gt;&lt;br /&gt;
The general feeling of Grails 2.0 is really great. Finally playing around with most of the UrlMappings is simple and fast (which it wasn't in 1.x), testing is fun again (even with Spock and the like) and all the rest is just great. So I guess the final message should be "go and use and forget about 1.3.7 that has been around for like ages". &lt;br /&gt;
&lt;br /&gt;
And finally I really need to get this out of my chest: when it comes to regular Java EE development like with JSF (outch), Struts or what have you one should really go kick some corporate butts to get them to start thinking again that web development shall not be a nightmare anymore. We have the technology, you know, to make it right for a change! &lt;br /&gt;
&lt;br /&gt;
Go spread the word!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-8921372681858917417?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/skPkEOLURIE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/8921372681858917417/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=8921372681858917417" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/8921372681858917417?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/8921372681858917417?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/skPkEOLURIE/grails-20-power-is-back.html" title="Grails 2.0 - the power is back" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/11/grails-20-power-is-back.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQDSXo6fCp7ImA9WhRTGEg.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-2239733014944599562</id><published>2011-11-06T22:26:00.001+01:00</published><updated>2011-11-09T15:52:58.414+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-09T15:52:58.414+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="polyglot-programming" /><title>Why using a plain-text editor is a good thing</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bxedSa6repSVuVgoVzYJm-1vjYA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bxedSa6repSVuVgoVzYJm-1vjYA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bxedSa6repSVuVgoVzYJm-1vjYA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bxedSa6repSVuVgoVzYJm-1vjYA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;For the past years there's been a boom on the market for web applications. Along with that the possibilities for supporting technologies grew like never before. This has a two-fold implication.&lt;br /&gt;
First it is imperative that we recognize the need to write less and do more - that's where the new languages come in. Second it is obvious that new languages tend to emerge a lot faster than companies would like them to and as a result the fat IDE support is missing. &lt;br /&gt;
&lt;br /&gt;
Obviously enough it's going to make for a strong case for plain-text editors (probably with some syntax highlighting like the good old vim or emacs). Those editors don't bother making deep sense of what the code really is. All they care about is that it is text.&lt;br /&gt;
&lt;br /&gt;
"But I need refactoring support to be productive" you might say. Well, refactoring in new languages tends to be a lot less tedious than in (for example) Java where changing a file name leads to all sorts of changes that need to happen just to do this simple thing. New languages like F# for example (which is not all that new if you take into account its roots) have some refactorings kind of built in into the language and most plain-text editors support it out of the box. I'm talking here about method extraction and the way the Tab key works in most modern editors on more than one line of text.&lt;br /&gt;
&lt;br /&gt;
In addition to that many new languages give you the power of succinctness never seen previously in specific areas. Take CoffeeScript or LessCSS for example. With those two new languages you can put together code in such a manner that when compared to the original language you'd write it in (JavaScript and CSS) can cause your head to explode.&lt;br /&gt;
&lt;br /&gt;
At the end of the day it is up to you if you want to write more with (for the most part) good IDE support or if you're ready to give up some of that luxury in favor of more readable and less error prone code. But remember: the less code you have the less bugs you're going to have and that alone should make you want try out the latest inventions.&lt;br /&gt;
&lt;br /&gt;
Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-2239733014944599562?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/NEEZXVAuGB4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/2239733014944599562/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=2239733014944599562" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/2239733014944599562?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/2239733014944599562?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/NEEZXVAuGB4/why-using-plain-text-editor-is-good.html" title="Why using a plain-text editor is a good thing" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/11/why-using-plain-text-editor-is-good.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4EQHc6fip7ImA9WhdaF0w.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-1722645404654280438</id><published>2011-10-16T19:05:00.003+02:00</published><updated>2011-10-27T12:55:01.916+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-27T12:55:01.916+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hazelcast" /><category scheme="http://www.blogger.com/atom/ns#" term="grails" /><title>Hazelcast and Grails</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5Vh-pwEXR90L7L5kvRpITzxBChA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5Vh-pwEXR90L7L5kvRpITzxBChA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5Vh-pwEXR90L7L5kvRpITzxBChA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5Vh-pwEXR90L7L5kvRpITzxBChA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;If you'll ever find yourself in need to partition your Grails application in order to provide high or availability or if you're lucky enough in order to increase processing power because your database is already not the bottleneck (which it will be for a long long time) then you should definitely check out &lt;a href="http://www.hazelcast.com/index.jsp"&gt;Hazelcast&lt;/a&gt; and its &lt;a href="http://www.hazelcast.com/docs/1.9.4/manual/multi_html/ch08.html"&gt;Hazelcast WM&lt;/a&gt; module. Configuration is dead simple (a few lines in web.xml) and the thing is capable of auto discovery  using multicast so you just add instances of both the Hazelcast distributed cache as well as instances of your application and everything just works.&lt;br /&gt;
&lt;br /&gt;
Man, it's been a while since I found a tool that just does the job no questions asked and Hazelcast definitely is one of them!&lt;br /&gt;
&lt;br /&gt;
And live is good again :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-1722645404654280438?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/lcdTei7Ba_w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/1722645404654280438/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=1722645404654280438" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/1722645404654280438?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/1722645404654280438?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/lcdTei7Ba_w/hazelcast-and-grails.html" title="Hazelcast and Grails" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/10/hazelcast-and-grails.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQGSHo6fip7ImA9WhdbF0s.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-4865359841305723939</id><published>2011-10-16T12:52:00.000+02:00</published><updated>2011-10-16T12:52:09.416+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-16T12:52:09.416+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="maven" /><title>Creating standalone applications with Java and Maven</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tcGT8CfLe2RsxBo1QHnGvoR7guI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tcGT8CfLe2RsxBo1QHnGvoR7guI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tcGT8CfLe2RsxBo1QHnGvoR7guI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tcGT8CfLe2RsxBo1QHnGvoR7guI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;h2&gt;The challenge&lt;/h2&gt;In this installment we're going to take a look at what does it take to create a standalone Java application that's a little bit more sophisticated than the famous Hello, World. Let's start with the simplest example:&lt;pre&gt;&lt;code&gt;package org.example;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}&lt;/code&gt;&lt;/pre&gt;To compile and run this one we need to invoke the &lt;code&gt;javac&lt;/code&gt; compiler, package it to some jar file (say &lt;code&gt;example.jar&lt;/code&gt;), create a manifest file (or not..) and start the application passing on the proper classpath and class name that is the entry point to our application. This might look something like this:&lt;pre&gt;&lt;code&gt;java -cp . org.example.Main&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;The "proper" way&lt;/h2&gt;I know for a fact that Maven can be a pain in the ass if used by some inexperienced fellow that wanted it to do everything but didn't know how to ask for it. For example for tasks that Maven is good at like specifying dependencies using Ivy and Ant for it makes no sense, right? Well, you wish! I've seen those kind of nonsense a lot of time with &lt;code&gt;pom.xml&lt;/code&gt; reaching out beyond the magic 100k boundary... &lt;br/&gt;&lt;br /&gt;
Instead of cranking up the heat I'd like to see people develop simple mojos solving one problem at a time and not resorting to ant or anything like it. But above all, for crying out loud, use what's already there to do the job!&lt;br/&gt;&lt;br /&gt;
&lt;h2&gt;Doing Spring in standalone Java application&lt;/h2&gt;If you can imagine how hard would it be to prepare a standalone Java application that uses external configuration, external libraries and resembles what users are already used to (the bin folder, the lib folder, maybe some conf or etc for the configuration files) you'll appreciate the fine job application assembler is going to do for you.&lt;pre&gt;&lt;code&gt;
&amp;lt;plugin&amp;gt;
    &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;appassembler-maven-plugin&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;1.1.1&amp;lt;/version&amp;gt;
    &amp;lt;configuration&amp;gt;
        &amp;lt;copyConfigurationDirectory&amp;gt;true&amp;lt;/copyConfigurationDirectory&amp;gt;
        &amp;lt;configurationDirectory&amp;gt;etc&amp;lt;/configurationDirectory&amp;gt;
        &amp;lt;repositoryName&amp;gt;lib&amp;lt;/repositoryName&amp;gt;
        &amp;lt;repositoryLayout&amp;gt;flat&amp;lt;/repositoryLayout&amp;gt;
        &amp;lt;programs&amp;gt;
            &amp;lt;program&amp;gt;
                &amp;lt;mainClass&amp;gt;org.example.Main&amp;lt;/mainClass&amp;gt;
                &amp;lt;name&amp;gt;example&amp;lt;/name&amp;gt;
            &amp;lt;/program&amp;gt;
        &amp;lt;/programs&amp;gt;
    &amp;lt;/configuration&amp;gt;
&amp;lt;/plugin&amp;gt;&lt;/code&gt;&lt;/pre&gt;That's pretty much it! All you have to do now is to call maven to do your bidding.&lt;pre&gt;&lt;code&gt;mvn clean package appassembler:assemble&lt;/code&gt;&lt;/pre&gt;Please note I didn't change anything in the application itself. Well that's because it's not a post about how to instantiate Spring in a console application but rather how to package everything so that it works as expected. You can take a look at a fully working example on &lt;a href="http://github.com/padcom/spring-example"&gt;GitHub&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-4865359841305723939?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/2nhlnmmohfo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/4865359841305723939/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=4865359841305723939" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/4865359841305723939?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/4865359841305723939?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/2nhlnmmohfo/creating-standalone-applications-with.html" title="Creating standalone applications with Java and Maven" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/10/creating-standalone-applications-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUCSXY4eCp7ImA9WhdbEUw.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-4722770707437667903</id><published>2011-10-08T13:00:00.000+02:00</published><updated>2011-10-08T23:44:28.830+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-08T23:44:28.830+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><title>Eclipse hint: Aptana Studio</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WYtvzSm1YygV6omLwKf1r_2cVys/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WYtvzSm1YygV6omLwKf1r_2cVys/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WYtvzSm1YygV6omLwKf1r_2cVys/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WYtvzSm1YygV6omLwKf1r_2cVys/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I know I wrote the other day that I don't use Eclipse and I don't when working with anything else that Java. You just can't get away editing Java code on any serious level in any plain-text editor because the language is not designed to do it (like Groovy or Ruby for example). Recently I've been doing some research on what's available out there in terms of plugins and I've stumbled upon Aptana Studio. Even though I don't plan to code in Ruby any time soon I've decided to install it and give it a try.&lt;br/&gt;&lt;br/&gt;
All things considered I have found the one piece of that "studio" that has convinced me that working with Eclipse might be fun: the Terminal window :)&lt;br/&gt;&lt;br/&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://aptana.com/images/product/S3-4-lrg.png" imageanchor="1" style=""&gt;&lt;img border="0" height="383" width="585" src="http://aptana.com/images/product/S3-4-lrg.png" /&gt;&lt;/a&gt;&lt;/div&gt;


&lt;br/&gt;&lt;br/&gt;
Imagine you're working with your project and all of the sudden you need to do some command-line processing (for whatever reason). With Aptana Studio it's extremely easy: you just right click on a node in project explorer or package explorer and select Open in -&gt; Terminal :D&lt;br/&gt;&lt;br/&gt;
Man I like those little discoveries that make my life easier...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-4722770707437667903?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/iHxQR_dd4MM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/4722770707437667903/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=4722770707437667903" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/4722770707437667903?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/4722770707437667903?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/iHxQR_dd4MM/eclipse-hint-aptana-studio.html" title="Eclipse hint: Aptana Studio" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/10/eclipse-hint-aptana-studio.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEFR3cyfip7ImA9WhdbEEw.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-5007132277680446623</id><published>2011-10-06T22:14:00.002+02:00</published><updated>2011-10-07T21:43:36.996+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-07T21:43:36.996+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="git" /><title>Gitorious - a working guide to install</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QZh-12JjO8tQn7y6YWcTisQ12eU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QZh-12JjO8tQn7y6YWcTisQ12eU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QZh-12JjO8tQn7y6YWcTisQ12eU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QZh-12JjO8tQn7y6YWcTisQ12eU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Finally someone did a guide on installing Gitorious on Ubuntu 11.04 and it WORKS!!! 
&lt;br/&gt;&lt;br/&gt;
Go check it out at &lt;a href="http://coding-journal.com/installing-gitorious-on-ubuntu-11-04/"&gt;http://coding-journal.com/installing-gitorious-on-ubuntu-11-04/&lt;/a&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-5007132277680446623?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/FD6P0xfzuT0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/5007132277680446623/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=5007132277680446623" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/5007132277680446623?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/5007132277680446623?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/FD6P0xfzuT0/gitorious-working-guide-to-install.html" title="Gitorious - a working guide to install" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/10/gitorious-working-guide-to-install.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUICR3s8eyp7ImA9WhdUFU0.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-847233792304163696</id><published>2011-10-01T23:03:00.000+02:00</published><updated>2011-10-01T23:12:46.573+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-01T23:12:46.573+02:00</app:edited><title>Using DWR with JBoss and EJBs</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QQIHw-VHn1lnn3qLXj8f28E5j2I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QQIHw-VHn1lnn3qLXj8f28E5j2I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QQIHw-VHn1lnn3qLXj8f28E5j2I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QQIHw-VHn1lnn3qLXj8f28E5j2I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Today we're going to get our hands dirty with the Direct Web Remoting (DWR) library in conjunction with JBoss and the EJB mechanism.
&lt;br/&gt;&lt;br/&gt;
&lt;h2&gt;The why&lt;/h2&gt;
DWR is a powerful library for all things related to remote method calls using HTTP. It can serialize lots of things, use DTOs if provided but above all it does one thing so easy it should be forbidden: It allows you to create or retrieve an instance and call its method directly from your JavaScript. This is why I'll always favor DWR over hand-written mechanisms or misuse of REST libraries like RESTfully. REST is all about resources - Ajax not necessarily...
&lt;br/&gt;&lt;br/&gt;
&lt;h2&gt;The how&lt;/h2&gt;
We're going to use DWR version 3.0.M1 as this is the latest available in Maven repository at the time of writing. Creating the project itself is outside of the scope of this post however configuring the framework isn't so we're start with that.
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;web.xml&lt;/h3&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;!DOCTYPE web-app PUBLIC
  &amp;quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&amp;quot;
  &amp;quot;http://java.sun.com/dtd/web-app_2_3.dtd&amp;quot; &amp;gt;

&amp;lt;web-app&amp;gt;
  &amp;lt;servlet&amp;gt;
    &amp;lt;servlet-name&amp;gt;dwr&amp;lt;/servlet-name&amp;gt;
    &amp;lt;servlet-class&amp;gt;org.directwebremoting.servlet.DwrServlet&amp;lt;/servlet-class&amp;gt;
    &amp;lt;init-param&amp;gt;
      &amp;lt;param-name&amp;gt;debug&amp;lt;/param-name&amp;gt;
      &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;
    &amp;lt;/init-param&amp;gt;
  &amp;lt;/servlet&amp;gt;
  &amp;lt;servlet-mapping&amp;gt;
    &amp;lt;servlet-name&amp;gt;dwr&amp;lt;/servlet-name&amp;gt;
    &amp;lt;url-pattern&amp;gt;/dwr/*&amp;lt;/url-pattern&amp;gt;
  &amp;lt;/servlet-mapping&amp;gt;
&amp;lt;/web-app&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
As you can see here this is pretty much the basic that you'd expect from a web application that has one servlet in it. The other stuff will be done using a HTML page and a stateless local bean so let's get on with it.
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;&lt;code&gt;Service&lt;/code&gt; interface and &lt;code&gt;ServiceBean&lt;/code&gt; implementation&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;package com.aplaline.example.ejb;

import javax.ejb.Local;

@Local
public interface Service {
	String action();
}
&lt;/code&gt;&lt;/pre&gt;

Nothing fancy here - let's move on to the implementation:
&lt;pre&gt;&lt;code&gt;package com.aplaline.example.ejb.impl;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.aplaline.example.ejb.Service;

@Stateless(mappedName="ServiceBean")
public class ServiceBean implements Service {
	@Override
	public String action() {
		return "Hello, world! from EJB!";
	}
}
&lt;/code&gt;&lt;/pre&gt;
Again... absolutely nothing fancy here - standard Hello, world! style bean. Let's see how we can configure DWR to serve the &lt;code&gt;Service.action()&lt;/code&gt; method...
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;&lt;code&gt;dwr.xml&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;!DOCTYPE dwr PUBLIC
    &amp;quot;-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN&amp;quot;
    &amp;quot;http://directwebremoting.org/dwr/dwr30.dtd&amp;quot;&amp;gt;

&amp;lt;dwr&amp;gt;
  &amp;lt;init&amp;gt;
    &amp;lt;creator id=&amp;quot;ejb3&amp;quot; class=&amp;quot;com.aplaline.dwr.Ejb3Creator&amp;quot; /&amp;gt;
  &amp;lt;/init&amp;gt;
  &amp;lt;allow&amp;gt;
    &amp;lt;create creator=&amp;quot;ejb3&amp;quot; javascript=&amp;quot;ServiceBean&amp;quot;&amp;gt;
      &amp;lt;param name=&amp;quot;bean&amp;quot; value=&amp;quot;ear/ServiceBean/local&amp;quot; /&amp;gt;
    &amp;lt;param name=&amp;quot;interface&amp;quot; value=&amp;quot;com.aplaline.example.ejb.Service&amp;quot;/&amp;gt;
    &amp;lt;/create&amp;gt;
  &amp;lt;/allow&amp;gt;
&amp;lt;/dwr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
Now that's the meat I'm talking about! Let's get a closer look at what's in there:
&lt;br/&gt;&lt;br/&gt;
&lt;h4&gt;The &lt;code&gt;creator&lt;/code&gt;&lt;/h4&gt;&lt;br/&gt;
The creator class originally coming from DWR is best suited for other J2EE containers but it has a huge issue with JBoss so we're implementing our own, JBoss-friendly one:
&lt;pre&gt;&lt;code&gt;package com.aplaline.dwr;

import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import org.directwebremoting.create.AbstractCreator;
import org.directwebremoting.extend.Creator;
import org.directwebremoting.util.LocalUtil;
import org.directwebremoting.util.Messages;

public class Ejb3Creator extends AbstractCreator implements Creator {
  private String bean = "";
  private String interfaceClass = "";
  
  public void setBean(String bean) {
    this.bean = bean;
  }

  public void setInterface(String interfaceClass) {
    this.interfaceClass = interfaceClass;
  }

  @Override
  public Class&lt;?&gt; getType() {
    try {
      return LocalUtil.classForName(interfaceClass);
    } catch (ClassNotFoundException ex) {
      throw new IllegalArgumentException(
          Messages.getString("Creator.BeanClassNotFound", interfaceClass)
      );
    }
  }

  public Object getInstance() throws InstantiationException {
    Context jndi = null;

    try {
      Properties props = new Properties();
      props.load(getClass().getResourceAsStream("/jndi.properties"));
      jndi = new InitialContext(props);
      return jndi.lookup(bean);
    } catch (Exception ex) {
      throw new InstantiationException(bean + " not bound:" + ex.getMessage());
    } finally {
      if (jndi != null) {
        try {
          jndi.close();
        } catch (NamingException ex) {
          // Ignore
        }
      }
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
What it does is it allows you to specify the interface class as well as full bean name as depicted in the &lt;code&gt;dwr.xml&lt;/code&gt; example above.
&lt;br/&gt;&lt;br/&gt;
&lt;h4&gt;The &lt;code&gt;create&lt;/code&gt;&lt;/h4&gt;&lt;br/&gt;
In here we're specifying all the bits and pieces needed for the framework later on to create JavaScript proxy and identify our bean when the time comes. This is the time to see how we can use it, shall we?
&lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;The &lt;code&gt;index.html&lt;/code&gt;&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;title&amp;gt;Example&amp;lt;/title&amp;gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/dwr/dwr/interface/ServiceBean.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/dwr/dwr/engine.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    $(document).ready(function() {
      ServiceBean.action(function(response) {
        $(&amp;quot;#output&amp;quot;).append(&amp;quot;&amp;lt;p&amp;gt;&amp;quot; + response + &amp;quot;&amp;lt;/p&amp;gt;&amp;quot;);
      });
    });
  &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
  &amp;lt;h1&amp;gt;Example&amp;lt;/h1&amp;gt;
  &amp;lt;div id=&amp;quot;output&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
This needs a word or two of explanation. At first we're including a JavaScript proxy class that will serve as a mediator between JavaScript and the server side. Then there's the required engine.js inclusion. This includes all the bits and pieces of client side DWR. Then we're including jQuery from Google CDN because I hate to re-get the library over and over again. Then there's the most interesting part - the usage: The &lt;code&gt;ServiceBean&lt;/code&gt; object is created by inclusion of the &lt;code&gt;ServiceBean.js&lt;/code&gt; resource. It automatically has a action method that takes all the parameters as the server-side counterpart would (none in this example) and as the last parameter there's a callback to execute after the response is returned. Pretty simple, right?
&lt;br/&gt;&lt;br/&gt;
&lt;h2&gt;Bottom line&lt;/h2&gt;
If you'll ever find yourself in need to call some EJB (or Spring or Guice) managed instances from JavaScript you should seriously consider using DWR as it makes life a lot easier.
&lt;br/&gt;&lt;br/&gt;
As always &lt;a href="http://www.aplaline.com/files/dwr-example.zip"&gt;here is a ready-to-use example&lt;/a&gt; for you to check out (tested with JBoss 4.2.3). 
&lt;br&gt;&lt;br/&gt;
&lt;em&gt;I've been using it from within Eclipse thus the name of EAR is "ear" (and thus the JNDI name of the EJB starts with "ear/"). If you run it from command line please update the name accordingly before use!&lt;/em&gt;
&lt;br/&gt;&lt;br/&gt;
Have fun!
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-847233792304163696?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/beDJtinohyc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/847233792304163696/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=847233792304163696" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/847233792304163696?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/847233792304163696?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/beDJtinohyc/using-dwr-with-jboss-and-ejbs.html" title="Using DWR with JBoss and EJBs" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/10/using-dwr-with-jboss-and-ejbs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QNSXw_fyp7ImA9WhdUEk4.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-4834743502273173094</id><published>2011-09-28T20:58:00.000+02:00</published><updated>2011-09-28T21:49:58.247+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-28T21:49:58.247+02:00</app:edited><title>What the hell is wrong with collections API in Java?!</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YQEte_d6JBYZ4t86NPSwVDRc5Tk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YQEte_d6JBYZ4t86NPSwVDRc5Tk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YQEte_d6JBYZ4t86NPSwVDRc5Tk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YQEte_d6JBYZ4t86NPSwVDRc5Tk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Today is the day when steam came out of my ears and I started screaming "WTF?!?!". So what's wrong? Let me explain...
&lt;br/&gt;&lt;br/&gt;
&lt;h1&gt;The good part&lt;/h1&gt;
I came to &lt;em&gt;pure&lt;/em&gt; Java from Groovy. I never liked Java as a language in particular (I'd even go as far as "I hated it with a passion") but life is life and I've had to put my hands into the dirty world of legacy Java code once again. Being the Groovy fan for quite some time now tough me that functional programming style is something that makes your life easier and the code itself a lot more readable. That's especially true in regards to collections!
&lt;br/&gt;&lt;br/&gt;
I don't want to bring up obvious examples like sorting a collection using spaceship operator or something along those lines. That's been done to death. Instead I'm going to tell you a story...
&lt;br/&gt;&lt;br/&gt;
&lt;h1&gt;The story so far...&lt;/h1&gt;
Back in the days there have been collections and a handful of utilities to back up the bare collection objects (&lt;code&gt;java.util.Collections&lt;/code&gt;). At some point people saw that what the creators of Java the runtime library gave them to play around was not enough so they invented commons-collections. And life was good again because we could do things easily that were cumbersome before. That was in the pre-1.5 days so no generics were involved as you might imagine. That in turn forced the developer to do idiotic type casts from Object to the respective type when implementing for example a &lt;code&gt;Transformer&lt;/code&gt;.
&lt;br/&gt;
After a while Java the language 1.5 came to existence so people sat there and wondered how we can make the best out of it. This is how commons-generic came to be: The same set of utilities but with generic parameters so you can avoid doing silly casts. That must have been a brilliant idea, you might wonder... But as it turns out the compatibility is virtually non-existent so you can stick it up a$$ since everyone else is using the old commons-collection anyways...
&lt;br/&gt;
If that wouldn't ring any bells yet not so long ago Google came up with yet another professional and good looking collections library, the google-collections project later on included into google-guava. Yet again the same stuff happened: separate predicate definitions, mapping functions - you name it!
&lt;br/&gt;&lt;br/&gt;
&lt;h1&gt;Groovy the savier&lt;/h1&gt;
I know you're going to say that Groovy is a dynamic language and I should back off of Java and not compare apples and oranges together. But then wouldn't it be at least sane to allow some classes/interfaces to be extended in some way? Like they do it in C# or VB using extension methods... Oh and btw. if you're saying that they will be in version 8 I rush to explain that C# had them from 3.0 which is not so far away from Java 1.5 as far as I can remember...
&lt;br/&gt;
So back to Groovy... If you want to transform some list of objects into another list of objects you have the all mighty &lt;code&gt;collect&lt;/code&gt; method that does exactly what you need. If you want to extract just a single property from all instances in collection you just type for example &lt;code&gt;people.firstName&lt;/code&gt; and that's it. It's really simple...
&lt;br/&gt;&lt;br/&gt;
&lt;h1&gt;But there we are... in Java&lt;/h1&gt;
If you'd like to make use of your code in all the fancy collection utilities hyper super duper tools you'll have to create your own version of the predicates/mapping functions (to be on the safe side, of course) and then create tons of adapters just to satisfy the compiler and the ever growing egos of collection utilities libraries creators.
&lt;br/&gt;&lt;br/&gt;
Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-4834743502273173094?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/7hGCW5jnGlg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/4834743502273173094/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=4834743502273173094" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/4834743502273173094?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/4834743502273173094?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/7hGCW5jnGlg/what-hell-is-wrong-with-collections-api.html" title="What the hell is wrong with collections API in Java?!" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/09/what-hell-is-wrong-with-collections-api.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMERnY8eCp7ImA9WhdVF0Q.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-957890177235817084</id><published>2011-09-23T18:55:00.000+02:00</published><updated>2011-09-23T19:03:27.870+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-23T19:03:27.870+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="cors" /><title>CORS filter for Java applications</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UhD63qMknJn_GxlQRNUEztk-mUc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UhD63qMknJn_GxlQRNUEztk-mUc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UhD63qMknJn_GxlQRNUEztk-mUc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UhD63qMknJn_GxlQRNUEztk-mUc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Hi there,

in today's installment we're going to allow Ajax calls from other domains to be answered and accepted by browsers. 
&lt;br/&gt;&lt;br/&gt;
&lt;h1&gt;The what&lt;/h1&gt;
This thing (completely forgotten by many) is called Cross Origin Resource Sharing and works with standard Ajax requests your browser can send. You can read about it in depth on &lt;a href="http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing"&gt;Wikipedia&lt;/a&gt; or on the &lt;a href="http://enable-cors.org/"&gt;http://enable-cors.org/&lt;/a&gt; site.
&lt;br/&gt;&lt;br/&gt;
&lt;h1&gt;The how&lt;/h1&gt;
Let's get to the meat - shall we? On the &lt;a href="http://enable-cors.org/"&gt;http://enable-cors.org/&lt;/a&gt; site there are many recipes for all kind of servers and they respective configuration but what if you'd like to enable CORS just for a part of your application? If you're lucky enough and you're coding your application in Java then there is a standard mechanism to do just that! It's called filters.&lt;br/&gt;
Here's the most simple way of implementing CORS response headers:&lt;pre&gt;&lt;code&gt;import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class CORSFilter implements Filter {

	public CORSFilter() { }

	public void init(FilterConfig fConfig) throws ServletException { }

	public void destroy() {	}

	public void doFilter(
		ServletRequest request, ServletResponse response, 
		FilterChain chain) throws IOException, ServletException {

		((HttpServletResponse)response).addHeader(
			"Access-Control-Allow-Origin", "*"
		);
		chain.doFilter(request, response);
	}
}&lt;/code&gt;&lt;/pre&gt;
As you can see here all we're doing is adding the &lt;code&gt;Access-Control-Allow-Origin&lt;/code&gt; header so that the browser can accept the response sent by server.&lt;br/&gt;&lt;br/&gt;
You can use this filter as follows in your &lt;code&gt;web.xml&lt;/code&gt;:&lt;pre&gt;&lt;code&gt;&amp;lt;web-app&amp;gt;
	&amp;lt;filter&amp;gt;
		&amp;lt;filter-name&amp;gt;CORSFilter&amp;lt;/filter-name&amp;gt;
		&amp;lt;filter-class&amp;gt;CORSFilter&amp;lt;/filter-class&amp;gt;
	&amp;lt;/filter&amp;gt;
	&amp;lt;filter-mapping&amp;gt;
		&amp;lt;filter-name&amp;gt;CORSFilter&amp;lt;/filter-name&amp;gt;
		&amp;lt;url-pattern&amp;gt;/api/*&amp;lt;/url-pattern&amp;gt;
	&amp;lt;/filter-mapping&amp;gt;
&amp;lt;/web-app&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br/&gt;
Have fun!

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-957890177235817084?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/KerP0GzqwE0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/957890177235817084/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=957890177235817084" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/957890177235817084?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/957890177235817084?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/KerP0GzqwE0/cors-filter-for-java-applications.html" title="CORS filter for Java applications" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/09/cors-filter-for-java-applications.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QBRHo5eCp7ImA9WhdVFko.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-5183892623163593791</id><published>2011-09-21T23:32:00.000+02:00</published><updated>2011-09-22T08:02:35.420+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-22T08:02:35.420+02:00</app:edited><title>Using JRebel from pure Maven in a web application</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uOZX7n31LT0ckaRa5YUYy-rkfYI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uOZX7n31LT0ckaRa5YUYy-rkfYI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uOZX7n31LT0ckaRa5YUYy-rkfYI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uOZX7n31LT0ckaRa5YUYy-rkfYI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Hi there folks!&lt;br/&gt;&lt;br/&gt;

I'm sure you've read every bit and piece about how to bend Maven to do your bidding. This time I'm most probably going to duplicate a lot of stuff found on other sites but I'm simply sick and tired of looking it up every single time I need it. We're going to configure a Maven web application project to run under Jetty (mvn jetty:run) with JRebel to do the reloading.

So let's get started!&lt;br/&gt;&lt;br/&gt;

&lt;h2&gt;Installing Maven and JRebel&lt;/h2&gt;
That one is a no brainer but for the sake of completeness I list this particular step here as well. 
&lt;br/&gt;&lt;br/&gt;
&lt;h2&gt;The &lt;code&gt;pom.xml&lt;/code&gt;&lt;/h2&gt;
The &lt;code&gt;pom.xml&lt;/code&gt; file we're going to use looks like this:&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;project xmlns=&amp;quot;http://maven.apache.org/POM/4.0.0&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xsi:schemaLocation=&amp;quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&amp;quot;&amp;gt;

  &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;

  &amp;lt;groupId&amp;gt;org.example&amp;lt;/groupId&amp;gt;
  &amp;lt;artifactId&amp;gt;war&amp;lt;/artifactId&amp;gt;
  &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;
  &amp;lt;packaging&amp;gt;war&amp;lt;/packaging&amp;gt;

  &amp;lt;name&amp;gt;Example Web application&amp;lt;/name&amp;gt;

  &amp;lt;properties&amp;gt;
    &amp;lt;!-- stop stuppid Maven message about build being platform-dependant --&amp;gt;
    &amp;lt;project.build.sourceEncoding&amp;gt;UTF-8&amp;lt;/project.build.sourceEncoding&amp;gt;
  &amp;lt;/properties&amp;gt;

  &amp;lt;build&amp;gt;
    &amp;lt;plugins&amp;gt;
      &amp;lt;!-- make sure we&amp;#39;re using Java 1.6 and not some stone age version --&amp;gt;
      &amp;lt;plugin&amp;gt;
        &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;configuration&amp;gt;
          &amp;lt;source&amp;gt;1.6&amp;lt;/source&amp;gt;
          &amp;lt;target&amp;gt;1.6&amp;lt;/target&amp;gt;
        &amp;lt;/configuration&amp;gt;
      &amp;lt;/plugin&amp;gt;
      &amp;lt;!-- enable jetty:run mojo --&amp;gt;
      &amp;lt;plugin&amp;gt;
        &amp;lt;groupId&amp;gt;org.mortbay.jetty&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;jetty-maven-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;configuration&amp;gt;
          &amp;lt;scanIntervalSeconds&amp;gt;0&amp;lt;/scanIntervalSeconds&amp;gt;
        &amp;lt;/configuration&amp;gt;
      &amp;lt;/plugin&amp;gt;
      &amp;lt;!-- enable generation of jrebel.xml - needed for the agent --&amp;gt;
      &amp;lt;plugin&amp;gt;
        &amp;lt;groupId&amp;gt;org.zeroturnaround&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;jrebel-maven-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;executions&amp;gt;
          &amp;lt;execution&amp;gt;
            &amp;lt;id&amp;gt;generate-rebel-xml&amp;lt;/id&amp;gt;
            &amp;lt;phase&amp;gt;process-resources&amp;lt;/phase&amp;gt;
            &amp;lt;goals&amp;gt;
              &amp;lt;goal&amp;gt;generate&amp;lt;/goal&amp;gt;
            &amp;lt;/goals&amp;gt;
          &amp;lt;/execution&amp;gt;
        &amp;lt;/executions&amp;gt;
      &amp;lt;/plugin&amp;gt;
    &amp;lt;/plugins&amp;gt;
  &amp;lt;/build&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br/&gt;
&lt;h2&gt;Running Maven with JRebel&lt;/h2&gt;
You need to specify the &lt;code&gt;javaagent&lt;/code&gt; as JRebel in order for the class-reloading to work. You do that by extending the environment variable &lt;code&gt;MAVEN_OPTS&lt;/code&gt; with the following:

&lt;pre&gt;&lt;code&gt;set MAVEN_OPTS=-javaagent:C:\progra~1\ZeroTurnaround\JRebel\jrebel.jar %MAVEN_OPTS%&lt;/code&gt;&lt;/pre&gt;
 
With that in place run &lt;code&gt;mvn jetty:run&lt;/code&gt; or &lt;code&gt;mvn tomcat:run&lt;/code&gt; and you're all set! 
&lt;br/&gt;&lt;br/&gt;
&lt;h2&gt;Doing reloading&lt;/h2&gt;
Please bare in mind that Maven is not Eclipse! When you save a file it doesn't automatically recompile it so in order for the modified class to be reloaded you need to recompile the project using &lt;code&gt;mvn compile&lt;/code&gt;! &lt;br/&gt;&lt;br/&gt;

Well that pretty much summarizes it. It's not very difficult to setup as you see here but there are steps that are not described all in one place so here it is for your entertainment :)
&lt;br/&gt;&lt;br/&gt;
Have fun! 
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-5183892623163593791?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/K72VtTHQjbg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/5183892623163593791/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=5183892623163593791" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/5183892623163593791?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/5183892623163593791?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/K72VtTHQjbg/using-jrebel-from-pure-maven-in-web.html" title="Using JRebel from pure Maven in a web application" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/09/using-jrebel-from-pure-maven-in-web.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0INSXc6fSp7ImA9WhdVE0k.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-8341108273361291762</id><published>2011-09-18T13:26:00.003+02:00</published><updated>2011-09-18T13:33:18.915+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-18T13:33:18.915+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="groovy" /><title>Java 6 has a web server inside!</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/e1JXwzJonb_CBQ3mMbb8QQxGI7M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/e1JXwzJonb_CBQ3mMbb8QQxGI7M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/e1JXwzJonb_CBQ3mMbb8QQxGI7M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/e1JXwzJonb_CBQ3mMbb8QQxGI7M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;h1&gt;The what&lt;/h1&gt;I'm into miniaturization - anyone who knows me also knows as much. Probably because I'm not very tall for today's standards but mostly due to the sole nature of small things: they are easy to figure out. For example getting to understand every bit and piece of the whole car (whatever brand) is impossible. In many cases no one would even allow you to go that far. But having a deep understanding how manual shift gear box works shouldn't be a problem for moderately intelligent person...  The exact same principle adheres to software development as far as I am concerned. I like small parts I can grasp in short amount of time and have it used right after the learning process knowing what the hell I'm doing. You might think about it in terms of components of a desktop application, a JavaScript library for dynamic web pages or (as I've found out today) in terms of a small set of classes that do exactly what they are supposed to do and you can have them do their thing in a matter of minutes. I'm obviously (as the title suggests) talking here about the embedded web server found in the &lt;code&gt;com.sun.net.httpserver&lt;/code&gt; package.  &lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;The how&lt;/h1&gt;Besides being fixated on miniaturization I'm also a Groovy freak as I thing this is the best language for JVM ever created and there's nobody to convince me otherwise :D For that very reason the following example showing a miniature web application with embedded web server is a Groovy script:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;import com.sun.net.httpserver.*

class ExampleHandler implements HttpHandler {
	void handle(HttpExchange exchange) throws IOException {
		def response = "Hello, world!"

		exchange.sendResponseHeaders(200, response.length());
		def outout = exchange.responseBody
		outout.write(response.bytes);
		outout.close();
	}
}

public class ExampleAuthenticator extends BasicAuthenticator {
	static users = [ "john": "john123" ]
 
	public ExampleAuthenticator(String realm) {
		super(realm);
	}

	@Override
	public boolean checkCredentials(String username, String password) {
		return users[username] == password;
	}
}

def server = HttpServer.create(new InetSocketAddress(8000), 0);
def context = server.createContext("/example", new ExampleHandler());
context.authenticator = new ExampleAuthenticator("Example application")
server.executor = null
server.start();&lt;/code&gt;&lt;/pre&gt;Let's start from the beginning...  &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The &lt;code&gt;ExampleHandler&lt;/code&gt; class&lt;/h2&gt;This particular class is responsible for generating all the output sent later on to the server. As you can see it's a very minimalistic thing here, even to the point where the body needs to know how big it actually is. The line &lt;code&gt;Exchange.sendResponseHeaders(...)&lt;/code&gt; shows that. The rest is pretty self explanatory so I'm not going to drill into it.  &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The &lt;code&gt;ExampleAuthenticator&lt;/code&gt; class&lt;/h2&gt;This class provides basic authentication for our small application. It's so damn easy anyone will understand it right away but for the sake of clarity here's the bottom line: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Every credential is stored in the &lt;code&gt;static users=[:]&lt;/code&gt; map&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h2&gt;The meat&lt;/h2&gt;Now we have finally come to the good part! The actual use of HttpServer. Here you see how the server is created using a factory method (&lt;code&gt;HttpServer.create&lt;/code&gt;) that takes an &lt;code&gt;InetSocketAddress&lt;/code&gt; and some other argument I didn't drill down to just yet and gives you back an HttpServer instance ready to work. That instance does pretty much nothing so far other than a response 404 for everything you ask. To change that we create a new application context (very similar to the one found in a Servlet container) and register it under a specific path on that server. In the next line we tell the context that it is guarded by basic authentication - that's my favorite :) - and we're almost all set. The last thing is to (for whatever reason) assign an empty executor that in turn is supposed to have a side effect in the sense that a default executor will be assigned instead. That's weird...  &lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;The outcome&lt;/h1&gt;In 32 lines we've created a dynamic web application with authentication - ready to conquer the world! That's maybe a lot more than Sinatra or Spark but still - it's something worth knowing about. If you'd like you can utilize it directly from Java and it is still not a lot more code than what's seen here! &lt;br /&gt;
&lt;br /&gt;
Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-8341108273361291762?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/M2jzWArfkZg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/8341108273361291762/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=8341108273361291762" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/8341108273361291762?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/8341108273361291762?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/M2jzWArfkZg/java-6-has-web-server-inside.html" title="Java 6 has a web server inside!" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/09/java-6-has-web-server-inside.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcAQH0-cSp7ImA9WhdWGUk.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-2663117317286517814</id><published>2011-09-13T20:42:00.005+02:00</published><updated>2011-09-13T20:54:01.359+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-13T20:54:01.359+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pico" /><title>How I wrote my own version control system</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-LA81Qp_S4BOHcTikCkEZf2ORnQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-LA81Qp_S4BOHcTikCkEZf2ORnQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-LA81Qp_S4BOHcTikCkEZf2ORnQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-LA81Qp_S4BOHcTikCkEZf2ORnQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;This is what happens when people have too much spare time traveling from home to work and back 6 hours a day... They create useless software that allows them to pass the time.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The idea&lt;/h2&gt;The idea was to create something that'll be astonishing, maybe not new but great in functionality and to do it in Groovy. I thought what the hell - why not write your own version control system :) Let's call it &lt;code&gt;pico&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The credits&lt;/h2&gt;The piece is 100% cloned in idea (and most of the solution as well) from The All Mighty And Only True Version control system - meaning Git.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;What's it doing?&lt;/h2&gt;For now it is really simple: it can commit with a message (the user interface is sooooo cruel - need to work on it a bit), dump a sophisticated log and checkout the latest version. It's faaaaaaar from being complete and most probably it'll never get where Git is today but hey - that's what passing time means :D&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;But....&lt;/h2&gt;It does what it does and is written in Groovy! Granted that I can do better but trust me coming up with a working solution like that in less than 3 hours on a train was my point here - not the beautiful code :) The latter one is due some time in the future to fill the time...&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The code&lt;/h2&gt;You can find the code as well as a batch file (yes, I am a Windows freak) &lt;a href="https://github.com/padcom/pico"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-2663117317286517814?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/gK-foSeqo-Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/2663117317286517814/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=2663117317286517814" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/2663117317286517814?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/2663117317286517814?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/gK-foSeqo-Q/how-i-wrote-my-own-version-control.html" title="How I wrote my own version control system" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/09/how-i-wrote-my-own-version-control.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcMQX0_eCp7ImA9WhdWFEs.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-734271238738159914</id><published>2011-09-08T09:30:00.001+02:00</published><updated>2011-09-08T09:31:20.340+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-08T09:31:20.340+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="grails" /><category scheme="http://www.blogger.com/atom/ns#" term="multi-tenant" /><title>Grails, multi-tenant plugin and a bag of small issues</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/orc8sXBdCaYQmOr5QMXturwaI7M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/orc8sXBdCaYQmOr5QMXturwaI7M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/orc8sXBdCaYQmOr5QMXturwaI7M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/orc8sXBdCaYQmOr5QMXturwaI7M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;If you'll ever need a multi-tenant solution and you're lucky enough to use Grails going with the multi-tenant-core plugin is definitely the way to go. It's pretty easy to use in the "multiTenant" mode but some strange issues come up when trying yo use the "singleTenant" mode. In this installment I'm going to walk you through a solution that'll allow you to understand how things are and what you should avoid.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The debug solution&lt;/h2&gt;To make our "explorer" live easier we're going to provide a custom tenant resolver so that we'll be able to specify a query string like &lt;code&gt;?tid=1&lt;/code&gt; to select the tenant with id = 1.&lt;pre&gt;&lt;code&gt;package org.example

import javax.servlet.http.HttpServletRequest
import grails.plugin.multitenant.core.TenantResolver

class TestTenantResolver implements TenantResolver {
    Integer getTenantFromRequest(HttpServletRequest request) {
        def tid = request.queryString =~ /tid=(\d+)/
        return tid ? Integer.parseInt(tid[0][1]) : 0
    }
}&lt;/code&gt;&lt;/pre&gt;To use it just register a bean with name &lt;code&gt;tenantResolver&lt;/code&gt; in &lt;code&gt;resources.groovy&lt;/code&gt; like &lt;pre&gt;&lt;code&gt;tenantResolver(org.example.TestTenantResolver)&lt;/code&gt;&lt;/pre&gt;this and you're all set.&lt;br /&gt;
&lt;h2&gt;The data sources&lt;/h2&gt;Although the documentation will tell you that in the tenant configuration DSL you can specify JDBC URLs directly it is unfortunately not true. You need your JDBC datasources registered in JNDI for the multi-tenant plugin to pick them up. It's done in &lt;code&gt;Config.groovy&lt;/code&gt; like this:&lt;pre&gt;&lt;code&gt;grails.naming.entries = [
    "jdbc/foo": [
        type: "javax.sql.DataSource", 
        driverClassName: "org.hsqldb.jdbcDriver",
        url: "jdbc:hsqldb:file:target/db-dev-tid-1;shutdown=true",
        username: "sa",
        password: "",
        maxActive: "8",
        maxIdle: "4"
    ],
    "jdbc/bar": [
        type: "javax.sql.DataSource", 
        driverClassName: "org.hsqldb.jdbcDriver",
        url: "jdbc:hsqldb:file:target/db-dev-tid-2;shutdown=true",
        username: "sa",
        password: "",
        maxActive: "8",
        maxIdle: "4"
    ]
]&lt;/code&gt;&lt;/pre&gt;And then you need to tell the plugin about your datasources:&lt;pre&gt;&lt;code&gt;tenant {
    mode = "singleTenant"
    dataSourceTenantMap {
        t1 = "java:comp/env/jdbc/foo" 
        t2 = "java:comp/env/jdbc/bar" 
    }
}&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Catch No. 0 (zero)&lt;/h2&gt;Be warned that the tenant 0 (zero) has a special meaning that's not mentioned anywhere &lt;a href="http://multi-tenant.github.com/grails-multi-tenant-core/guide/2.%20Multi-Tenant%20Modes.html"&gt;in the docs&lt;/a&gt;. It means "use the connection returned originally by &lt;code&gt;TransactionAwareDataSourceProxy&lt;/code&gt;". This means that tenant with id 0 is off limits for you. Don't ever use it!!!&lt;br /&gt;
&lt;h2&gt;Summary&lt;/h2&gt;Other than the 2 small issues the plugin is really fun to work with. Good job guys!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-734271238738159914?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/_p9IPaEN_34" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/734271238738159914/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=734271238738159914" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/734271238738159914?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/734271238738159914?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/_p9IPaEN_34/grails-multi-tenant-plugin-and-bag-of.html" title="Grails, multi-tenant plugin and a bag of small issues" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/09/grails-multi-tenant-plugin-and-bag-of.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4DQ3wyfSp7ImA9WhdXGE8.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-2474626736718895955</id><published>2011-08-31T23:07:00.003+02:00</published><updated>2011-08-31T23:09:32.295+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-31T23:09:32.295+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><title>New guy in town: knockout.js</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nTNcMSr1OLsJQFXPJa8R9mWWr1A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nTNcMSr1OLsJQFXPJa8R9mWWr1A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nTNcMSr1OLsJQFXPJa8R9mWWr1A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nTNcMSr1OLsJQFXPJa8R9mWWr1A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Today we're going to take client-side JavaScript to a whole new level with the &lt;a href="http://en.wikipedia.org/wiki/Model_View_ViewModel"&gt;MVVM&lt;/a&gt; pattern using &lt;a href="http://knockoutjs.com/"&gt;knockout.js&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The "why"&lt;/h2&gt;&lt;br /&gt;
Imagine you're writing an application using, let's say, WPF or Silverlight. What's nice is that you have a clean separation of concerns between what's being displayed in terms of the layout (which is in fact the first V in MVVM) and some object backing up that view (which is the VM in MVVM in this case). This allows the application to be extensible and well structured.&lt;br /&gt;
Granted you can make a mess everywhere and MVVM architecture is no exception. You still have to use your brain while coding :)&lt;br /&gt;
Up until recently there has been no framework giving you the opportunity to have that kind of clear separation in JavaScript. Granted there have been tools like ExtJS and jQuery to help you out with modern UI elements like calendars and grids as well as low-level operations on DOM and events but there has been nothing so far that'd help you out write in a clear MVVM declarative style. Now there is!&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The "what"&lt;/h2&gt;&lt;br /&gt;
That's quite simple: the mini framework is called knockout.js and implements the MVVM pattern in pure JavaScript and DOM (not necessarily HTML but that'll work for DOM creation as well).&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;The "how"&lt;/h2&gt;&lt;br /&gt;
Well, here's the good part, which will be extremely easy:&lt;pre&gt;&lt;code&gt;
&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Example&amp;lt;/title&amp;gt;
&amp;lt;script 
type=&amp;quot;text/javascript&amp;quot; 
src=&amp;quot;https://github.com/downloads/SteveSanderson/knockout/knockout-1.2.1.js&amp;quot;&amp;gt;
&amp;lt;/script&amp;gt;
&amp;lt;script 
type=&amp;quot;text/javascript&amp;quot; 
src=&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js&amp;quot;&amp;gt;
&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
$(document).ready(function() {
var viewModel = {
data: ko.observable(&amp;quot;Hello, world!&amp;quot;)
};

ko.applyBindings(viewModel);
});
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;p&amp;gt;The current value of data is &amp;lt;span data-bind=&amp;quot;text: data&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; data-bind=&amp;quot;value: data&amp;quot;/&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;See how there's no "Apply changes" button? This is because once you've entered the text into the input box it'll be automatically transferred to the &lt;code&gt;viewModel&lt;/code&gt; object and since that's an observable it'll notify all subscribers about the fact that the value has changed and the text on the page gets updated automagically.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Going fancy&lt;/h2&gt;&lt;br /&gt;
I'd like to see some fancy stuff in here like responding to button events and the like. Let's see how we can do that with KO:&lt;pre&gt;&lt;code&gt;
&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Example&amp;lt;/title&amp;gt;
&amp;lt;script 
type=&amp;quot;text/javascript&amp;quot; 
src=&amp;quot;https://github.com/downloads/SteveSanderson/knockout/knockout-1.2.1.js&amp;quot;&amp;gt;
&amp;lt;/script&amp;gt;
&amp;lt;script 
type=&amp;quot;text/javascript&amp;quot; 
src=&amp;quot;https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js&amp;quot;&amp;gt;
&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
$(document).ready(function() {
var viewModel = {
data: ko.observable(&amp;quot;Hello, world!&amp;quot;),
show: function() {
alert(&amp;quot;Current value is: &amp;quot; + viewModel.data());
}
};

ko.applyBindings(viewModel);
});
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;p&amp;gt;The current value of data is &amp;lt;span data-bind=&amp;quot;text: data&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;input type=&amp;quot;text&amp;quot; data-bind=&amp;quot;value: data&amp;quot;/&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;button data-bind=&amp;quot;click: show&amp;quot;&amp;gt;Click me&amp;lt;/button&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;Again, the same page but with 2 additions:&lt;br /&gt;
1. A callback function called &lt;code&gt;show&lt;/code&gt; as part of the &lt;code&gt;viewModel&lt;/code&gt;&lt;br /&gt;
2. Declarative binding of the above function to a button using the last &lt;code&gt;data-bind&lt;/code&gt;. Cute, isn't it?&lt;br /&gt;
&lt;br /&gt;
I know that I'll put it to some good use in my next project. Just for the heck of it :) I like the idea that it is completely cross-platform and yet so incredibly easy to use!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-2474626736718895955?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/bponQqqgAjE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/2474626736718895955/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=2474626736718895955" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/2474626736718895955?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/2474626736718895955?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/bponQqqgAjE/new-guy-in-town-knockoutjs.html" title="New guy in town: knockout.js" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/08/new-guy-in-town-knockoutjs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AESH44cSp7ImA9WhdXF08.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-3254527889045637771</id><published>2011-08-30T19:33:00.001+02:00</published><updated>2011-08-30T19:35:09.039+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-30T19:35:09.039+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JSF" /><title>JSF 2.0 - Is it really better?</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0mRCW9a4dtjWeXhMuOJVH4qRvBU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0mRCW9a4dtjWeXhMuOJVH4qRvBU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0mRCW9a4dtjWeXhMuOJVH4qRvBU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0mRCW9a4dtjWeXhMuOJVH4qRvBU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I know most of you will hate me for the post I'm writing but I have no choice. I really need to stigmatize the framework and make clear to anybody still using it that they have been lost in the woods. Literally...&lt;br /&gt;
&lt;br /&gt;
Like you (as the reader of my blog) already know &lt;a href="http://ihatejsf.com"&gt;I hate JSF&lt;/a&gt;. I hate it so much that I've dedicated an entire blog and site to bitch about what a pain in the ass it is to use. Being the enlightened man I am from time to time I like to come back to stuff I hate to make sure they didn't do anything stupid like making the framework usable or so. This time was no different.&lt;br /&gt;
&lt;br /&gt;
So I did it. I've installed NetBeans (I usually use the Far Manager's build-in editor but for this exercise I've decided to go crazy a bit and use the full-blown IDE supported by JSF's creators). I've followed the standard File -&gt; New procedure, selected some JSF JPA CRUD example (because I couldn't find anything simple on the net) and started reviewing the app.&lt;br /&gt;
&lt;br /&gt;
First thing that hit me was the really cruel style of the web UI the application presents. In one word "HORRIBLE". Not that it ain't usable - God forbid - but plain "usable" these days just will not cut it. So the GUI is butt ugly - how about the code?&lt;br /&gt;
&lt;br /&gt;
Now that's the place I like JSF most for: the code was just exemplary bloated :D Let me give you some bottom line figures:&lt;br /&gt;
&lt;br /&gt;
1. It's a pure CRUD application. Absolutely nothing fancy. No Ajax or the like cool features whatsoever.&lt;br /&gt;
2. It's an application that manages 7 entities (customer, discount code, manufacturer, micro market, product code, product and purchase order).&lt;br /&gt;
3. Everything that was generated is 706068 bytes in 72 files!!!&lt;br /&gt;
&lt;br /&gt;
Now compare this to, let's say, Rails, Grails or Sinatra + Data Mapper is about 8 times bigger. I know it is an enterprise sort of thing and that it's not meant for mare mortals. It's the enterprise kind of solution that you'd use at work and not for fun.&lt;br /&gt;
&lt;br /&gt;
Anyways, JSF still sucks, big time. Lot's of hand-written XML, tons of Java code to implement pretty much every aspect of the application (with parts of it having cyclomatic code complexity at the level of 20+). That's just a no-go for new projects that need to deliver solutions on time, on budget and in scope.&lt;br /&gt;
&lt;br /&gt;
One last thing: For crying out loud the web is stateless! Why would anyone force a solution that inherently introduces state which in turn means no scaling possibilities and stupid ideas like "page life cycle" and "control binding"? Why would you ever want to fear JavaScript programming when there are layers of abstraction like Ext JS or jQuery? &lt;br /&gt;
&lt;br /&gt;
I wonder if the MyFaces implementation still differs from the reference one in the way that component libraries will work on one and not the other. I didn't check it out myself - I'm not that brave...&lt;br /&gt;
&lt;br /&gt;
The conclusion is that if you're still doing JSF these days just drop it. Now. It's horrible!&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-3254527889045637771?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/sjXriSUFltg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/3254527889045637771/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=3254527889045637771" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/3254527889045637771?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/3254527889045637771?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/sjXriSUFltg/jsf-20-is-it-really-better.html" title="JSF 2.0 - Is it really better?" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/08/jsf-20-is-it-really-better.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcFQnYyfCp7ImA9WhdXE00.&quot;"><id>tag:blogger.com,1999:blog-6245476510271728435.post-7347388081316148354</id><published>2011-08-25T23:30:00.001+02:00</published><updated>2011-08-25T23:33:33.894+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-25T23:33:33.894+02:00</app:edited><title>The Process</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ky3pQpbfLI_OSvL51wilmkvgYx0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ky3pQpbfLI_OSvL51wilmkvgYx0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ky3pQpbfLI_OSvL51wilmkvgYx0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ky3pQpbfLI_OSvL51wilmkvgYx0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I've been working this past few years for a company that utilized &lt;a href="http://www-01.ibm.com/software/rational/"&gt;Rational &lt;/a&gt;tools for issue tracking and source code versioning. Long story short it was a nightmare to use &lt;a href="http://www-01.ibm.com/software/awdtools/clearcase/index.html"&gt;ClearCase&lt;/a&gt; and &lt;a href="http://www-01.ibm.com/software/awdtools/clearquest/index.html"&gt;ClearQuest&lt;/a&gt; with its stone age web interface was more than annoying but it was to some extent usable.&lt;br /&gt;
&lt;br /&gt;
Nowadays the same workflow is doable using opensource tools like &lt;a href="http://git-scm.com/"&gt;Git&lt;/a&gt; and &lt;a href="http://github.com/"&gt;GitHub&lt;/a&gt; for anyone. Here's how the process works:&lt;br /&gt;
&lt;br /&gt;
- request a change to the system&lt;br /&gt;
- do the changes&lt;br /&gt;
- integrate them to the so called main line&lt;br /&gt;
&lt;br /&gt;
Using GitHub it's dead simple:&lt;br /&gt;
&lt;br /&gt;
- file an issue&lt;br /&gt;
- clone the repository, do some changes, check them in&lt;br /&gt;
- put out a pull request for the maintainer to integrate your changes&lt;br /&gt;
&lt;br /&gt;
All that takes some 2-3 minutes if you know what you're doing and if the test suite you're dealing with is fast enough. Piece of cake.&lt;br /&gt;
&lt;br /&gt;
Now if you'd like know how it looks like using Rational tools (and I mean the good stuff, fully integrated) take a look at the following &lt;a href="http://download.boulder.ibm.com/ibmdl/pub/demos/on_demand/Streamed/IBM_Demo_Manage_Develop_System_z_Applications_with_Rational_Software-1-Aug08.html?S=DL"&gt;screen cast&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I hope ClearCase will soon be seen for what it really is: a performance and evolution blocker.&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6245476510271728435-7347388081316148354?l=padcom13.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PadcomsBlog/~4/fLX-mPFE59M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://padcom13.blogspot.com/feeds/7347388081316148354/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6245476510271728435&amp;postID=7347388081316148354" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/7347388081316148354?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6245476510271728435/posts/default/7347388081316148354?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/PadcomsBlog/~3/fLX-mPFE59M/process.html" title="The Process" /><author><name>Matthias Hryniszak</name><uri>http://www.blogger.com/profile/11432592442831476478</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://padcom13.blogspot.com/2011/08/process.html</feedburner:origLink></entry></feed>

