Developing EJBs

Together provides several productivity enhancing features especially for developers of distributed applications using Enterprise JavaBeans ® (EJB). For information about which products provide EJB support, visit www.togethersoft.com or contact your Together Distributor. This chapter describes how to use Together to create, develop, and deploy EJBs.

It's beyond the scope of this documentation to teach EJB fundamentals. Documentation assumes you are familiar with the concepts, terminology, and Java Enterprise APIs, and that you have some experience developing EJBs. If you're just getting started with EJBs, a good resource is Java Enterprise in a Nutshell (2nd edition) by David Flanagan et al, 1999 O'Reilly & Associates. ISBN 1-56592-483-5.

Overview of EJB features

Together acts as a "control center" for EJB development: with it you can model, implement, compile, debug, document, and deploy your EJBs to an app server. Specifically, you can:

How Together simplifies EJB development

If you have developed EJBs before, then you know that the typical development process is something like this:

 

Typical EJB development process & tools

As you can see, the typical process involves a great deal of work that has nothing to do with actually developing business solutions. It adds the learning-curve overhead of a daunting array of different tools that only results in slowing down your distributed application development.

Together's approach to EJB development

Together's EJB development features are designed to speed up the process, get your distributed systems working sooner, and let you to focus on good design and development and robust functionality.

 

 

A major benefit is that you don't have to write deployment descriptors. Together stores bean properties right in the model. You can put bean-specific info into a special diagram type: the EJB assembly diagram, and at deployment time Together packages up everything and deploys to the server. With Together, the EJB development process looks like this:

  • Model, code, and debug your EJB with Together's modeling and development tools. The source code framework stays in sync with visual model at all times.

  • Run Together's EJB Deployment Expert.

The EJB Deployment Expert is a time saver that automates many of the tedious post-development chores into a simple set of steps. The expert will:

  • Compile your EJB classes

  • Generate container-specific classes for any supported app server

  • Generate an XML deployment descriptor and manifest files for the selected server platform

  • Generate a JSP client that you can use to live test a deployed EJB

  • Package everything up into a JAR file written to any location you specify

  • Connect to the app server and deploy.

 

Team Support is built right in

Together's approach fits seamlessly with team-based development. Because all bean information is stored with the right granularity, each EJB contains its own information, so that you can develop EJB's independently of one another. In the traditional approach there is one monolithic file - the "dreaded DD" - and all developers have to work with it. It has to be checked-in/out as a whole.

Configuring Together for EJB development

There are a number of configuration options that you may want to modify depending on where you are in the development process. You may find you want to set options differently depending on whether you are designing, implementing, or deploying an EJB.

Recognize JavaBeans

The Boolean config option Recognize JavaBeans controls whether or not Together recognizes JavaBean classes. This options is set to True by default, meaning that Together treats classes having methods that begin with get or set as JavaBeans. For EJB development, you should set this option to True.

The main menu command Options | Recognize JavaBeans toggles this option. There is a parallel icon on the Main Toolbar. The setting applies at the Default configuration level. (For information on configuration levels, see User's Guide: Configuring Together: Multi-level Configuration.

Diagram detail level

Depending on whether you are in the modeling/design or implementation stage, you may want to change the view management option Diagram Detail Level. The levels are Analysis, Design, and Implementation. Each shows a greater level of detail in the class icons in Class diagrams.

To set this options, choose Options | [level] - View Management - Diagram Detail Level (where level is the menu command for the desired configuration level).

(For information on configuration levels, see User's Guide: Configuring Together: Multi-level Configuration.)

EJB filtering options

You can set view management options that show or hide the following elements in the Class diagrams that contain EJB classes/interfaces:

By default, only EJB classes are shown in Class diagrams. Any elements that are hidden by these settings in diagrams still show up in the Model tab of the Explorer, so you can always tell that they exist in your model and your code.

To modify EJB filtering options:

  1. From the Main menu choose Options | [level] - View Management (where level is the menu command for the desired configuration level).

  2. On the View Management page of the Options dialog, scroll the pane of options until you see the node named Show. Expand this node if necessary.

  3. Check or clear the options as desired. Checking a box means the element should be shown in diagrams... clearing the box means the element should be hidden in diagrams.

Other filtering options

While you have the Show options open, review the other options that apply to classes in general to make sure that you can see what you want to see in your Class diagrams for EJBs.

Configuring suffixes

In the EJB tab of the Options dialog you can specify the suffixes for various types of EJB classes. The suffixes help Together to properly recognize EJB's. If a project is created outside Together, class names may not follow the Together conventions. You can enter specific suffixes for your EJB classes:

Other configuration options

Before using Together for EJB development, you may want to review your entire configuration, especially View Management's Show Beans options for Java (Options | [level] - View Management - Java).

If your license supports Together's advanced Editor features, and you will use this editor for EJB development, you may want to configure the Editor as well. (For more information, see User's Guide: Using the Editor.)

See also:

Deploying Enterprise JavaBeans
Deploying EJBs to BEA Weblogic Server
EJB Assembly diagrams