aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Rules for component interface and home interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Rules for component interface and home interface" Watch "Rules for component interface and home interface" New topic
Author

Rules for component interface and home interface

Karin Paola Illuminate
Ranch Hand

Joined: Oct 18, 2002
Posts: 109
The book Head First EJB says

Rules for the remote home interface
...
Declare one or more home business methods
�Arguments and return types must be RMI-IIOP compatible
�You can have overloaded methods
�Each method must declare a RemoteException
�You can declare your own application exceptions, but they must NOT be runtime exceptions (they must be compiler-checked exceptions)
�Methods can have arbitrary names, as long as they don�t begin with �create�, �find�, or �remove�.


Why can't I start a home business method with "remove"?

The book Head First EJB says also says :

Rules for the remote component interface
...
Declare one or more business methods that throw a RemoteException
�Arguments and return types must be RMI-IIOP compatible (Serializable, primitive, Remote, or arrays or collections of any of those)
�You can have overloaded methods
�Each method must declare a RemoteException
�You can declare your own application exceptions, but they must NOT be runtime exceptions (they must be compiler-checked exceptions � subclasses of Exception, but not subclasses of RuntimeExcepton)
�Methods can have arbitrary names, as long as they don�t begin with �ejb�.


Is it allowed to start a business method with "remove"?


I not only use all the brains that I have, but all that I can borrow. [Laurence J. Peter]
Shiang Wang
Ranch Hand

Joined: Jun 20, 2003
Posts: 96
Your first question - home interface already has remove methods(one for session, one for entity) so what else do you want to remove? Message bean ? MDB doesn't have a home.

Your second question - I guess you might be able to declare a method that starts with 'remove' in component interface since it doesn't violate the rule. But again, it alreday has a remove method in component. Why do you need other remove methods?

Shiang


SCBCD, SCWCD, SCJP
 
wood burning stoves
 
subject: Rules for component interface and home interface