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
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.
EJB Assembly diagrams contain:
Shortcut(s) to one or more EJBs.
Security roles and method permissions
Container transaction elements
Assembly links (showing relationships of assembly elements)
Notes and Note Links (for documentation)
The EJB Assembly diagram is not specified in the UML. It is specific to Together as part of the product's EJB development support.
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).
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: ![]()
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: ![]()
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: ![]()
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: ![]()
Outside of the basic mechanism of drawing diagrams, there are several conceptual things you should understand about EJB Assembly diagrams:
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:
Create a new EJB Assembly diagram, or open an existing one in the project that contains the EJBs for the application (File | New Diagram).
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:
Right-click on the background of the open EJB Assembly diagram and choose Add shortcut.
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.
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.
Click OK to display the selected EJB(s) in the diagram. Tip: Run auto-layout from the diagram speedmenu at this point.
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 |
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.
Right-click the diagram background and choose Diagram Options.
Select the View Management page tab and navigate to the Show node.
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.
The Properties Inspector of a Container Transaction element (speedmenu | Properties) enables you to define the transaction type (Supported, Not Supported, Never etc.)
The Properties Inspector of a Security Role element (speedmenu | Properties) enables you to define the name of the element.
You can create a link from a Security Role to one or more Method Permission(s). This defines method permissions for the Security Role.
If an EJB defines any Security Role Reference(s) (shown in the last compartment of the EJB icon in the diagram), all of them must be linked to Security Role elements.
Each Security Role Reference must have one and only one link to some Security Role element.
One Security Role element can be associated with null to many EJB Security Role References.
A Security Role element must be associated at least with one Method Permission element.
A Container Transaction element can be linked to an EJB icon as a whole, and/or to sub-icons representing methods (see previous figure).
If a Transactional Attribute is linked to the EJB icon, it means the corresponding transaction type will be used as default for all methods.
If a Transactional Attribute is linked to method(s), it means that the corresponding transaction type will be used for the linked method. It overrides default value defined above.
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 "fast track" deployment with default values, or deployment prototyping, use the Expert from an appropriate Class diagram.
If you need "full featured assembly information" with control over security and permissions, use the Expert from an EJB Assembly diagram.
For information on using the EJB Deployment Expert, see Deploying Enterprise JavaBeans.
Creating diagrams in projects
Drawing diagram elements
Opening diagrams
Working with View Management