Thursday, October 16, 2008

API design.

I find this entry very useful. So much so that it is worth printing and sticking somewhere it can be read while coding APIs.

Sunday, September 21, 2008

Evil Ike

If this is how Ike, being a category 2 hurricane, left Texas; I can't think if the disaster it left across Cuba where it hit as a category 3 hurricane. Very impressive pictures of Texas though.

Monday, September 15, 2008

Hibernate & maven.

Some time ago a blogged 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.
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!! Spring Framework announced it here on January/2008 and more recently Hibernate did it here.
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.
I am glad that maven has gotten to this point.

Thursday, August 21, 2008

Consistency vs Improvement

On every medium to large software system, consistency becomes critical.
By consistency I mean the application of certain architectural patterns that are considered the standard way of "doing things" 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.
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't cost effective.
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'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.
How is this issue dealt with in your organization? Is consistency used as a reason to reject changes?

Tuesday, June 10, 2008

YubNob is kinda cool

This is a nice idea for shell like search commands from within firefox.

Thursday, May 29, 2008

About SpringSource's marketing

Look what i just got today:

from Kylie Clement
to me
date Thu, May 29, 2008 at 12:19 AM
subject SpringSource Application Platform

Erick,

Thank you for your interest in SpringSource Application Platform, an excellent alternative to J2EE application servers.

Are you available Thursday or Friday of this week for a telephone conversation? I would like to understand your requirements in detail
and answer any questions you may have.

Regards,
Kylie

Kylie Clement
Regional Sales Manager
SpringSource, Inc.
1875 South Grant Drive, Suite 650
San Mateo, CA 94402


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.
Anyway, being consistent with the inversion of control pattern, my answer is: No Mr Clement, do not call me; I'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.

Thursday, May 22, 2008

maven-js-plugin

Wao,
I was blown away by the ease of use of this maven plugin.
Just add it to your pom.xml lie this:

<plugin>
<groupId>com.mobilvox.ossi.mojo</groupId>

<artifactId>maven-js-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<mergeWarFiles>true</mergeWarFiles>

<classifier>js-compressed</classifier>
</configuration>
</plugin>


And then in the maven output, during the package phase, you get to see something like this:

[info] JavaScript file compression complete.
[info] Size of JavaScript files after compression: 1612632 bytes
[info] Compression ratio: 27.103024264908303%
[info] Creating WAR: mywar.war with compressed JavaScript

So there you go, another reason to love maven.

Maven, love it, hate it, love it, hate it, ......

Lately I've been doing lots of maven stuff.
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.
Tweaking maven to behave appropriately can sometimes be frustrating although, in this opportunity, I have to say that almost everything went smoothly.
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.
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's DB.
I don'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.
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.