Hibernate Review

31 01 2005

Hibernate logo

Even though some vehemently disagree, it is my firmly held opinion that Object/Relational Mapping (ORM for short) is a powerful weapon in the arsenal of any entrerprise developer working with an Object-Oiented language. Should you decide to take the plunge and use a full-featured ORM tool for your next project, after you have done some research, it will be evident that there is a great deal to choose from, even if you limit yourself to Open Source, Java libraries. Everybody seems to have rather strong opinions on the matter. The only point on which you will find agreement from most parties is that EJB sucks, but that’s another story.

I won’t try to convince you that Hibernate is the best solution, mostly because I have almost no hands-on experience with JDO, OBJ or other similar tools. What I have to share is a two year long, mostly positive, experience with Hibernate, having developed a dozen or more projects with it.

What’s so good about Hibernate?

  • Non-intrusive, almost completely transparent, persistence for Plain Old Java Objects (POJOs). In short, you don’t have to extend Hibernate-specific interfaces in order to make an object persitent and you don’t have to obey unnatural rules (like “no inheritance”). You can use plain object references and Java2 collections to express relationships and you can map rather complex cases, including class hiearchies, with Hibernate.
  • No need for pre- or post-processing of source- or byte-code. This means a simpler tool chain and quicker edit-compile-deploy cycle.
  • Good tooling, although it might be better.
  • Good docs. Plus, there are lots of books dealing with Hibernate. I reviewed one of the best here.
  • Very robust, bug-free and performant code.
  • Caching.
  • A very good query language (HQL), with the option of falling back to SQL when you need it.
  • Much more…

What’s not so good about Hibernate?

Well, the only real gripe I have with it is probably the fact that, for all practical purposes, Hibernate is owned by JBoss. Not that I have anything against Mr. Fleury’s gang, but given JBoss’s revenue model (support and services), it might come as no surprise that suppport is relegated to a forum (I would prefer a mailing list, but that’s just me) and responses from the development team tend to be just a little bit terse, at times.

On the other hand, this is perfectly legit. If you want pro-level support, even with an Open Source project, you should be prepared to pay for it.

All in all, I give Hibernate 5 stars (out of 5). Highly recommended!





Re: Applying for a Java job – HOWTO

31 01 2005

I'm sure I would have no problem matching most of
the criteria Mike lays down as prerequisites for getting a job at Atlassian. I have a decent grasp of English language, relevant experience, have contributed to a few open source projects and keep a blog. I am a JIRA user too.

Only problem, I am not available for an interview in Sidney :( . For locations nearer to home (Italy), my resume is available here. It's PDF, but not written in pink ;) .





The New PowerBooks

31 01 2005

The new PowerBooks are out! No G5 yet, of course, just a speed bump and some other small enhancements, in any case an upgrade might be desirable.





Moleskinerie

31 01 2005

Since I got my first Moleskine notebook, I've been using it more and more. I'm keeping all my to-do lists there and it's starting to become second nature to me.

Today (via Ted Neward) I discovered the Moleskinerie blog and immediately subscribed to it. Nice.





Why Jotspot?

30 01 2005

Gianugo:

I’m uncomfortable, though, with a site aiming to be a reference for Open Source projects yet probably running on non-OpenSource software: isn’t there enough dogfood available?

Well, for one thing, Jotspot seems to have a range of features (think of structured data) that other wikis lack.

Second, my time is limited and I very much value having an hosted service that is ready to use. This is why I simply started by writing a review on this blog. I don’t want to start a new software development project and be dragged down by bike-shed type of arguments.

Third, I think having open data is more important than having open source, for this kind of endeavour.

In any case, nothing has been set in stone. I’m just going to take Jotspot for a ride for a couple of weeks and see whether it fits the bill or not.





New domain for Source.zone

29 01 2005

Source.zone logoI’ve just registered and activated a new domain for the Source.zone initiative: sourcezone.info. I’ve put there a temporary home page while I’m waiting for the activation of a beta Jotspot account in order to start creating and organizing content and services.

As you can see, I’m dead serious about this stuff and would like to renew my call for contributions. What we badly need to start is content, essentially reviews of Open Source projects.





The Scoble Effect

28 01 2005

This is what you get when a prominent blogger like Scoble links to you, then News.com links to both Scoble and you and finally Dave Winer links to News.com linking to you:

graph_daily_summary.png

Nice. Now if only I could get such inbound links to content more interesting than making fun of Microsoft, that would be great :) .





1,000

27 01 2005

Congratulations to the visitor from Etobicoke, Ontario, Canada, who hit this weblog at 22:50:46 CET. You are the 1,000th visitor today!





