Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

home methods  RSS feed

 
Ajit Kumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
If there is a method in the bean class. Under what circumstances would we consider to make it available as part of the home interface?
I happend to come across an example where a findby method is made available through the homeinterface. Usually methods that are meant to be used by the clients are made available through the remote interface.
I would appreciate if any one clears my doubt.
thanks
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Here is what I understand: The Home interface provides methods for clients to get a hold of an EJB. Either by creating new ones, or finding existing ones.

Once you then have an entity bean reference, you can use the Remote interface to run business methods on them.
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajit,
You can only define finder and create methods in the HomeInterface.
The primary purpose of the HomeObject is to act as a factory for the EJBObject.So it needs to have method/responsibities to make available the EJBObject instances to the client - The EJB specs stipulates the finder and the create methods as the only means to do it.
Hope this helps.
Regards,
------------------
Sandeep

  • Sun Certified Programmer for Java 2 Platform Scored 93 per cent
  • Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  • IBM Enterprise Connectivity with J2EE Scored 72 per cent
  • Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
 
Michelle Baxter
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are also methods referred to as "home methods" in the home interface (sorry if the term is confusing). These can be used when a particular bean reference is not needed to do the work, kind of like a static method of a class. These methods names should NOT start with "find" or "create". They also will have a corresponding ejbHomeXXX method in the bean class. So for example, if I have a method in my home interface called getSomeStuff(), I would have a method in the bean class called ejbHomeGetSomeStuff(). This is probably not what you are looking for, but you should be aware that it is available. It's in the EJB 2.0 spec, if you want to read up on it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!