The purpose of this section is to describe object-oriented
CASE tools. Currently, there are a large number of O-O CASE tools
on the market today. These include Select OMT from Select Software,
Paradigm Plus from Protosoft, Rational Rose from Rational and
With Class from MicroGold Software. We will describe O-O CASE
tools in a general sense without referring to a specific product.
All of these O-O CASE tools are similar in terms of their capability
to create O-O diagrams, text specifications for reports, and code
generation. They differ greatly in terms of their extendibility,
number of supported platforms/operating systems and additional
capabilities, e.g. support for different methodologies and computer
language code generation. Below is a typical user interface of
an O-O CASE tool.
An O-O CASE tool provides assistance to S/W analysts,
designers, and programmer. Alan Fisher in CASE - Using Software
Development Tools [Fisher-90] defines CASE as follows: "CASE
is an acronym for Computer-Aided Software Engineering. The purpose
of CASE is to provide software engineers and programmers with
software-based tools that help specify functional requirements
and architect designs for software applications. A long-range
goal of CASE technology is to automatically generate software
based on designs built with CASE tools." Carma McClure in
CASE is Software Automation [McClure-89] defines CASE technology
as: "A software technology that provides an automated, engineering
discipline for software development, maintenance, and project
management; includes automated structured methodologies and automated
tools." An O-O CASE tool supports an O-O methodology such
as Rumbaugh's Object Management Technique (OMT).
In this tutorial several Microsoft Windows CASE tools will be used. All of these CASE tools support the Rumbaugh OMT notation for class diagrams. All provide the capability to quickly create documentation products including various diagrams and text specifications. Most provide the capability to automatically generate C++ and other languages from a class diagram and class specification. Several provide the capability for reverse engineering. This is automatic creation of a diagram from C++ or other language source code. These tools differ in terms of support for the following:
In this tutorial we will emphasize the similarity of the CASE tools to accomplish the following:
An O-O CASE tools combines the capabilities of a
drawing program and a text editor as depicted below. A drawing
program such as Shapeware's VISIO or Corel's Flow provide excellent
capabilities to create drawing and diagrams. Several drawing programs
have drawing templates to create O-O diagrams such as class diagrams
and state diagrams. However, drawing programs do not have the
text editor or specification storage capabilities to create text
reports.
The major outputs of an O-O CASE tools are diagrams,
text specifications, and source code as shown below. Diagrams
include system diagrams, class diagrams, and state diagrams. Text
specifications include system specification, class specification,
attribute specification, operation specification, and relationship
specification. Source code includes C++, Eiffel, Ada and other
language source code files.
O-O CASE tools greatly assist in documenting an O-O analysis and design. The diagram below shows a simplified life cycle to create O-O documentation. You start with a set of requirements for a system, e.g. Bank Automatic Teller Machine Control System. Using manual tools such as pencil and paper, you roughs out diagrams, drawings, and text specifications. You may create a rough system diagram showing the system and interacting systems. You may create a rough class diagram and class specifications. Then you use automated tools, such as a CASE tool, drawing tool, and a text editor. With the CASE tool, you create a system diagram, a class diagram, and other diagrams. With the drawing tool, you create a system drawing, user interface drawings, and some diagrams that require specialized graphic symbols that are not available in the CASE tool. You use a text editor to create text files to describe and list requirements, test cases, and other lengthy documents. As O-O CASE tools add capabilities, you may find that the O-O CASE tools "does it all". Finally, using a document processor, e.g. a Windows word processor, you group the diagrams, drawings, and text files into a complete set of model documentation. Most O-O CASE tools have sophisticated capabilities to import and export graphic and text objects from other Windows applications.
O-O CASE tools greatly assists in creating an executable
prototype. The diagram below shows a simplified life cycle to
create an executable prototype. First you start with a set of
system requirements such as to model and create a bank account
monitoring system. With a pencil and paper you create rough diagrams
and text specifications. You describe the system graphically and
textually. Then you create the diagrams and specifications in
the CASE tool. For example, you create class diagrams and state
diagrams. You create text specifications to describe classes,
attributes, and operations. Then from the diagrams and specifications
you generate source code from the diagrams and specifications.
Currently most O-O CASE tools generate C++ source code. Many CASE
tools have a scripting language to create specialized scripts
to generate source code for a particular compiler, class library,
and database management system. Typically, the generated source
code must be updated with messages and transformations, e.g. formulas,
expressions, and equations. Then the source code may be compiled,
linked, and run in a programming environment such as Microsoft
Visual C++ or Borland C++ environments. At this point there are
significant iterations of code update, compile, link, run until
a suitable executable prototype is created. At anytime during
these iterations, the updated source code may be sent back to
the CASE tool for reverse engineering. The CASE tool creates new
updated diagrams based upon the updated source code. Currently,
CASE tools differ greatly in their reverse engineering capability.
Sometimes added messages and transformations are not correctly
understood by the CASE tool. To create the executable prototype,
Windows resources such as windows, menus, dialog boxes, toolbars,
buttons, scroll bars, and status bars may be incorporated into
the program. Additionally, persistent classes and/or tables may
be incorporated into the program for persistent storage.
An O-O CASE tool has inputs and outputs. As shown
below, a user inputs information, commands, and scripts. The CASE
tool produces diagrams, reports, source code, and various files.
Internally, the CASE tool consists of graphic and text editors,
operators to manipulate model information such as "create
report", and a model repository. The repository stores all
the graphic and text information from diagrams and text specifications.
A user inputs diagram information such as names of classes, attributes,
and operations. A user input text specification information such
as details on each class, attribute, and operation. A user issues
commands such as "print diagram". A user may run a CASE
tool script or a Visual Basic script. A sample script could be
a single line, e.g. "list_classes" or hundreds of lines
of script code. Many CASE tools that operate in Microsoft Windows
support Object Linking and Embedding (OLE) automation. This permits
the use of Visual BASIC scripts to create source code and reports.
The user interface of an O-O CASE tool consists of a window, menu bar and menu items, button toolbar, drawing surface, dialog boxes, and status bar. You can view these user interface elements in the CASE tool screen in the beginning of this section.
A generalized O-O CASE tool menu bar is shown below.
This menu bar is general and does not represent any particular
product.
File Edit Diagram Drawing Script
New Undo System Rectangle Edit Script
Open Cut Class Oval Generate Class Code
Close Copy Object Line Generate Class Report
Save Paste Association Arrow Generate State Code/Report
SaveAs Insert Object Aggregation Text Generate Object Code/Report
Print Delete Shape Generalization Reverse Code
PrintPreview One to Zero/One Check Model
EditFile One to One
Exit One to Many
Many to Many
State
Transition
Object
Interaction
This menu bar groups menu items into the File, Edit, Diagram, Drawing, and Script groups. The File group is typical of a Windows application to open, close, and save files. The EditFile menu item is used to open a text editor to create or update scripts, source code listings, and reports. The Edit menu group includes the OLE command Insert Object to insert a Windows OLE object such as a graphics or text object into a diagram. The Diagram menu group has the menu items (commands) to create diagrams. These commands primarily apply to class diagrams in the object model. There are commands to create O-O entities, relationships, and cardinality. The O-O entities are system, class, and object. The O-O relationships are association, aggregation, generalization, and interaction. The cardinalities are one to zero/one, one to one, one to many, and many to many. The Drawing menu group has menu items (commands) to create basic graphic and text elements such as rectangles, ovals, lines, arrows, and text. It is useful to use these basic graphic and text elements to create block diagrams, state diagrams, event flow diagrams, data flow diagrams etc. Some CASE tools have a menu group to create specific diagrams, e.g. class diagram menu group, state diagram menu group, data flow diagram menu group, etc. The Script menu group has menu items to edit and run scripts to generate source code and produce reports. It also has a menu item "check model" verify the correctness of diagrams and specifications. Some tools have a menu listing methodologies so the user can choose the O-O methodology, e.g. Rumbaugh OMT, Coad-Yourdon OOA/OOD, Booch OOD, etc. Some tools have a menu listing diagrams, e.g. class diagram, object interaction diagram, state diagram, etc.
Button toolbars are an important means to input commands
to create diagrams and to enter text specifications. Some CASE
tools have no toolbars. The user selects menu items or buttons
within a dialog box. However, the trend is clearly toward having
more and more toolbars such as Microsoft Office products Word
and Excel. A sample CASE tool button toolbar is shown below. This
toolbar has a button to create a class, to select a relationship
type (association, aggregation, and generalization), and select
a cardinality (one to one, one to many, many to many, and one
to zero/one). The first button is the class symbol. The second
button (pencil) is used to connect two classes with a relationship.
The three buttons displaying a fork represent generalization,
aggregation, and association. The button in the middle of the
toolbar with a line, oval, and box is for the Rumbaugh OMT "link
association". The four buttons with various lines represent
cardinality (one to one, one to many, many to many, and one to
zero/one). The T icon is for text. The arrow icon is for an arrow.
The octagon icon with an S is the state symbol. The arrow icon
with a T is the transition symbol. The vertical line is the object
symbol. The last arrow icon is for an object interaction (message).
Each CASE tool has its own set of button toolbars. Generally,
if you press a button, then an explanatory message appears in
the status bar. Also, you can display the help topic for the button.
Dialog boxes are an important part of an O-O CASE tool. There are the standard dialog boxes for file save and printer setup. There are information dialog box such as "Enter the script file name". Most important there are dialog boxes to enter text specification information. Typically, there is a dialog box for each specification. There is a dialog box for the following specifications for O-O entities and relationships: system, class, attribute, operation, relationship, state, transition, object, and interaction. Examples of dialog boxes appear in following sections.
An O-O CASE tool is useful to create diagrams, reports,
and source code. The general steps to create a diagram in an O-O
CASE tool are as follows:
>> Create a rough draft diagram with pencil and paper
>> Create a project directory for the model. The directory will hold all the diagrams in the project
>> Run the CASE Tool from Windows
>> Select the O-O methodology, e.g. Rumbaugh OMT
>> Select "File - New"
>> Select the diagram type, e.g. class diagram
>> Select diagram symbol from the button toolbar or menu and place it on the drawing surface, e.g. class symbol
>> Enter information on the symbol, e.g. attribute and operation names
>> Connect diagram symbols together, e.g. relationships
>> Select "File - Save" to save the diagram
>> Select "File - Print" to print
the diagram
The general steps to enter specification information
and create a report in an O-O CASE tool are as follows:
>> Collect specification information on each O-O entity and relationship, e.g. class, attribute, operation, and relationships.
>> Run the CASE Tool from Windows
>> Select the class diagram that contains the O-O entities and relationships
>> Bring up each specification form, e.g. class, attribute, operation, and relationships
>> Enter specification information to describe each O-O entity and relationship
>> Run a report script or select a generate report menu item
>> In a text editor, review and print the report
>> Update specifications as required
Name of the Entity Type of Entity Enclosing
(Identifier Name) Class
| Vehicle | Class | -- |
| number | Attribute | Vehicle |
| start | Operation | Vehicle |
| Car | Class | -- |
| speed | Attribute | Car |
| start | Operation | Car |
Table Simple Data Dictionary Listing Terms
The following are the general steps to generate source
code in an O-O CASE tool:
>> Run the CASE tool from Windows
>> Bring up the appropriate diagram, e.g. class diagram
>> Verify that the diagram and text specifications are correct and up to date
>> Generate code by running the appropriate script or selecting the "generate code" menu item
>> In the programming environment, update the
source code with messages and transformations. Compile, link,
and run the program.
// Class: CLASS_NAME
class CLASS_NAME : public [BASE_CLASS]
{
[ATTRIBUTE_TYPE ATTRIBUTE_NAME;]
public:
[OPERATION_RETURN_TYPE OPERATION_NAME (CPP_OPERATION_PARAMETERS);]
[ATTRIBUTE_TYPE Get$ATTRIBUTE_NAMES$() {return ATTRIBUTE_NAME; } ]
}
---------Sample Script Output File car.h-----------------------
// Class: Car
class Car : public Vehicle
{
int speed;
public:
void start();
getspeed(){return speed;}
}
The following are the general steps to create a class
diagram from source code (reverse engineering):
>> Check the source code to ensure it is compilable in the programming environment
>> Run the CASE tool from Windows
>> Run a script or select the "Reverse Engineer" menu item to create a diagram from source code
>> Check the diagram to ensure that the diagram
accurately reflects the source code.
If you reverse the short code listing above for the
Car class, the following diagram is created.
The purpose of this section was to present an introduction to using an O-O CASE tool. The basic capabilities of an O-O CASE tool were presented such as creating diagrams, creating reports from specifications, and generating code listings using scripts.