Meaningless Drivel is fun!
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes JEE 5 and business delegate pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "JEE 5 and business delegate pattern" Watch "JEE 5 and business delegate pattern" New topic

JEE 5 and business delegate pattern

Ranganathan Kaliyur Mannar

Joined: Oct 16, 2003
Posts: 1101

I read this post earlier about obsolete patterns after JEE 5

Still, I am not sure about whether to user business delegate patterns. During the times of EJB 2.1, business delegate would primarily be used to catch the RemoteException. But, it also provided a layering - so, if I had to change the presentation layer from web to desktop, I could do it easily.

Now, I read that @EJB injection can be done in servlets and JSF managed beans. Now, if I write a delegate and call it from within my JSF, can I still use @EJB inside the delegate - will the container support it?

I have to decide my class design based on this - question is whether to include business delegate or not?

Yegor Bugayenko
Ranch Hand

Joined: Feb 11, 2011
Posts: 79
I included it in my exam, even though EJB 3 was used. I think that Business Delegate pattern is not obsolete. It's a good mechanism of decoupling of concepts, in a distributed environment.

SCEA, PMP, read my blog:
Rajan Choudhary
Ranch Hand

Joined: Mar 17, 2011
Posts: 196
I agree with Yegor. I had similar dilemma in last few days but I have decided to use it.
Ranganathan Kaliyur Mannar

Joined: Oct 16, 2003
Posts: 1101

I have decided not to use it. This is because with EJB3, the location of services differs from web-based code and a stand-alone one. So, even if I have a business delegate and do DI for EJB3, I won't be able to use that for a Java desktop app. I have to write a JNDI lookup again. So, I decided to leave it out.
Luciano Assis

Joined: Apr 30, 2008
Posts: 16
Hello Ranchers,

I'm at part 2 right now and really wants to use Business Delegate.

The question is: How can I use DI on my POJO Delegate? Because I don't want to use a Service Locator to lookup my EJBs.

I agree. Here's the link:
subject: JEE 5 and business delegate pattern
jQuery in Action, 3rd edition