This week's book giveaway is in the Design forum.
We're giving away four copies of Experimentation for Engineers: From A/B testing to Bayesian optimization and have David Sweet on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Why cant we declare business methods in session beans?

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to get be clarified , why cant we decalre the business methods in homeinterface like remote interface in session beans.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Not sure about this but intutively I can say, :roll:
If we declared business method in Home Interface of session Bean. Then bean provider need to define those method in Session Bean.In that case the specification needs to mandate the bean provider to implemenation business method in such a way that it should maintain the client specific details.(Line in the case of Stateful Session Bean client specific details are managed by container). And the client specific details are attached to the session bean but not the Session Home.

So ultimately you have to define the business method in Component interface(which extends EJBObject)

Hope it helps.....
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The home interface for creating instances of the beans, why do you want to put business methods in the home interface? It is a different case for entity beans, because with entity beans you would want to do non-bean specific things for which you need to write business methods in the remote interface.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I have something to add here.
Though it is based on intuition rather than information.
Its actually the container which implements the Home interfaces and creates
concrete classes and stubs which are used by clients.In case of entity beans
the container expects Business methods in home and accordingly generates the implementation class to handle such business mehthods. If we try to add home methods in the session bean home the container has no directions from the spec about how to handle this.It might give you a specific error saying that it is not allowed or it might quietly generate the implemention class and give you compile time error saying that the generated class does not implement all the methods from that home interface or anything might happen.
You can try this scenario in various app servers to confirm.
I will try it as soon as i can and will give you updates.

Regards
Harsh Gupta
 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic