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


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.


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.

Friday, May 23, 2008


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




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.

Thursday, May 22, 2008

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.

Wednesday, April 30, 2008

Wolfenstein on JS!!

Things like this tell more about the power of javascript than all the books on the language out there.

Tuesday, March 25, 2008

Validation Framework for java

Wouldn't it be nice to be able to do something like this:
public class Address {

@NotEmpty @Max(50)
private String street1;

private String street2;

@Max(9) @NotNull
private String zipcode;



and then be able to say something like:
public class Order {
@Valid @NotNull private Address delivery;

The implications of something like this go beyond mere validation. IMHO it si an elegant solution that if built properly will improve the DRYness of the code across all layers of any java application.

This is the intention behind jsr-303. .

Monday, March 17, 2008

Another Mac OS annoyance

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.
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.
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.

Thursday, March 06, 2008

Amigo camino a la fama.

Tengo un amigo cineasta de hace mas de 20 anos que, con su opera prima como director, parece haberle acertado al clavo en la cabeza.
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.
Ale, te deseo toda la suerte del mundo, aunque se que, como hasta ahora, la suerte te la haras tu mismo.

Software Market works upside-down

What an interesting take on the software market this is.

Monday, March 03, 2008

No mnemonics in MAC OS X?

I just got a new mac book pro!! I am extremely excited about it.
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.
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.
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'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'll have to go back to using the mouse for this and many many other things I do just with the keyboard in windows.
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 fellow developer who is a big mac advocator and he pointed me out to this
(search for mnemonics) and here clearly states that mnemonics are not inline with Aqua guidelines.
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??