Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB As Reusable Components  RSS feed

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always heard of EJB described as some reusable components. However, what facilities of EJB does provide reusability? The best thing I can think of is using Deployment Descriptor to customize the bean without touching the code. Furthermore, as EJB doesnt support inheritance other than through ordinary java class inheritance (bean dedicate calls to ordinary java helper classes which perform subclassing), I see little help that EJB provides specifically for improving reusability.

Any comment?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36417
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alec,
EJB provides an interface/facade for reusability. For example, suppose I have a session bean that calculates the number of widgets that fit in a jar. As the caller, you don't have to worry about how this happens, just that it does. You can call my remote EJB remotely (and not have to maintain/copy it at all) or use it locally in your app (as you described.) It's more like reusing a chunk of logic as is than extending/customizing it.

Now suppose my session bean also adds widgets to the jar, removes widgets from the jar and makes new widgets. I'm the only one who has to understand about widgets. The callers only have to understand the API/contract. This is a higher level of reuse than simply reusing a class.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!