[jboss-user] [EJB 3.0] - Re: Simplest possible stateless bean

Renen do-not-reply at jboss.com
Wed Sep 26 13:26:13 EDT 2007


Hi Wolfc,

We had a holiday down here (za) so I haven't been at my computer.

I understood one of the overriding drivers of the EJB3 evolution was to simplify things, to make better use of defaults, and to reduce the barrier to entry required to get EJBs up and running.

I think I had hoped that things would have shifted such that you can start life with a POJO, and then gradually add EJB functionality. For example, by adding the stateless annotation.

For example, that interface you refer to: my EJBs are all local (as I suspect / hope 99% of the EJBs on earth are), so I only really need one interface. Right clicking and selecting extract interface isn't too tough, but now I have to evolve two chunks of code (the class and the interface) rather than one. Just makes things that much harder to get right and tougher to refactor. Development is shatteringly expensive. Anything that makes the process simpler, quicker and faster must be a step in the right direction (mind you EJB3 vs EJB2 is clearly a massive step in the right direction!).

JNDI is another great example of a sensible idea - but one that makes things much more complicated than it needs to be. I'd guess that a massive fraction of developers simply cut and paste boilerplate code and guess their way through the naming exercise... And, I'm sure it could be neatly tucked away with clever defaults that can be overridden when you need to.

For example: your multiple shopping cart example: I'm sure most people start with one, and only add a second over time. Why not create a default JNDI reference initially and allow me to mutate this as my project evolves? In fact, I'd guess that most people stumble completely on the JNDI configuration hurdle and instead simple setup two JBOSS servers (which, for better or worse), is what I did ;-(

Anyway, when all this stuff works, it works very sweetly. So, for all my winging, I'm still an advocate.

Next time I might pay a little more attention to the standard setting process. Ruby anyone?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088953#4088953

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088953



More information about the jboss-user mailing list