What about business interface in EJBs ?

Hi,

I like the new EJB support, but I'm missing support for the "Business
interface" design pattern. This pattern solves the problem that the EJB
spec prevents us from letting bean implementation implement the business
interface directly.

It's very simple: Instead of defining all business methods on a bean in the
Remote interface, you define a Business interface with these, which do not
extend EJBObject. You then let Remote interface extend both business
interface and EJBObject interface.

This way, you can let your Bean implementation implement Business interface,
and have javac-compile-time checking on method signatures.

It has been documented in patterns catalog and theServerSide long time ago:
- http://www.c2.com/cgi/wiki?BusinessInterface
- http://www.theserverside.com/patterns/thread.jsp?thread_id=1322

I believe this pattern is used by really many EJB developers around the
world, so even though it not part of the standard, I think it could still
be appealing to many IDEA users! (what you say?)

Maybe it could be as simple as extending the "IDEA Options->EJB Names"
dialog with a "Business interface name" and a "Business interface enabled".
And if enabled, IDEA would e.g. suggest to add new public methods in EJB
implementations to business instead etc.

??

Regards, Per

1 comment
Comment actions Permalink

Maybe it could be as simple as extending the "IDEA Options->EJB Names"
dialog with a "Business interface name" and a "Business interface

enabled".
That would help, +1.

And if enabled, IDEA would e.g. suggest to add new public methods in EJB
implementations to business instead etc.

This one is already there, I was quite happy when I discovered it (in 636, I
don't know when they added it). If your remote interface extends a business
interface (and the bean class implements that), the intention pop-up you get
when you write a public method in the bean class lets you choose between the
remote and business interfaces as the destination for the new method
declaration. They nicely add a RemoteException to the signature (if you deal
with remote interfaces), copy the javadocs, the whole 9 yards, you know. :)

It's quite nice, give it a try.

HTH,
Andrei


0

Please sign in to leave a comment.