In this sample chapter, Paul Reed takes the same slice of the architectural prototype created in the last chapter, adds additional functionality, and implements it using Enterprise JavaBeans. We'll generate initial skeleton code from the class diagram that we built in Rational Rose, and then begin filling in the code to make the skeleton do something for us.

This sample chapter is excerpted from Developing Applications with Java™ and UML, by Paul Reed.

This chapter is from the book

This chapter is from the book

In This Chapter

In the last chapter we finally saw the fruits of our hard analysis and design
efforts. We crafted a slice of our architectural prototype using a collection of
components that had one requirement: not to rely on a commercial container
product or use Enterprise JavaBeans. In this chapter we move forward and take
the same slice of the architectural prototype created in the last chapter, add
additional functionality, and implement it using Enterprise JavaBeans.

We will do things a bit differently in our approach in this chapter. In the
last chapter we didn't use the benefits that a visual modeling tool has to
offer code generation; in this chapter we will use a visual modeling tool to
generate much of our code. But don't worry. Code generation gives us only
the embryo of the code; we still have to do the hard part: filling in between
the lines.

Our focus in this chapter will be to generate initial skeleton code from the
class diagram that we built in Rational Rose. From there, we have to begin
filling in the code to make the skeleton do something for us.

GOALS

To review the mission of the visual modeling tool as it pertains to
program code generation.

To review the setup issues in preparing to generate program
code.

To review what to watch out for after code generation is
complete.

To explore the code necessary to add additional functionality to the
Maintain Relationships use-case and to implement the solution in a
commercial EJB container.

Next Steps of the Elaboration Phase

Before constructing the first portion of our Remulak solution, let's
revisit again the Unified Process. FIGURE 12-1 shows the process model, with the
Elaboration phase highlighted.

In this chapter we will again specifically focus on building code. This code
will lead to the second attempt at an architectural prototype. The architectural
prototype will be complete at the end of this chapter. At that point the
architecture itself should also be considered complete, and we will have reached
the Lifecycle Architecture milestone within the Unified Process.

Even at the end of this chapter it may seem as though we haven't reached
the Construction phase as the Unified Process defines it. Remember, however,
that each phase slices through all the workflows. The Implementation workflow
deals with building code, and we have most definitely been building code. The
focus, once the Construction phase is entered, will be to incorporate all the
exception handling of every use-case as defined in each package for Remulak. All
the business rules must be implemented as well. Construction is a manufacturing
process that leverages what we have built in the Elaboration phase.

In the Unified Process, the following workflows and activity sets are
emphasized:

Analysis and Design: Design Components

Implementation: Implement Components

The emphasis now is on testing our design strategies for how the code comes
together with Enterprise JavaBeans.