<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-12753005</id><updated>2024-09-07T21:14:53.225-04:00</updated><category term="java"/><category term="mac"/><category term="spring"/><category term="agile"/><category term="amigos"/><category term="aop"/><category term="asm"/><category term="aspects"/><category term="cglib"/><category term="continuos integration"/><category term="hibernate"/><category term="maven"/><category term="spam"/><category term="tdd"/><category term="test"/><category term="validation"/><title type='text'>edovale&#39;s blog</title><subtitle type='html'>Software Development and stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://edovale.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12753005.post-1919163139664100885</id><published>2011-09-02T11:19:00.000-04:00</published><updated>2011-09-02T11:19:31.678-04:00</updated><title type='text'>JenkinsCI Cloud Formation Plugin</title><content type='html'>Lately I have been very busy working mainly in automation stuff. &lt;a href=&quot;http://jenkins-ci.org/&quot;&gt;JenkinsCI&lt;/a&gt;&amp;nbsp;is an awesome CI server that we are using for pretty much every automation activity we do. What makes JenkinsCI such a good tool is, among other things, how easy it is to extend. This is the primary reason why there are so many &lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Plugins&quot;&gt;plugins&lt;/a&gt;&amp;nbsp;that let you use the tool in the most unexpected ways.&lt;br /&gt;
&lt;a href=&quot;http://aws.amazon.com/cloudformation/&quot;&gt;Amazon Cloud Formation&lt;/a&gt;&amp;nbsp;is a service that allows you to express your application stack in the form of a json document (assuming you application is being deployed to AWS). This is indeed a very nice service as it allows you to treat you AWS stack definitions as code.&lt;br /&gt;
The combination of these 2 tools/services can be extremely powerful. One use case that comes to mind right away is to be able to create a brand new stack, run tests against it, collect test results for publishing/reporting and then take the whole stack down to save money. Another use case could be to implement &lt;a href=&quot;http://martinfowler.com/bliki/BlueGreenDeployment.html&quot;&gt;BLUE/GREEN deployments&lt;/a&gt;.&lt;br /&gt;
Use cases like these are possible using the &lt;a href=&quot;http://aws.amazon.com/developertools/351&quot;&gt;Amazon CLI tools&lt;/a&gt;&amp;nbsp;by running ad hoc commands from a &lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/Shells&quot;&gt;JenkinsCI Shell builder&lt;/a&gt;. However, getting such a set up to work&amp;nbsp;reliably&amp;nbsp;can be extremely challenging, specially due to the fact that calls to the AWS API are not guaranteed to work all the time and need clever ways to check for its completion and success.&amp;nbsp;Achieving&amp;nbsp;this in a shell script is doable, but tricky to say the least.&lt;br /&gt;
Enter the &lt;a href=&quot;https://wiki.jenkins-ci.org/display/JENKINS/AWS+Cloudformation+Plugin&quot;&gt;JenkinsCI Cloud Formation Plugin&lt;/a&gt;. This plugin allows for the creation of AWS Stacks in a declarative way. All is needed is a stack document (json) and the parameters that you wish to pass into the stack. The plugin allows for the use of build environment variables as values to stack parameters so that the stack creation is not isolated from the rest of the build. Another nice feature is the ability to &quot;chain&quot; stacks by passing outputs from one stack as parameters to another stack further down.&lt;br /&gt;
The plugin is in its early stages but it is fully functional. Please give it a try and let me know how it goes. If you find problems please log an issue &lt;a href=&quot;https://issues.jenkins-ci.org/secure/Dashboard.jspa&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/1919163139664100885' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/1919163139664100885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/1919163139664100885'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2011/09/jenkinsci-cloud-formation-plugin.html' title='JenkinsCI Cloud Formation Plugin'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-1749575320284604821</id><published>2010-09-15T14:29:00.000-04:00</published><updated>2010-09-15T14:29:24.438-04:00</updated><title type='text'>From Java to PHP - Impressions.</title><content type='html'>So,&lt;br /&gt;
I am now gonna be working on PHP for the next few months. I have been tasked with bringing continuous integration into a set of products that my company is building. Because my last few years I have spent working mostly in java; I decided that before doing any thing about CI in these projects I will spend a few weeks working side by side with the other developers to gain and understanding of PHP as a language and more importantly, the mind set of seasoned PHP developers that have never had any interactions with things like CI, unit testing, continuous deployments and stuff like that.&amp;nbsp; &lt;br /&gt;
Today I just got my first PHP project up and going. It is a web app that exposes some rest end points. While getting it up and running I ran into a few problems as any one should expect but it was 1 particular problem that threw me for a loop. I Still can&#39;t find an explanation for it and if someone out there can explain it I&#39;ll appreciate it.&lt;br /&gt;
Here is how it goes. The particular code I was trying to execute was doing nothing; literally nothing, not even giving me an error message. After a few minutes of fiddleing around I got to a point in the code that looked like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;try{
&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;execute();
} catch (Exception $e){
&amp;nbsp; &amp;nbsp;&amp;nbsp; echo $e;
}
&lt;/pre&gt;&lt;br /&gt;
So, the execute method was failing. The funny thing is that an error was being generated inside of it and the execution was completely halted; that is, no exception was getting caught in the catch block and the execute method was never returning. Now, I am new to PHP. I have previously worked with java, c#, javascript, c, c++, delphi and a few others I can&#39;t remember, and they all had predictable exception handling; so must likely there is something about PHP error handling that I am not quite grasping yet.&lt;br /&gt;
The problem turned out to be that I did not have the phpmysqli driver installed.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/1749575320284604821' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/1749575320284604821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/1749575320284604821'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2010/09/from-java-to-php-impressions.html' title='From Java to PHP - Impressions.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-4763927702584668101</id><published>2008-10-16T23:46:00.000-04:00</published><updated>2008-10-16T23:48:23.940-04:00</updated><title type='text'>API design.</title><content type='html'>I find &lt;a href=&quot;http://blog.isnotworking.com/2007/05/api-design-guidelines.html&quot;&gt;this entry&lt;/a&gt; very useful. So much so that it is worth printing and sticking somewhere it can be read while coding APIs.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/4763927702584668101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/4763927702584668101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/4763927702584668101'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/10/api-design.html' title='API design.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-4890825236367433607</id><published>2008-09-21T14:06:00.000-04:00</published><updated>2008-09-21T14:12:12.702-04:00</updated><title type='text'>Evil Ike</title><content type='html'>If &lt;a href=&quot;http://www.boston.com/bigpicture/2008/09/the_short_but_eventful_life_of.html&quot;&gt;this&lt;/a&gt; is how &lt;a href=&quot;http://en.wikipedia.org/wiki/Hurricane_Ike&quot;&gt;Ike&lt;/a&gt;, being a category 2 hurricane, left Texas; I can&#39;t think if the disaster it left across Cuba where it hit as a category 3 hurricane. Very impressive pictures of Texas though.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/4890825236367433607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/4890825236367433607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/4890825236367433607'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/09/if-this-is-how-ike-being-category-2.html' title='Evil Ike'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-8552411410458994023</id><published>2008-09-15T23:06:00.001-04:00</published><updated>2008-09-15T23:30:19.485-04:00</updated><title type='text'>Hibernate &amp; maven.</title><content type='html'>Some time ago a &lt;a href=&quot;http://edovale.blogspot.com/2007/05/damn-hibernate-pomxml.html&quot;&gt;blogged&lt;/a&gt; about some annoyances in the, at the time, current pom.xml for hibernate. At that time the maven metadata for hibernate was maintained by the maven community who could not keep up with the amount of work generated by updating dependencies to hundreds of software libraries.&lt;br /&gt;Well, things have changed quite a bit since then. 2 of the most important java open source projects of all times have started maintaining and publishing their own maven artifacts!! &lt;a href=&quot;http://springframework.org/&quot;&gt;Spring Framework&lt;/a&gt; announced it &lt;a href=&quot;http://feeds.feedburner.com/%7Er/Interface21TeamBlog/%7E3/215524890/&quot;&gt;here&lt;/a&gt; on January/2008 and more recently &lt;a href=&quot;http://hibernate.org/&quot;&gt;Hibernate&lt;/a&gt; did it &lt;a href=&quot;http://in.relation.to/Bloggers/HibernateCore330GoesGA&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;It is clear that maven is gaining ground in the build market when projects of this caliber start supporting it. In the case of Hibernate they totally migrated their build from ant to maven.&lt;br /&gt;I am glad that maven has gotten to this point.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/8552411410458994023' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/8552411410458994023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/8552411410458994023'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/09/hibernate-maven.html' title='Hibernate &amp; maven.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-1091844565794489650</id><published>2008-08-21T22:55:00.000-04:00</published><updated>2008-08-24T08:46:52.014-04:00</updated><title type='text'>Consistency vs Improvement</title><content type='html'>On every medium to large software system, consistency becomes critical.&lt;br /&gt;By consistency I mean the application of certain architectural patterns that are considered the standard way of &quot;doing things&quot; in a software organization. Consistency helps keep the system understandable to all programmers currently involved, and to those that may come in the future. Consistency also helps when solving known problems as established patterns can be applied with ease. Consistency attempts to keep the entropy of the system under control.&lt;br /&gt;On the other hand, it can also make improving a system hard. How can you change the standard without introducing inconsistencies? In a large project there is probably no good reason to change existing code that is already working for new code that does the same in a different way. No matter how better the new approach is; it just isn&#39;t cost effective.&lt;br /&gt;In my opinion, consistency can not be taken in an absolute way. Consistency is never a good reason not to improve a design. If this wasn&#39;t true there would be no legacy code ever. Instead new valuable ideas should be embraced and considered the new consistent way. No new code should be written following the old way. Changing the old code should be considered technical debt if it merits the effort which very likely it will. Resistance to changes that improve the quality of a system overall is irresponsible.&lt;br /&gt;How is this issue dealt with in your organization? Is consistency used as a reason to reject changes?</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/1091844565794489650' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/1091844565794489650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/1091844565794489650'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/08/consistency-vs-inprovement.html' title='Consistency vs Improvement'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-128519171338032500</id><published>2008-06-10T12:35:00.000-04:00</published><updated>2008-06-10T12:38:15.297-04:00</updated><title type='text'>YubNob is kinda cool</title><content type='html'>&lt;a href=&quot;http://lifehacker.com/395628/integrate-yubnub-into-firefoxs-address-bar-for-faster-searches&quot;&gt;This&lt;/a&gt; is a nice idea for shell like search commands from within firefox.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/128519171338032500' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/128519171338032500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/128519171338032500'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/06/yubnob-is-kinda-cool.html' title='YubNob is kinda cool'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-3961248798241111653</id><published>2008-05-29T22:47:00.001-04:00</published><updated>2008-05-30T12:42:36.527-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="spam"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><title type='text'>About SpringSource&#39;s marketing</title><content type='html'>Look what i just got today:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;from Kylie Clement &lt;kylie.clement@springsource.com&gt;&lt;br /&gt;to me&lt;br /&gt;date Thu, May 29, 2008 at 12:19 AM&lt;br /&gt;subject SpringSource Application Platform&lt;br /&gt; &lt;br /&gt;Erick,&lt;br /&gt;&lt;br /&gt;Thank you for your interest in SpringSource Application Platform, an excellent alternative to J2EE application servers.&lt;br /&gt;&lt;br /&gt;Are you available Thursday or Friday of this week for a telephone conversation?  I would like to understand your requirements in detail&lt;br/&gt;and answer any questions you may have.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Kylie&lt;br /&gt;&lt;br /&gt;Kylie Clement&lt;br /&gt;Regional Sales Manager&lt;br /&gt;SpringSource, Inc.&lt;br /&gt;1875 South Grant Drive, Suite 650&lt;br /&gt;San Mateo, CA 94402&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This happened after I registered for a webcast about the newly released Spring Application Platform. I have given my information to the big boys before (IBM, Oracle, etc etc) and never got an email as intrusive as this before.&lt;br /&gt;Anyway, being consistent with the inversion of control pattern, my answer is: No Mr Clement, do not call me; I&#39;ll call you if I ever need your help. And no, you will not be able to understand my requirements in a phone call as not even I am sure of what they are.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/3961248798241111653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/3961248798241111653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/3961248798241111653'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/05/about-springsources-marketing.html' title='About SpringSource&#39;s marketing'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-6012690580250623225</id><published>2008-05-23T00:18:00.000-04:00</published><updated>2008-05-23T09:46:54.563-04:00</updated><title type='text'>maven-js-plugin</title><content type='html'>Wao,&lt;br /&gt;I was blown away by the ease of use of this maven plugin.&lt;br /&gt;Just add it to your pom.xml lie this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;  &amp;lt;groupId&amp;gt;com.mobilvox.ossi.mojo&amp;lt;/groupId&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;artifactId&amp;gt;maven-js-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;  &amp;lt;version&amp;gt;1.3.1&amp;lt;/version&amp;gt;&lt;br /&gt;  &amp;lt;configuration&amp;gt;&lt;br /&gt;    &amp;lt;mergeWarFiles&amp;gt;true&amp;lt;/mergeWarFiles&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;classifier&amp;gt;js-compressed&amp;lt;/classifier&amp;gt;&lt;br /&gt;  &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then in the maven output, during the package phase, you get to see something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[info] JavaScript file compression complete.&lt;br /&gt;[info] Size of JavaScript files after compression: 1612632 bytes&lt;br /&gt;[info] Compression ratio: 27.103024264908303%&lt;br /&gt;[info] Creating WAR: mywar.war with compressed JavaScript&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So there you go, another reason to love maven.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/6012690580250623225' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/6012690580250623225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/6012690580250623225'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/05/maven-js-plugin.html' title='maven-js-plugin'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-2521314722024723271</id><published>2008-05-22T16:49:00.000-04:00</published><updated>2008-07-16T20:58:00.626-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="continuos integration"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="maven"/><title type='text'>Maven, love it, hate it, love it, hate it, ......</title><content type='html'>Lately I&#39;ve been doing lots of maven stuff.&lt;br /&gt;I just released a new version of the web app I am working on and this version is going to production. Releases always are maven intensive tasks (for maven based build systems obviously), package the app, make sure data population scripts and schema creation ones are all good, deploy to new environment, run tests against it to ensure everything is ok, etc etc.&lt;br /&gt;Tweaking maven to behave appropriately can sometimes be frustrating although, in this opportunity, I have to say that almost everything went smoothly.&lt;br /&gt;One thing that I find tricky is the build profiles. I am obsessive with DRYing every single line of code i write and profiles do not make it easy in this regard. A feature I would love for maven to have is the ability to activate a profile from within another profile.&lt;br /&gt;For example, I want to have a profile called mysql that defines the dependency on mysql, plus properties such as driver class name, hibernate dialect class name etc. I want to have another profile to define an environment, say nigthly as an example. Nightly consists of a server running an instance of tomcat to which I want maven to deploy the app every night and, a mysql server instance which will host the app&#39;s DB.&lt;br /&gt;I don&#39;t wanna say mvn deploy -P nightly,mysql; instead I just wanna say mvn deploy -P nightly and the nightly knows to activate  the mysql profile.&lt;br /&gt;Overall I like maven and it is a very lively project with a very active comunity. I also like the fact that it has many detractors as this works in favor of making it better. I do wish it was released more often though.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/2521314722024723271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/2521314722024723271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/2521314722024723271'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/05/maven-love-it-hate-it-love-it-hate-it.html' title='Maven, love it, hate it, love it, hate it, ......'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-3332226106033214254</id><published>2008-04-30T10:06:00.000-04:00</published><updated>2008-04-30T10:10:22.533-04:00</updated><title type='text'>Wolfenstein on JS!!</title><content type='html'>Outstanding!!!!&lt;br /&gt;Things like &lt;a href=&quot;http://www.nihilogic.dk/labs/wolf/&quot;&gt;this&lt;/a&gt; tell more about the power of javascript than all the books on the language out there.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/3332226106033214254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/3332226106033214254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/3332226106033214254'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/04/wolfenstein-on-js.html' title='Wolfenstein on JS!!'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-6325310076065716890</id><published>2008-04-27T13:02:00.000-04:00</published><updated>2008-04-28T09:58:57.646-04:00</updated><title type='text'>OS X Focus-follows-mouse issue</title><content type='html'>Sometime a go I &lt;a href=&quot;http://edovale.blogspot.com/2008/03/another-mac-os-annoyance.html&quot;&gt;bloged&lt;/a&gt; about this issue. Now Stevey has &lt;a href=&quot;http://steve-yegge.blogspot.com/2008/04/settling-osx-focus-follows-mouse-debate.html&quot;&gt;a very detailed blog entry about this issue&lt;/a&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/6325310076065716890' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/6325310076065716890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/6325310076065716890'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/04/os-x-focus-follows-mouse-issue.html' title='OS X Focus-follows-mouse issue'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-9090412355059837075</id><published>2008-03-25T16:47:00.000-04:00</published><updated>2008-03-25T23:30:51.970-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="validation"/><title type='text'>Validation Framework for java</title><content type='html'>Wouldn&#39;t it be nice to be able to do something like this:&lt;br /&gt;&lt;pre&gt;public class Address {&lt;br /&gt;&lt;br /&gt;   @NotEmpty @Max(50)&lt;br /&gt;   private String street1;&lt;br /&gt;&lt;br /&gt;   @Max(50)&lt;br /&gt;   private String street2;&lt;br /&gt;&lt;br /&gt;   @Max(9) @NotNull&lt;br /&gt;   private String zipcode;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;and then be able to say something like:&lt;br /&gt;&lt;pre&gt;public class Order {&lt;br /&gt;   @Valid @NotNull private Address delivery;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;The implications of something like this go beyond mere validation. IMHO it si an elegant solution that if built properly will improve the &lt;a href=&quot;http://en.wikipedia.org/wiki/Don%27t_repeat_yourself&quot;&gt;DRYness&lt;/a&gt; of the code across all layers of any java application.&lt;br /&gt;&lt;br /&gt;This is the intention behind &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=303&quot;&gt;jsr-303&lt;/a&gt;. &lt;span class=&quot;entry-author-name&quot;&gt;Emmanuel Bernard from &lt;a href=&quot;http://jboss.org/&quot;&gt;jboss&lt;/a&gt; has more details &lt;a href=&quot;http://in.relation.to/Bloggers/BeanValidationSneakPeekPartI&quot;&gt;here&lt;/a&gt;&lt;/span&gt;.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/9090412355059837075' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/9090412355059837075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/9090412355059837075'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/03/validation-framework-for-java.html' title='Validation Framework for java'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-641818686973143375</id><published>2008-03-17T13:13:00.000-04:00</published><updated>2008-03-17T13:30:11.689-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><title type='text'>Another Mac OS annoyance</title><content type='html'>For some reason in Mac OS, if an application does not have the focus, you would have to click twice on it to get something done. The first click will give the application the focus and the second will do what you where intending to do in the first click. In windows this is not true so for someone coming from Windows, like me, this is particularly annoying. Nonetheless it is not the end of the world.&lt;br /&gt;Mac OS is definitely faster than windows for the kind of work I do on it. I am just finding it a little bit tricky to get use to its windowing system.&lt;br /&gt;It could be the case that, for someone with little or no computer experience; getting use to this kind of things would be easier than it is for someone coming from a different OS.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/641818686973143375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/641818686973143375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/641818686973143375'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/03/another-mac-os-annoyance.html' title='Another Mac OS annoyance'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-4231056907881838538</id><published>2008-03-06T22:35:00.000-05:00</published><updated>2008-03-06T22:45:50.300-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="amigos"/><title type='text'>Amigo camino a la fama.</title><content type='html'>Tengo un &lt;a href=&quot;http://www.malditosfilms.com&quot;&gt;amigo&lt;/a&gt; cineasta de hace mas de 20 anos que, con su opera prima como director, parece &lt;a href=&quot;http://www.elnuevoherald.com/entretenimiento/revista_aplausos/story/170734.html&quot;&gt;haberle acertado al clavo en la cabeza&lt;/a&gt;.&lt;br /&gt;La verdad yo siempre crei en el. Muchos no, y no los culpo por que despues de empezar y dejar inconclusas carreras de musica, psicologia y filologia, hay que tener mucha fe en alguien para seguir creyendo que podria llegar a algo. Finalmente encontro se verdadera profesion como cineasta lo cual me hace extremedamante feliz.&lt;br /&gt;Ale, te deseo toda la suerte del mundo, aunque se que, como hasta ahora, la suerte te la haras tu mismo.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/4231056907881838538' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/4231056907881838538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/4231056907881838538'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/03/amigo-camino-la-fama.html' title='Amigo camino a la fama.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-6201704253021065406</id><published>2008-03-06T18:11:00.000-05:00</published><updated>2008-03-06T18:14:33.750-05:00</updated><title type='text'>Software Market works upside-down</title><content type='html'>What an interesting take on the software market &lt;a href=&quot;http://parlezuml.com/blog/?postid=595&quot;&gt;this&lt;/a&gt; is.</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/6201704253021065406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/6201704253021065406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/6201704253021065406'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/03/software-market-works-upside-down.html' title='Software Market works upside-down'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-6938659222111877396</id><published>2008-03-03T14:50:00.000-05:00</published><updated>2008-03-17T13:30:47.406-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><title type='text'>No mnemonics in MAC OS X?</title><content type='html'>I just got a new mac book pro!! I am extremely excited about it.&lt;br /&gt;I have always been a windows guy; and not, I am not exactly ashamed of it. As a developer, the majority of my career has been working on the java platform even though windows was my platform of choice for development.&lt;br /&gt;Anyway, now I find my self lost around mac os x. I have to say that I am having a blast learning to work with it but today I think I found something that in my opinion is pretty serious.&lt;br /&gt;As I started coding away on eclipse in my new mac I went to create a new test class and, to my surprise, eclipse has no mnemonics at all on the mac os platform. On windows I&#39;ll go shift+alt+n+j+j+enter to open the new test class dialog, alt+o to select the source folder and alt + f to finalize the wizard. On the mac I&#39;ll have to go back to using the mouse for this and many many other things I do just with the keyboard in windows.&lt;br /&gt;At the beginning I thought I was missing some hack in the eclipse configuration to activate this but then realized that iTunes, or any other native mac application for that matter, have no mnemonic support at all. Then I called a &lt;a href=&quot;http://alexguev.blogspot.com/&quot;&gt;fellow developer&lt;/a&gt; who is a big mac advocator and he pointed me out to &lt;a href=&quot;http://developer.apple.com/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html&quot;&gt;this&lt;br /&gt;&lt;/a&gt; (search for mnemonics) and here clearly states that mnemonics are not inline with  Aqua guidelines.&lt;br /&gt;Am I the only one who makes heavy use of the keyboard? How come no mac fan ever complained about not been able to drive his/her IDE from the keyboard??</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/6938659222111877396' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/6938659222111877396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/6938659222111877396'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2008/03/no-mnemonics-in-mac-os-x.html' title='No mnemonics in MAC OS X?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-5574986673489417530</id><published>2007-11-22T15:24:00.000-05:00</published><updated>2007-11-22T15:28:16.340-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="agile"/><category scheme="http://www.blogger.com/atom/ns#" term="tdd"/><category scheme="http://www.blogger.com/atom/ns#" term="test"/><title type='text'>Agile without Tests???</title><content type='html'>Can a software organization where the majority of developers have no idea about TDD be considered agile?&lt;br /&gt;I think no, but I may be wrong. What do people out there have to say about this?</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/5574986673489417530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/5574986673489417530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/5574986673489417530'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2007/11/agile-without-tests.html' title='Agile without Tests???'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-904274016834074656</id><published>2007-05-12T01:10:00.000-04:00</published><updated>2008-09-15T23:08:32.274-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aop"/><category scheme="http://www.blogger.com/atom/ns#" term="asm"/><category scheme="http://www.blogger.com/atom/ns#" term="aspects"/><category scheme="http://www.blogger.com/atom/ns#" term="cglib"/><category scheme="http://www.blogger.com/atom/ns#" term="hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><title type='text'>darn hibernate pom.xml</title><content type='html'>I just finished figuring out a problem for which I could not find any explanation online. It all started happening when I decided to take spring2 aop for a whirl. The app I am working on is a web app using spring and hibernate; both of them to the latest versions which 3.2.x for hibernate and 2.0.4 for spring.&lt;br /&gt;My build system is maven based. The things I love about maven (for regular developer tasks)is its dependency resolution capablities as well as the eclipse:eclipse plugin which helps me setup eclipse in no time.&lt;br /&gt;When I added a dependency on spring-aop and spring-aspects my application stopped deplying complainig about a class in asm that was not found. The exception was comming from hibernate trying to proxy an object using cglib. This was the stacktrace I was getting:&lt;br /&gt;java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor&lt;br /&gt;at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:165)&lt;br /&gt;at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)&lt;br /&gt;at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)&lt;br /&gt;at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)&lt;br /&gt;at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)&lt;br /&gt;at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)&lt;br /&gt;at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)&lt;br /&gt;at net.sf.cglib.proxy.Enhancer.&lt;clinit&gt;(Enhancer.java:69)&lt;br /&gt;at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:107)&lt;br /&gt;at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)&lt;br /&gt;at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)&lt;br /&gt;at org.hibernate.tuple.entity.AbstractEntityTuplizer.&lt;init&gt;(AbstractEntityTuplizer.java:135)&lt;br /&gt;at org.hibernate.tuple.entity.PojoEntityTuplizer.&lt;init&gt;(PojoEntityTuplizer.java:55)&lt;br /&gt;at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.&lt;init&gt;(EntityEntityModeToTuplizerMapping.java:56)&lt;br /&gt;at org.hibernate.tuple.entity.EntityMetamodel.&lt;init&gt;(EntityMetamodel.java:295)&lt;br /&gt;at org.hibernate.persister.entity.AbstractEntityPersister.&lt;init&gt;(AbstractEntityPersister.java:434)&lt;br /&gt;at org.hibernate.persister.entity.SingleTableEntityPersister.&lt;init&gt;(SingleTableEntityPersister.java:109)&lt;br /&gt;at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)&lt;br /&gt;at org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:226)&lt;br /&gt;at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)&lt;br /&gt;at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)&lt;br /&gt;at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)&lt;br /&gt;at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)&lt;br /&gt;at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1175)&lt;br /&gt;&lt;br /&gt;and more stuff which adds no value to this blog entry.&lt;br /&gt;&lt;br /&gt;The problem, after hours of digging, banging, pulling hair and snapping was the hibernate&#39;s pom.xml has cglig-2.1_3.jar as dependency and somehow this guy depends on asm-1.5.x.jar. Spring aop depends indirectly of asm-2.2.3 and maven, smart enough, was using the latter is its a newer version. To make a long story short, I added an exclussion to hibernate dependency for cglib and added cglib-nodep as one of my dependencies and this solved the problem.&lt;br /&gt;I hope, if anyone hits this problem ever, he/she will google the stacktrace and will find this post.&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/clinit&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/904274016834074656' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/904274016834074656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/904274016834074656'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2007/05/damn-hibernate-pomxml.html' title='darn hibernate pom.xml'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12753005.post-116239479166876552</id><published>2006-11-01T03:50:00.001-05:00</published><updated>2006-11-01T10:21:02.869-05:00</updated><title type='text'>Validation Framework For Commands.</title><content type='html'> &lt;p dir=&quot;ltr&quot; style=&quot;MARGIN-RIGHT: 0px&quot;&gt;In my company they came up with a rather strange way to&quot;customize/extend&quot; the product. There is a sort of framework upon whichcustomizations are built. The way to customize a certain piece of logicis by using a variation of the &lt;a href= &quot;http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern&quot;&gt;chain of responsibility pattern&lt;/a&gt;. Pieces of logic are put into command objects and these objects are chained using &lt;a href= &quot;http://jakarta.apache.org/commons/chain/&quot;&gt;Apache Commons-Chain.&lt;/a&gt; The reasons why this done like this is a topic for another post.&lt;br/&gt; Becausethe application is spring based, it was awkward to have these commandobject instantiated outside spring. By doing this we were unable toleverage the dependency injection facility in spring and therefore, hadto come up with a very wacky way of doing this which basically wasputting collaborators into the command context.&lt;br/&gt; Recently this wasfixed. We are now able to declare command objects as spring beans andinject anything we want into them. The same goes with chains. This isindeed, a great improvement over what we had before.&lt;br/&gt; Now, to thepoint of this post. In my team, we thought it would be nice to have aframework to validate the command contexts before the actual executemethod is called. By having this, we&#39;ll be saving our selves theclutter of having validation code inside the commands; instead, thecommands would assume everything expected to be in the context wasthere, and focus only on getting the job done.&lt;br/&gt; This is the kind ofuse cases aspects are very well suited for. It is a cross cuttingconcern because validation has to be performed across a large set ofobjects.&lt;br/&gt; So, we came up with a before advice for the execute methodon the command objects and also wrote a factory that is able to returna validator object for a particular type of command. This factory onlyhave to be declared as a bean in the spring context and wheninitialized it will search the application context for Validator beansand put them in a map keyed by the type of comand they know how tovalidate.&lt;br/&gt; If the factory returns &lt;font style= &quot;FONT-STYLE: italic&quot;&gt;null&lt;/font&gt;for a particular type of command then the advice will let theinvocation continue without further actions. At the most, it logs awarning about the missing validator.&lt;br/&gt; &lt;br/&gt; This is how the advice looks in real life:&lt;br/&gt; &lt;br/&gt;&lt;/p&gt; &lt;p&gt;&lt;br/&gt;&lt;/p&gt; &lt;div style=&quot;BACKGROUND-COLOR: rgb(192,192,192)&quot;&gt;&lt;br/&gt; &lt;font style=&quot;FONT-WEIGHT: bold; FONT-STYLE: italic&quot; size=&quot;2&quot;&gt;&lt;br/&gt; public class CommandContextValidationAdvice implements MethodBeforeAdvice {&lt;br/&gt; private CommandValidatorFactory validatorFactory = null;&lt;br/&gt; &lt;br/&gt; /**&lt;br/&gt; * Lookup a CommandContextValidator via the factory. And if not null then execute the validate method.&lt;br/&gt; */&lt;br/&gt; public void before(Method method, Object[] params, Object command) throws Throwable {&lt;br/&gt; CommandContextValidator validator=validatorFactory.getCommandValidator(command.getClass());&lt;br/&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if(validator != null) {&lt;br/&gt; validator.validate((Context) params[0]);&lt;br/&gt; }&lt;br/&gt; }&lt;br/&gt; &lt;br/&gt; /**&lt;br/&gt; * @param validatorFactory The validatorFactory to set.&lt;br/&gt; */&lt;br/&gt; public void setValidatorFactory(CommandValidatorFactory validatorFactory) {&lt;br/&gt; this.validatorFactory = validatorFactory;&lt;br/&gt; }&lt;br/&gt; }&lt;br/&gt;&lt;/font&gt;&lt;br/&gt;&lt;/div&gt; &lt;br/&gt; &lt;br/&gt; The second problem we faced was applying the aspect to the commands. We didnot wanted to change every single command bean definition as this woulddefeat the purpose of making the validation framework orthogonal to theactual command hierarchy.&lt;br/&gt; In order to solve this, we used the autoproxy facility in spring. The bean definitions in the applicationcontext then looks like this:&lt;br/&gt; &lt;br/&gt; &lt;div style=&quot;BACKGROUND-COLOR: rgb(192,192,192)&quot;&gt;&lt;br/&gt; &lt;font face=&quot;Arial&quot; size=&quot;2&quot;&gt;&lt;b&gt;&amp;lt;BEAN class=org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator id=jdkBeanNameProxyCreator&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&quot;beanNames&quot;&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;VALUE&amp;gt;*Command&amp;lt;/VALUE&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&quot;interceptorNames&quot;&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LIST&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;VALUE&amp;gt;commandContextValidationAdvisor&amp;lt;/VALUE&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/LIST&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;br/&gt; &amp;lt;/BEAN&amp;gt;&lt;/b&gt;&lt;/font&gt; &lt;p dir=&quot;ltr&quot; style=&quot;MARGIN-RIGHT: 0px&quot;&gt;&lt;font face=&quot;Arial&quot; size= &quot;2&quot;&gt;&lt;b&gt;&amp;lt;BEAN class=com.mycompany.myclientcompany.command.CommandContextValidationAdvice id=commandContextValidationAdvice&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&quot;validatorFactory&quot;&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;REF bean=&quot;commandValidatorFactory&quot;/&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;br/&gt; &amp;lt;/BEAN&amp;gt;&lt;br/&gt; &lt;br/&gt; &amp;lt;BEAN class=org.springframework.aop.support.RegexpMethodPointcutAdvisor id=commandContextValidationAdvisor&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&quot;advice&quot;&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;REF local=&quot;commandContextValidationAdvice&quot;/&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name=&quot;pattern&quot;&amp;gt;&lt;br/&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;VALUE&amp;gt;org.apache.commons.chain.Command.execute&amp;lt;/VALUE&amp;gt;&lt;br/&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;br/&gt; &amp;lt;/BEAN&amp;gt;&lt;br/&gt;&lt;/b&gt;&lt;/font&gt;&lt;br/&gt;&lt;/p&gt; &lt;/div&gt; &lt;br/&gt; The first bean definition is the auto proxy creator. It will proxy everybean in the application context whose name end with the word Command. In our case this was not much of a problem because all the commands were following this convention even before we thought about the validation framework. The rest of the bean definitions are the Advice and the Advisor respectively. </content><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/12753005/116239479166876552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/116239479166876552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12753005/posts/default/116239479166876552'/><link rel='alternate' type='text/html' href='http://edovale.blogspot.com/2006/11/validation-framework-for-c_116239479166876552.html' title='Validation Framework For Commands.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13981092194125762945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>