Thursday, October 05, 2006

EJB 3

I've been working with Hibernate 3 using hibernate-annotations.

This was really just a fluke, I needed solid O/R mapping and my previous experience with Hibernate was very positive. In addition, I've fallen in love with Java Annotations and didn't want to deal with any messy XML files to define my mappings.

I was amazed at how easy it was to create persistant objects. Within a matter of an hour or so I was cranking right along, able to add, updated, and delete objects from the database.

In order to do this, I had inadvertantly used the EJB3 standard annotations. It's how the Hibernate folks documented their annotations, so I just went with it.

It's now been a few weeks. I've got my application on a production server (JBoss) running on a public site with MySQL in the background. I've have load tests that confirm nothing horrible is happening. It just Couldn't have been easier to create or maintain.

Then, my friend Chris called and we started talking about Spring. Chris is a serious Alpha Geek and knows his Spring very well. I on the other hand always had a hard time getting with the Spring program. I really wanted to understand what I was missing. From our conversation I realized that Spring would probably be a help for my server side components, so I started thinking about what Spring could do for me.

Then Chris sent me the following: http://www.infoq.com/news/spring-ejb-3-compared

All of a sudden I realized I was doing full blown EJB3 and didn't even know it. Although I was only doing one small part of EJB, it's a pretty important part and it looks like the rest is as easy as what I've already done. In the old days, when one wrote EJB code, they knew they were writting EJB code. I think the EJB folks heard the cries of the community and did the right thing here. Now I feel I can use EJB3 to do the things I was considering using Spring for beyond the database (really can't wait to play with Session Beans).

0 Comments:

Post a Comment

<< Home