Using EJB to Construct UML Diagrams
This section discusses the example EJB with which you shall create your UML diagrams (based on the UML profile for EJB specification). You'll create UML diagrams for the example EJB in subsequent sections. The UML Profile for EJB specification defines the mapping of EJB components (the Java class files, the deployment descriptors, and the EJB JAR files) to UML diagrams. You'll be using an example Entity EJB representing a Catalog to create UML class diagrams.
Listing 1 shows CatalogBean.java, the EJB's bean class. CatalogBean.java consists of getter and setter methods for the entity bean CMP fields, the create and postCreate methods, and the callback methods of the EntityBean interface.
Next, you've got the Entity EJB home interface, CatalogHome.java, which consists of the create, findByPrimaryKey, and the finder methods (Listing 2).
CatalogRemote.java, the Entity EJB remote interface, consists of the getter methods for the primary key CMP fields and the getter and setter methods for the non-primary key CMP fields (see Listing 3).
The Entity EJB's primary key class, CatalogPK.java, consists of the the class constructors, the getter methods for the primary key CMP fields, the equals method, and the hashCode method (see Listing 4).
So there's your example EJB. Now it's time to learn how to create the UML diagrams representing the different views of the EJB.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|