• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Bean implementing Interface with business methods

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As stated in Page 86 of HFEJB - is there any negative impact if we have an empty component interface extending an interface with all business methods which also gets extended by the bean class i.e

A -> Component Interface
B -> Interface with business methods
C -> Bean instance class

What if we have A extend B and C implements B ? Is there any violation of spec here ?

One of the advantages of this design i can think of is, when a reusable jar file is available with classes B,C as required, it would be advantageous for us to use it as a SessionBean.
 
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its perfectly legal and does not violate the spec. One obvioous advantage of this is that the compiler can catch you if the bean class and the component interface do not implement the same set of methods. But this is not that much of an advantage because most IDE's will catch you for this at deployment time. That's why people do not use this configuration mostly. It's very rare to see an EJB designed this way. Another advantage is you could reuse the business interface.
 
Evildoers! Eat my justice! And this tiny ad's justice too!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic