• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JEE 5 and business delegate pattern

 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Yegor Bugayenko
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rajan Choudhary
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Yegor. I had similar dilemma in last few days but I have decided to use it.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic