Defining Interfaces and Classes for EJBs

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.

Note:

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



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.

Naming Conventions

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 category, available from Language > Edit Current Object Language .

For more information on naming conventions, see "Naming Conventions" section in the Models chapter of the Core Features Guide.


Created October 7, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com