Sunday, December 20, 2009

Another tale of how Richard does JavaEE the hard way

Over the last few weeks I have been hacking away trying to create a nice CRUD of some simple tables. And being a old developer I feel the need to get into the guts of things and do thing the 'right way'.

So I create Entity Beans in NetBeans 6.8
Then create Session Bean facades from the JPA Entity Beans
Then furiously start coding backing beans , afraid of using the create JSF 2 pages from Entities wizard because I think it's going to tightly couple my JSF to my JPA Entity beans.
After digging around , complaining and thinking a whole weekend on how this is going to take a full day to create a simple CRUD for three tables, I decided how I would go about this.

I would create the Entity Beans from the existing Database
Create the Session Beans facade from the Entity Beans
Then create the JSF 2 pages from the Entity Classes.
Then hack the JSF controllers generated by NetBeans to use the facade instead. (Will take half a day)

To my amazement I see the NetBeans 'create JSF pages from Entity Beans wizard' does this all for me. And holy cow it seems to allow for lazy loading, so I can handle my 1.2 1000 million record table. What an amazing pattern!

My hat goes off to the NetBeans people. You saved me so much time!

2 comments:

  1. Hi Richard, Very glad to see you found a good way, I guess the time you saved could be used to some more FishCAT testing for GlassFish, ha ...

    Thanks for sharing !

    Judy

    ReplyDelete
  2. Hi Judy,

    thanks. Going to open a Kenai project to show off some real world samples. Actually the company I work for - Enerweb - will supply some sample apps.

    So hopefully I will have a simple sample for all the JSF implementations.

    regards
    Richard.

    ReplyDelete