Flash Demo: J2EE Has Never Been Easier!



Some people know me as a J2EE-sceptic. I have some very bad experiences with J2EE (and especially EJBs) from the ancients times of J2EE, when it took like half an hour to create a hello world application and deployment took a couple of minutes (and often failed). I was a developer and then a project manager of a project which was a big firedrill and we've spent lots of nights coding EJBs and deploying them to an unreliable app server (which wasn't from Sun). No, that was not fun.

The times are changing though. It is great to see how much persistence frameworks such as Hibernate and many of the new web frameworks helped J2EE (sorry Java EE) become simplier to use and more powerful. NetBeans together with Glassfish makes the development experience quite enjoyable - I can't imagine anyone using a command line to write EE apps, although I heard some people still do it.

I recorded a short flash demo to show how easy it is to get started with Java EE 5. The generation wizards do not solve all the problems of the world, but are a nice way how to get started with Java EE 5 - you will see how easy it is to customize the web application. I am very excited about annotations in EE 5 and the new Java persistence. All the EE 5 features are nicely supported in development builds of NetBeans 5.5 and the development is so much faster than with previous versions of EE. The amount of code you don't have to write anymore is quite amazing.

There is still time to provide feedback to NetBeans developers before NetBeans 5.5 is finalized (get the daily build, not the beta). So check out my demo and let us know what you think... and remember this is just one of the features which is available.


A CRUD web application in 5 minutes with NetBeans and Java EE 5
Comments:

Can you please be kindly and upload the screencast to your sun blog? My bussiness policy hasn't your personal weblog on it's firewall trusted sites... (we have to work just with a couple of sites open, even google is closed ;) )

Thank you very much!

Posted by Juan Ara on květen 24, 2006 at 01:56 dop. CEST #

wow, really nice demo...i have to try Netbeans, but i have one question - does there exist some plugin similar to Sysdeo tomcat plugin for Eclipse (it is useful e.g. for modifying running application without need to redeploy)?

Posted by Michal Malohlava on květen 24, 2006 at 06:06 dop. CEST #

hehe.. It is nice to play on two tables. :)) Now try that on 2000 tables. :( Well, I did and it took two hours just to generate the list of tables from where you could select tables to generate entity classes. :(((( I'd say that this is not ready to be used in the enterprise world. Sad, but true.

Posted by Kovica on květen 24, 2006 at 06:19 dop. CEST #

Juan: I cannot upload it to my blog, because the size is too large. We will put it to netbeans.org later on.

Michal: I don't know about such plug-in, but you can ask on the mailing list which is smarter then me.

Kovi: Well, this is a nice tool to get you started. But no, it's not good for a database with 1000s of tables - there are other tools to deal with such databases. This one is clearly for simple applications with small databases. Very useful for beginners, though, also as a learning device and for people who want to build simplier web applications (there's a lot of such people - just take a look how scripting languages which solve this particular problem are popular).

Posted by Roumen on květen 24, 2006 at 06:41 dop. CEST #

hehe.. But from what I can see from sources this generation could be very, very, very fast. I bet that getting the list of tables from a database would not take more that 10 seconds (oppose to two hours) :))) How? Beacuse the code behind it uses DatabaseMetaData which is a very slow approach, at least with DB2 that I'm using, for getting data about the database structure. The faster approach would be to directly issue SELECT statements against system catalog. You can do this for DB2 and I'm sure for other databases too. But what the developers tell me, this will not be in the 5.5 timeframe. So, it'll be another year.. :((( Now I need you to press some buttons to get this into NetBeans faster. :))) Maybe not for the 5.5 release, but for some Update releases that will follow. What do you think ?

Posted by Kovica on květen 24, 2006 at 06:47 dop. CEST #

You should ask on the nbj2ee@netbeans.org mailing list - they are actually discussing it there right now because I forwarded your comment :) I think it would be nice to have it, but I also want to have 6.0 soon and postpoing 5.5 means postponing 6.0 :( An update might be a good idea though.

Posted by Roumen on květen 24, 2006 at 06:52 dop. CEST #

Hi, this looks interesting... Do you know if we can build and deploy web apps on another app server as glassfish? I we use sun one app server 7 and 8. Would it work with these?

Posted by Benoit on květen 24, 2006 at 09:27 dop. CEST #

Hi Roman, go to mediacast.sun.com, log in and drop your large files there. It's intended for precisely this sort of thing - large media files that you want to share.

Posted by Tor Norbye on květen 24, 2006 at 06:25 odp. CEST #

I use my own server, because it is very fast, reliable, I have FTP access and can view logs :) Thanks for the advice anyway.

Posted by Roumen on květen 24, 2006 at 06:31 odp. CEST #

Benoit: it will work with any Java EE 5 - compliant app server. Right now Glassfish is the only fully compliant, but Brian has instructions how to make it work on JBoss. The generated code is pure EE 5 code so it will work on every app server once they become EE5-compliant (which may take a while).

Posted by Roumen on květen 24, 2006 at 06:33 odp. CEST #

Geertjan reports he also made it work on Tomcat :) I guess he will blog about it soon.

Posted by Roumen on květen 24, 2006 at 06:35 odp. CEST #

Benoit: I overlooked you wrote you use Sun app server 7 and 8. This demo shows features of EE 5 which is supported only in app server 9 - this is the new Java EE 5 specification (approved recently).

Posted by Roumen on květen 24, 2006 at 06:40 odp. CEST #

To Kovica: As NetBeans uses the DatabaseMetaData is the right way to gather information from database. Its portable. Its up to the JDBC driver implementation how the data is retrieved, so IBM DB2 needs to be enhanced, as you pointed out

Posted by Claudio Miranda on květen 24, 2006 at 06:55 odp. CEST #

Roumen: I see no reasons why it would not work with Sun App Server 7 or 8, as long as JDK 1.5 is used... Same as in Tomcat (whne the instructions are posted:-)

Posted by ludo on květen 24, 2006 at 07:46 odp. CEST #

Oh cool... I thought Sun app server 7 & 8 can't handle JDK 1.5. Sorry for confusion.

Posted by Roumen on květen 24, 2006 at 10:37 odp. CEST #

I don't think it'll work on SJSAPS 7 & 8 since AFAIK they won't perform IoC on your annotations, will them?

Posted by Juan Ara on květen 25, 2006 at 01:19 dop. CEST #

Same as in Tomcat, or on any non Java EE 5 compliant container: you need to use JPA in the same mode as the J2SE mode: no injection of course by the container. My point was that if it works with Tomcat (no IoC there as well, of course ), it should also work in sun App Server 7 and 8 the same way it works on \*any\* J2SE app:-)

Posted by guest on květen 25, 2006 at 09:31 dop. CEST #

The code generator actually generates correct code for tomcat. The code is slightly different for Java EE 5 web module (GlassFish) and J2EE 1.4 web module (tomcat, jboss) but the generator detects the correct version from your project settins. The only manual step needed for Tomcat is to add Java DB Library to your project (this includes derby drivers) - if you are using derby.

Posted by guest on květen 25, 2006 at 12:15 odp. CEST #

Nice then!

I must admit I was wrong :$

Posted by Juan Ara on květen 26, 2006 at 02:14 dop. CEST #

Why does it have to create CRUD pages for each object? Is there a framework out there that just uses one template, and for each object there's a meta object that describes how that object should be displayed. Then just pass this meta object to the template'izer and it renders the CRUD pages. Does that make sense?

Posted by justin on květen 26, 2006 at 06:48 dop. CEST #

Justin: This is a different concept.
  1. It does not use any framework other then the J2EE/JavaEE spec features: mainly JSF and JPA. There is no hidden magic, this is really simple code.
  2. It generates code that you are supposed to read and edit, delete parts you do not need, rewrite some parts, change layout of some pages, whatever you like. Look at the code. You could not do that if there was a generic template to render all objects.

Posted by Pavel Buzek on květen 26, 2006 at 09:48 dop. CEST #

This demonstration really assures me that whole JSF is flawed. Instead of improving the framework so that using it is not _that_ tedious, you go the other way around and create tools for generating code. Sorry, not my cup of caffee. I know one thing for sure, I'd never want to maintain this kind of application. There are already frameworks, that are much smarter. Have a look at Wicket for example.

Posted by earl365 on květen 29, 2006 at 04:36 dop. CEST #

This demonstration really assures me that the whole JSF thing is flawed. Instead of improving the framework so that using it is not _that_ tedious, you go the other way around and create tools for generating code. Sorry, not my cup of caffee. I know one thing for sure, I'd never want to maintain this kind of application. There are already frameworks, that are much smarter. Have a look at Wicket for example.

Posted by earl365 on květen 29, 2006 at 04:37 dop. CEST #

Roumen, this is an impressive demo. Unfortunatly when creating a new application, I first create the classes and then the database schema (using GlassFish), this way is not so easy at this time ;-) Another problem I see with current Netbeans 5.5 is that "hot deployment" is not possible with an EAR on glassfish the same way you are doing it with a WAR (pointing the project's build folder from GF and simply clicking on refresh on the browser). This means that for all enterprise grade applications using netbeans 5.5 you will have to stick with long development cycles (build/package/redeploy) = not very agile as a solution :( Do you plan to work with glassfish team to shorten development cycle ? Would be a key point IMHO to boost Java EE & NB acceptance among enterprises. Rgs, JB

Posted by bjb on květen 30, 2006 at 04:09 dop. CEST #

Hi Roumen, Thing what should be really nice to be added to the CRUD generation: - search page bases on attributes in entity - multiple-record update in table/list pages - the ability to attach a template to the generated files so it contains header, footer etc.

Posted by Marcel Overdijk on květen 30, 2006 at 04:48 dop. CEST #

Fantastic presentation, is there anything like this to use in portals with netbeans ?

Posted by athanazio on květen 30, 2006 at 01:37 odp. CEST #

Post a Comment:
Comments are closed for this entry.
About

Roman Strobl

Search

Archives
« duben 2014
PoÚtStČtSoNe
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today