Developing JSF/EJB3.0 apps with NetBeans 5.5

So far I have been very impressed with the EJB3.0 support in Netbeans 5.5. The more I use it the more I am impressed. I am having a couple of migration issues from Eclipse, like hotkey shortcuts I used regularly in Eclipse and having to find the equivalent, but on the whole, Netbeans 5.x is a very slick IDE.

I have been prototyping a EJB3.0 app and decided to give the ‘JSF pages from Entity Beans’ option a try. Wow, what a cool feature. I haven’t got into JSF yet, so this will give me a headstart. Select the Entity Bean from the wizard and it generates standard CRUD page functionality for the bean. Very cool.

I’m having a couple of issues deploying the app to JBoss 4.0.4RC1 so far though, and since I’m not familiar with JSF yet, I’m stuck for how to fix it, so I logged a bug on the NetBeans site.

74383: JSF from Entity Beans – does not deploy to JBoss – I’m getting a deployment error when my app is deployed to 4.0.4RC1. Not sure what this is about.

Desgin approaches to EJB3.0 apps

DeveloperWorks have an article that introduces a design approach for applications using the EJB3.0 spec and the JPA API.

The approach outlined in this article suggests using Stateless Session Beans as your DAOs, using the JPA API directly in order to manipulate your Entity beans.

While this is ok and it works, I am not sure that this approach gives you the best separation of concerns. Sure, the Session bean has long been used for it’s main purpose to demarcate transactions with CMT (even prior to EJB3.0), but this feature can still be used if you lift is persistence code out of the bean implementation itself and put it in a persistence specific DAO class.

Locating classes in Jars

This is a problem at some point in time we all run into – I have this Class, now what Jar is it coming from, or what Jar do I need to provide this class?

JarFinder.com have an online Jar search engine that searches the Jars from most well known Java projects and displays a list of most likely results. This is an awesome service to have in your back pocket for when this problem comes up next time…

Could decent tooling support for Ruby on Rails accelerate its acceptance?

A common theme at The Server Side Symposium and EclipseCon this week was how to make Java more ‘Ruby on Rails’-like. RoR has made a big impact on showing how simple the development of database driven web apps can be, so simple in fact that it makes our typical multi-layered Java application approaches like almost ridiculous.

In an interview with the developer of RoR, David Heinemeier Hansson, he comments on dynamic languages in general and how they are pressuring Java to adapt and change, in that dynamic languages such as Ruby are a ‘better, faster, and free way for a huge chunk of possible applications”. This is surprising to me, as I consider dynamic languages, in particular scripting languages great for getting some simple, well defined tasks completed quickly, but they are definitely not well suited for other more complex, or enterprise-wide problems. This is the same for statically typed languages such as Java, in that if I had to read a couple of files, parse the content, sort and write out another new file, I probably wouldn’t consider using Java; I would instead use a dynamic language such as Perl or Python.

On the whole, I dislike dynamic languages. I cringe everytime I have to write some Javascript to do something client-side in the browser for a web-app. It is so painful to get things working, to get syntax correct, and to get the results I expect. The reason why? Because the language is dynamic I can change types of variables on the fly, by mistake, and get into all sort of hard to debug problems, plus in order to find any syntax errors I have to run the code (compared to having a compile step with statically typed languages). Debugging – this is also another major hurdle: tool support. With decent tools, Javascript development could be easier, but I really struggle with the basic debuggers that are available compared to debuggers in Java IDEs like Eclipse and NetBeans.

This brings me to this conclusion: given decent, full featured development tools for Ruby on Rails, could this be what it would take to encourage more developers to move to using dynamic languages? I know we are constantly hearing that developers are already moving to RoR, but I don’t buy it (yet). But if Java developers had an ‘Eclipse for Ruby on Rails’, would this make the language and approach more attractive for Java developers? That said, we still have to realize that the approaches of languages like Java and Ruby are different, and that you have to choose the tool that is most appropriate for the task at hand.