Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

JEE 5 and business delegate pattern

 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I read this post earlier about obsolete patterns after JEE 5
https://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?
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
"To do good, you actually have to do something." -- Yvon Chouinard
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic