EJB Assembly diagrams

Enterprise JavaBeans (EJBs) can be used in multiple distributed applications, and distributed apps often consist of several EJBs. Together's EJB Assembly diagram enables you to model the way EJBs are assembled into an application. You can show method permissions for the business methods of EJB classes and link these to security roles that you define.

EJB Assembly diagrams are not supported in all products. For current product information, please visit www.togethersoft.com/together/ or contact the TogetherSoft sales office nearest you.

The EJB Assembly diagram is a visual equivalent of the "Application Assembler" described by the EJB 1.1 Specification. According to the specification, the assembler "assembles enterprise beans into a single deployment unit." It provides application assembly information to the "Application Deployer"... which is represented in Together by the EJB Deployment Expert. According to the specification...

"To make the Deployer's task easier, the Application Assembler (which could be the same party as the Bean Provider) may define security roles for an application composed of one or more enterprise beans. A security role is a semantic grouping of permissions that a given type of users of the application must have in order to successfully use the application.

The Applications Assembler can define (declaratively in the deployment descriptor) method permissions for each security role. A method permission is a per-mission to invoke a specified group of methods of the enterprise beans' home and remote interfaces. The security roles defined by the Application Assembler present a simplified security view of the enterprise beans application to the Deployer-the Deployer's view of the application's security requirements is the small set of security roles rather than a large number of individual methods."

--EJB 1.1 Specification, p. 224

Creating and drawing EJB Assembly diagrams

If you need to learn how to create new diagrams in a project, or the techniques for placing elements and drawing links, consult the User's Guide topics found under " Working with Diagrams: Basic Diagram Techniques" in the Table of Contents. See related topics below.

Content

EJB Assembly diagrams contain:

Notation

The EJB Assembly diagram is not specified in the UML. It is specific to Together as part of the product's EJB development support.

Key elements and properties

EJB shortcuts

A key difference between this diagram and other diagram types is that one key element of the diagram is not placed into the diagram using the Diagram toolbar. You need to create a shortcut to each EJB you want to show in the assembly diagram (more information below).

Security Role

An application assembler can define one or more security roles... meaning recommended security roles for the EJB's client(s). The Security Role elements in an assembly diagram present a simplified view of the EJB app's security to the app deployer (i.e., the EJB Deployment Expert).

You can create a Security Role element in EJB Assembler diagrams the using the Diagram toolbar:

Method permission

Enables you to show the required permission(s) on one or more methods. Represents a binary relation between the security roles and the methods of an EJB's home and remote interfaces. Represents a permission required to invoke methods on these interfaces.

You can create a Method Permission element in EJB Assembler diagrams using the Diagram toolbar:

Container Transaction

Enables you to define the transaction attributes for the methods of an EJB's home and remote interfaces. When linked to one or more EJB methods, it specifies that the linked method(s) are assigned the transaction attribute value defined in the Container Transaction element's properties (Alt - Enter). All methods linked to a single Container Transaction element should belong to a single bean.

You can create a Container Transaction element in EJB Assembler diagrams using the Diagram toolbar:

Assembly Link

Drawn between diagram elements to show their relationships in the application. You can create an Assembly Link element in EJB Assembler diagrams using the Diagram toolbar:

Working with EJB Assembly diagrams

Outside of the basic mechanism of drawing diagrams, there are several conceptual things you should understand about EJB Assembly diagrams:

Creating EJB shortcuts

By the time you are ready to assemble one or more EJBs into an application, you should have the finished EJBs in your Together project. If you want to use the EJB Assembly diagram to specify security roles, method permissions, etc. for deployment, you need to display the relevant bean(s) in the Assembly diagram. You do this by creating one or more shortcuts to the finished EJB(s) that comprise the application. A shortcut is just a visual representation of some element that "lives" somewhere else in the project.

To begin:

  1. Create a new EJB Assembly diagram, or open an existing one in the project that contains the EJBs for the application (File | New Diagram).

  2. If you want to include EBJs that are not part of the current project, specify the path(s) to them in the Search/Classpath tab of the Project Properties dialog (File | Project Properties - Advanced).

To create a shortcut:

  1. Right-click on the background of the open EJB Assembly diagram and choose Add shortcut.

  2.  In the Add Shortcuts dialog, expand the Model node and locate the EJB classes and interfaces from your project which you want to display in the diagram. Select them in the tree view and click Add.

  3.  In the Add Shortcuts dialog, expand the Search/Classpath node and locate the EJB classes and interfaces from outside your project (if any) that you want to display in the diagram. Select them in the tree view and click Add.

  4. Click OK to display the selected EJB(s) in the diagram. Tip: Run auto-layout from the diagram speedmenu at this point.

How EJBs are displayed in the diagram

EJBs are displayed in essentially the same kind of visual container as the Class diagrams. The various methods show as elliptical objects within the Class framework. These objects exhibit highlighting when there are link sources or targets. See figure below:

 

How an EJB displays in Assembly diagram

Showing and hiding EJB elements

When creating your EJB shortcuts in the Assembly diagram, can you select home or remote interfaces, or primary key classes in the selection dialog. If they don't appear in the diagram, it means that your View Management option settings are hiding them. These elements are hidden by default, and you need to change the settings if you want to see them. To preserve the settings at the project level, you can just change them for the specific diagram.

  1. Right-click the diagram background and choose Diagram Options.

  2. Select the View Management page tab and navigate to the Show node.

  3. Expose the EJB-related options and check those elements that you want to display in the current diagram.

You can can also hide individual elements in the diagram using the Hide command from the element's speedmenu. Restore with the Show Hidden command on the diagram speedmenu.

Tips for assembly diagrams


How the EJB Assembly diagram relates to the EJB Deployment Expert

Together provides an "expert" dialog that simplifies the process of deploying EJBs. You can run the EJB Deployment Expert against either a Class diagram, or an EJB Assembly diagram.

For information on using the EJB Deployment Expert, see Deploying Enterprise JavaBeans.

See also:

Creating diagrams in projects
Drawing diagram elements
Opening diagrams
Working with View Management