• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Bean implementing Interface with business methods

 
Sub swamy
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • 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.
 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic