| Author |
JEE 5 and business delegate pattern
|
Ranganathan Kaliyur Mannar
Bartender
Joined: Oct 16, 2003
Posts: 948
|
|
Hi,
I read this post earlier about obsolete patterns after JEE 5
http://www.coderanch.com/t/156191/java-Architect-SCEA/certification/Obsolete-Design-Patterns-EJB-SCEA
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?
|
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
|
 |
Yegor Bugayenko
Ranch Hand
Joined: Feb 11, 2011
Posts: 54
|
|
|
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, OCUP
Lead Architect of fazend.com - Free Hosted Continuous Integration Platform
|
 |
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
Bartender
Joined: Oct 16, 2003
Posts: 948
|
|
|
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
Greenhorn
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.
Thanks
|
 |
 |
|
|
subject: JEE 5 and business delegate pattern
|
|
|