Chapter 14 Working with Java
An EJB comprises a number of specific interfaces and implementation classes. Interfaces of an EJB are always exposed, you define a public interface and expose it. You can attach an interface or class to only one EJB at a time.
EJB component interfaces are shown as circles linked to the EJB component side by an horizontal or a vertical line:
Interfaces provide a remote, or a local view as shown in the table below:
View | Interface |
---|---|
Remote view | Remote home interface Remote interface |
Local view | Local home interface Local interface |
The symbol of an interface can be moved, and the link from the EJB component to the interface can be extended. When an interface realizes an EJB component, the interface is necessarily visible.
Displaying the interface properties
You can double-click the circle, symbol of an interface to display the interface property sheet.
Classes have no symbol in the component diagram, unlike interfaces. However, the relationship between the class and the EJB component is visible from the Classes page of the EJB component property sheet, and from the Components tabbed page in the Dependencies page of the class property sheet.
The following table displays the stereotypes used to automatically identify EJB interfaces and classes:
Stereotype | Describes |
---|---|
<<EJBRemoteHome>> | The remote home interface |
<<EJBRemote>> | The remote interface |
<<EJBLocalHome>> | The local home interface |
<<EJBLocal>> | The local interface |
<<EJBEntity>> | The bean class of an entity bean |
<<EJBSession>> | The bean class of a session bean |
<<EJBMessageDriven>> | The bean class of a message driven bean |
<<EJBPrimaryKey>> | The primary key class of an entity bean |
A naming convention is a common model option that you can define in the Model Options dialog box. It is useful to set rules in order to enforce predefined name formats for all the objects within a model. You can specify naming convention for related interfaces and classes in your object language in the Settings→Namings category, available from Language→Edit Current Object Language.
For more information on naming conventions, see section Defining naming conventions, in chapter Managing Models in the General Features Guide .
Template names are instantiated with respect to the corresponding component and assigned to the newly created objects. If an unattached interface or class, matching a given name and classifier type already exists in the model, it is automatically attached to the EJB.
To define an interface or a class for an EJB:
Copyright (C) 2005. Sybase Inc. All rights reserved. |