Insert Witty Irony Here

vince kraemer's Weblog

All | 5 in 5 | Compile Time | Ease of Evolution | General | GlassFish | Gotchas | Java | Music | NetBeans

20060331 Friday March 31, 2006

Finally, somebody with advice on evolution I saw this entry on The Aquarium. It points to an article in Java Pro (volume 9, issue 6) that talks about migrating apps to the EJB 3 business logic model.

I read through it.

I think the author did a great job of showing folks how to rewrite their app to use EJB 3. If you need that kind of advice, it will be very helpful.

I am still looking for information on a more conservative approach; one that involves evolutionary changes to existing code, not complete rewrites. (2006-03-31 01:00:48.0) Permalink

20060328 Tuesday March 28, 2006

EJB 2.1 local interface != EJB 3.0 local business interface The LocalHome is the business interface?

No, but kind of....

My brother was working on writing a Java EE 5 client of a J2EE 1.4 stateless session bean to test this basic evolution use-case when he discovered this the hard way. The first test that he did was to use the @EJB annotation in a servlet to access a J2EE 1.4 bean [an EJB 2.1 bean].

I have to admit that he did not read the EJB 3.0 spec regarding "how" to do this... Since Java EE 5 is about 'ease of development', he figured, "How hard could it be. I define the business methods of an EJB on its local (or remote) interface, so I would write something like

    @EJB com.sun.brotherofvbk.eoetest.SessionBeanLocalInterface bean
    
to call business methods of my J2EE 1.4 EJB inside my Java EE 5 servlet"

BZZT! Wrong. Thanks for playing.

Despite the fact that a number of folks consider the Local or Remote interface of a J2EE 1.4 EJB to be the correct place to define business methods (or interface) of an EJB, IT IS NOT A BUSINESS INTERFACE. [See "JSR 220: Enterprise JavaBeans™,Version 3.0 EJB Core Contracts and Requirements", Proposed Final Draft, section 3.4]

When you use injection for existing EJBs that are implemented against the 2.1 (or earlier) specifications, you must inject the appropriate Home interface. You can then call methods on that interface. My brother would recommend that you call create() and then call the business method that you wanted to actually execute...

All of this is spelled out in the EJB 3.0 "core" specification in section 3.6.1.

So, as the Type-it brothers would say, "Don't code like my brother" (2006-03-28 13:17:20.0) Permalink

20060308 Wednesday March 08, 2006

Casting a wider net for comment on J2EE 1.4 -> Java EE 5 Evolution I have been posting to some forums around the Java and Enterprise Java spaces to see if people have thoughts on "How" to evolve J2EE application and modules into the Java EE 5 applications and components.

You can see what I have been asking by following the links from here.

If you are a del.icio.us user, please tag stuff that you find with appEvolution.

If you are part of a community where such a question would be appropriate, please send me a link to the community's fourm or post the question yourself. Feel free to tag the thread with appEvolution. (2006-03-08 08:46:59.0) Permalink

20060304 Saturday March 04, 2006

What I want you to find here I started this category a while ago. My intent was to look at strategies for taking existing J2EE 1.4 applications and modules and extending them to use and interact with Java EE 5 features, modules and applications.

I haven't made much progress.

I have started a couple threads that I hope will start a discussion about this issue though. You can find them by looking at this del.icio.us page. (2006-03-04 10:39:10.0) Permalink

Calendar

« May 2008
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
11
12
13
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
       
Today

RSS Feeds

XML
All
/5 in 5
/Compile Time
/Ease of Evolution
/General
/GlassFish
/Gotchas
/Java
/Music
/NetBeans

About Me

Photo of Vince Kraemer
Short Bio

Search

Links


Navigation



Subscribe with Bloglines Add to Technorati Favorites

Referers

Today's Page Hits: 246