What Software for Source.zone?

27 01 2005

I just started to think about building something to support Source.zone. There are basically two options: build or buy?

Should I decide to build, I could hack together quickly a webapp using my power trio (Cocoon, Spring and Hibernate), but then I'd have to maintain it in my spare time, and I would need to find some (cheap) hosting provider with the necessary support.

On the “buy” side, I currently see two candidates:

Confluence
Looks great and being Java-based and provided with full source code, could be hacked into doing just what we need. But then again I would have to find the time to hack it and a place to host it.
Jotspot
No source, but from its feature list it looks like a perfect fit. And it's a hosted service, which is great since we can have it up and running in no time.

For a start, I've requested a beta account on Jotspot. If you have any suggestions, please leave a comment.





Apache Cocoon Review

27 01 2005

Apache Cocoon Logo

Apache Cocoon is a web development framework built around the concepts of separation of concerns (making sure people can interact and collaborate on a project, without stepping on each other toes) and component-based web development.


Cocoon implements these concepts around the notion of “component pipelines”, each component on the pipeline specializing on a particular operation. This makes it possible to use a “building block” approach for web solutions, hooking together components into pipelines without any required programming.


Cocoon is “web glue for your web application development needs”. It is a glue that keeps concerns separate and allows parallel evolution of the two sides, improving development pace and reducing the chance of conflicts.

The website explains quite nicely what you can expect from Cocoon,doesn't it? The problem is that, on the other hand, it does a lousy job of explaining in clear and comprehensive terms how you are expected to work in order to reap all those benefits.

As we all know, great documentation is not a selling point of many Open Source projects, and Cocoon is not different in this respect. Add to it the fact that it is a complex, evolving framework that sometimes gives you too many options when you have to implement something, and you'll begin to understand why the docs, to put it bluntly, largely suck.

Alas, all is not lost. You have a users' mailing list for you beginner's questions and a developers' mailing list where you can discuss Cocoon internals and more esoteric issues. You can expect to find a quick and detailed response on either. Even beginner-level requests for support are not shunned on the dev list, as is the case with some other projects I know of.

Other valuable resources are books (a bit outdated though) and articles that you can find online.

Also, if your pockets are deep enough, you can hire very good consultants to hold your hand while you're dipping your toes in the water for the first time.

To sum it up, don't be put off if at first you're having some difficulties. With a good knowledge of Java and XML, and maybe some external help, you can surpass them quickly.

Well, enough about lack of docs and on to the good stuff.

I started using Cocoon back in the days of version 1.7 (1999 circa) and never stopped. I have developed maybe twenty projects with it and done my small share of contributions, in the spirit of Open Source, that gained me committer status back in 2003, of which I'm very proud.

There are lots of gems in Cocoon, but I would like to draw your attention to a couple of them, in particular: Forms and Flowscript.

The Cocoon Forms framework is one of the more elegant toolkits for doing web-based forms that you can find. It embodies perfectly the Separation of Concerns philosophy of Cocoon, allowing one to separately define form model, definition and appearance.

Continuations-based Flowscript is something that will really revolutionize the way you develop web applications. Without it, implementing complex control flows for the web is a daunting task, forcing you to implement finite state machines and tricks like hidden form fields in order to overcome the inherent statelessness of HTTP. I cannot explain the concept of continuations in this review, but I can assure you that once you get the hang of it, you will never ever want to come back. For an in-depth look, I can refer you to a recent article on developerWorks.

The other great thing about Cocoon is not in the code. It's the community. You won't easily find a community of developers that is like Cocoon's. The best way to appreciate it is to participate in the annual GetTogether event.

Now for some less enthusiastic notes. What I like less about Cocoon is the fact that it's based on the Apache Avalon framework. Avalon was one of the first examples of a framework based on Inversion of Control, and was great for its time, but nowadays it looks quite dated if you compare it to something more modern and less invasive, like Spring or Hivemind.

Should you be worried about this? Not at all. First, you're not supposed to be an Avalon expert to use Cocoon. You can develop a wide range of applications without ever implementing a custom Avalon component. Personally, I like to develop applications by implementing all my business logic with Spring and persistence with Hibernate, using Cocoon's Flowscript to take care of, roughly, the controller part of the MVC triad, and Cocoon's generators, transformers and serializers to implement the view part.

In conclusion, I cannot give Cocoon less than five stars, given how much it has helped me in the latest years. It has its shortcomings, but who hasn't, and you can see them as part of its overall philosophy. There's a Cocoon Way of doing things, and you can bend it, but to a point.

Highly recommended.