Introduction of Rational Rose and UML
Introduction of Rational Rose and UML
Introduction of Rational Rose and UML
Unified Modeling Language (UML) was created in 1995 by merging diagramming conventions
used by three software development methodologies: OMT by James Rumbaugh, Objectory by
Ivar Jacobson and the Booch Method by Grady Booch. Prior to this time, these three amigos,
along with about a dozen other practitioners had promoted competing methodologies for
systematic software development, each with its own system of diagramming conventions. The
methodologies followed a kind of cookbook style of pushing a software project through a
succession of life cycle stages, culminating with a delivered and documented application. One
goal of UML was to reduce the proliferation of diagramming techniques by standardizing on a
common modeling language, thus facilitating communication between developers. It achieved
that goal in 1997 when the (international) Object Management Group (OMG) adopted it as a
standard.
Some critics consider that UML is a bloated diagramming language written by a committee.
That said, I consider it to be the best means available today for documenting object-oriented
software development. It has been and is becoming increasingly used in industry and academia.
It should be stressed that UML is not a methodology, rather it is a language for expressing
software models. Conceivably, it can be used with various software methodologies. However,
separately from the UML, the three amigos have developed the Rational Unified Process, a
methodology that is use case driven, and carried out using UML models.
Rational Rose is a Computer Aided Software Engineering (CASE) tool developed by the
Rational Corporation under the direction of Booch, Jacobson and Rumbaugh to support software
development using UML. Rational Rose is necessarily complex owing to its mission of fully
supporting UML. In addition, Rational Rose has numerous language extensions to Ada, C++,
VB, Java, J2EE, etc. Rational Rose supports forward and reverse engineering to and from these
languages. On the other hand, Rational Rose does not support some traditional design
techniques as data flow diagrams and CRC cards, since these are not part of UML.
Because Rational Rose has so many capabilities it is a daunting task to master it. Fortunately, a
lot can be done using just a small subset of these capabilities. These notes are designed to
introduce novice developers into making productive use of such a subset. They reflect the
author’s bias towards developing software and should not be taken as the last word on the
subject.
0. Project Initiation
1. Requirements
2. Design
2.1 Architectural Design
2.2 Detail Design
3. Implementation
4. Maintenance
0. Project Initiation
The project initiation phase involves identifying a problem that need a software solution,
investigating to see if an adequate solution is already available for purchase, if not, working up
an informal proposal outlining new software to be built and making the case that the expected
benefits justify the cost. Rational rose need not be involved in this phase.
1. Requirements
The requirements phase involves eliciting requirements from the client and presenting them in a
formal contractual document that will later serve as the basis for acceptance of the finished
project. Getting the requirements right is key to the success of the project. However, the
software developers are usually not expert on the client’s business environment, nor are the
clients necessarily good at expressing what their real requirements are. The developers need to
work with the clients to determine the real requirements.
• Use Case Diagram - The best tool I know of for talking about requirements is the use
case diagram, developed by Jacobson. The diagrams and the use case technique are so
simple that clients instantly relate to them and will readily volunteer usual and
exceptional scenarios to go along with each use case. The use cases are recorded in the
use case view of rational rose.
Some other diagrams strictly speaking belong to the design phase, but may also be useful in the
requirements phase. They are constructed in Rational Rose’s Logical View.
• Class Diagram – As part of the requirements process entity classes are identified and
described in terms of attributes, operations and associations using the UML class
diagram. A class is an entity class if it forms part of the client’s business model. So, for
example, if the client is running a hospital, possible entity classes are: Patient, Doctor,
Nurse, Therapist, Bed, Treatment, Diagnosis, etc. On the other hand, classes such as
Form, Canvas, Button, Socket, etc. are not entity classes. They are classes needed to
implement the solution, but are not meaningful in describing the client’s business, hence
not part of the requirements phase.
Another way to look at entity classes is from a database point of view. The entity classes
are usually the persistent ones, i.e. they describe the objects, which the system will
permanently track in a database.
• Sequence Diagram (Logical View)– Object-Oriented systems get work done by sending
messages between objects, invoking functions to obtain services. Sequence diagrams are
designed to help visualize the messaging. Each use case results in one or more sequence
diagrams, a main sequence diagram to illustrate the usual scenario for the use case and
zero or more additional sequence diagrams to illustrate exceptional scenarios. One or
two sequence diagrams are appropriate in the requirements phase; they are helpful in
refining and adding to use cases, and discovering entity classes. The bulk of sequence
diagrams belong to the design phase.
• Component and Deployment diagrams are primarily used in the architectural design
phase. They show the division of software responsibilities into software components or
modules, and the deployment of modules to various devices. However, for some projects
such as web applications, client-server and multi-tiered configurations, etc. these issues
are so important that the developer may wish to discuss them with the client during
requirements analysis. In Rational Rose, these diagrams properly belong in the
Component and Deployment views, respectively.
• Sequence Diagram (Logical View) – A complete set of sequence diagrams is now drawn
for each of the use cases identified as requirements. As mentioned earlier, each use case
has a usual scenario and perhaps several exceptional scenarios. Rather than attempt to
show branching in the sequence diagrams, usually a separate diagram is drawn for each
scenario.
• State chart Diagram (Logical View) – The state of an object is the current set of values of
all its attributes (including inherited ones). Objects may change state in response to
messages received. The statechart diagram shows all the states, transitions between states
labeled by the messages, which cause them, and guards on transitions.
• Activity Diagram (Logical View) – These diagrams are similar to the familiar flowcharts.
They show activities (processes) and the flow of control and data between activities.
Together the sequence, statechart and activity diagrams form the dynamic model of the system.
In general, the system is at rest until an actor initiates a use case by requesting a system function.
This causes a flurry of messages and state changes as predicted by the dynamic model.
3. Implementation
In the implementation phase the detailed design is actually carried out in program code using a
target language. Data definition language is written to create and populate the database tables
and grant role-based privileges. Reports and interactive forms are written, as well as help files
and exception handling routines.
The implementation phase is characterized by testing, unit tests to see if individual modules
work correctly, integration tests to ensure that the modules work together properly to carry out
the use cases. Tested modules are deployed to the target hardware and retested on site. Finally,
acceptance testing verifies that the system carries out its various functions correctly, i.e.
according to their specification in the requirements document.
• Model checking.
• Forward code generation (from model to source code) in a variety of target languages.
5. Maintenance
INTRODUCTION OF USE CASE DIAGRAM
use case diagram is “a diagram that shows the relationships among actors and use
cases within a system.” Use case diagrams are often used to:
• Model your analysis of your usage requirements in the form of a system use
case model
A use case model is comprised of one or more use case diagrams and any supporting
documentation such as use case specifications and actor definitions. Within most use case
models the use case specifications tend to be the primary artifact with use case diagrams filling a
supporting role as the “glue” that keeps your requirements model together. Use case models
should be developed from the point of view of your project stakeholders and not from the (often
technical) point of view of developers. There are guidelines for:
1. Use Cases
2. Actors
3. Relationships
4. System Boundary Boxes
1. Use Cases
A use case describes a sequence of actions that provide a measurable value to an actor. A use
case is drawn as a horizontal ellipse on a UML use case diagram, as you see in Figure 1.
An actor is a person, organization, or external system that plays a role in one or more interactions
with your system (actors are typically drawn as stick figures on UML Use Case diagrams).
3. Relationships
There are several types of relationships that may appear on a use case diagram:
Associations are depicted as lines connecting two modeling elements with an optional open-
headed arrowhead on one end of the line indicating the direction of the initial invocation of the
relationship. Generalizations are depicted as a close-headed arrow with the arrow pointing
towards the more general modeling element.
1. Indicate An Association Between An Actor And A Use Case If The Actor Appears
Within The Use Case Logic
2. Avoid Arrowheads On Actor-Use Case Relationships
3. Apply <<include>> When You Know Exactly When To Invoke The Use Case
4. Apply <<extend>> When A Use Case May Be Invoked Across Several Use Case Steps
5. Introduce <<extend>> associations sparingly
6. Generalize Use Cases When a Single Condition Results In Significantly New Business
Logic
7. Do Not Apply <<uses>>, <<includes>>, or <<extends>>
8. Avoid More Than Two Levels Of Use Case Associations
9. Place An Included Use Case To The Right Of The Invoking Use Case
10. Place An Extending Use Case Below The Parent Use Case
11. Apply the “Is Like” Rule to Use Case Generalization
12. Place an Inheriting Use Case Below The Base Use Case
13. Apply the “Is Like” Rule to Actor Inheritance
14. Place an Inheriting Actor Below the Parent Actor
The rectangle around the use cases is called the system boundary box and as the name suggests it
indicates the scope of your system – the use cases inside the rectangle represent the functionality
that you intend to implement.
1. Indicate Release Scope with a System Boundary Box. In Figure 2 you see that three
system boundary boxes are included, each of which has a label indicating which release
the various use cases have been assigned to.
2. Avoid Meaningless System Boundary Boxes.
The flow of events of a use case describes what needs to be done by the system to provide value
to an actor. It consists of a sequence of activities that together produce something for the actor.
The flow of events consists of a basic flow, and one or several alternative flows.
The flow of events of a use case can be described graphically with the help of an activity
diagram. Such a diagram shows:
• Activity states, which represent the performance of an activity or step within the flow of
events.
• Transitions that show what activity state follows after another. This type of transition is
sometimes referred to as a completion transition, since it differs from a transition in that it
does not require an explicit trigger event, it is triggered by the completion of the activity
the activity state represents.
• Decisions for which a set of guard conditions are defined. These guard conditions
control which transition (of a set of alternative transitions) follows once the activity has
been completed. Decisions and guard conditions allow you to show alternative threads
in the flow of events of a use case.
• Synchronization bars which you can use to show parallel subflows. Synchronization
bars allow you to show concurrent threads in the flow of events of a use case.
A simplified activity diagram for the use case Withdraw Money in the use-case model of an
automated teller machine (ATM).
Activity diagram is a special case of a statechart diagram in which all or most of the states are
activity states and in which all or most of the of the transitions are triggered by completion of
actions in the source states.
According to Conrad Bock (2003), there there are three kinds of nodes in activity models:
1. Action nodes operate on control and data values that they receive, and provide control
and data to other actions.
2. Control nodes route control and data tokens through the graph. These include constructs
for choosing between alternative flows (decision points), for proceeding along multiple
flows in parallel (forks), and so on.
3. Object nodes hold data tokens temporarily as they wait to move through the graph.
Below, the notation for some of the activity nodes to be discussed. Contrary to the names,
control nodes coordinate both data flow and control flow in the graph, and object nodes
can hold both objects and data
Action nodes
Object nodes
• Represented by a lozange
• Forks and joins are represented by a horizonal or vertical line (and incoming and
outgoing flows)
• One or more activities can fork.
• One or more activities can join
Initial node
Final nodes
Flows
Flows (or edges) describe connections between 2 actions. These edges can be drawn with
arrows in various ways.
Usually in activity diagrams, actions are simply connected through an unlabelled arrow. In
addition, you also can include an object in the flow. These objects can carry data. Finally, instead
of objects one can use "pins".
The control flow is modeled in terms of tokens. The start node will create a token which then
goes to next action. After the action executes, the token will go to the next action. When it
encounters a fork, the fork will create a token for each of its outbound flows. The opposite
happens for joins. It will produce an outbound token once all inbound tokens arrived.
Simple flows
• Simple flows are represented by an arrow from an activity showing parameters with pins
from a node to another
An arrow to a connector (a small circle with a letter) and then from a same connector to a
activity node does the same job as a simple arrow. (not shown here)
• These are similar to flows with objects. A pin represents data needed and data produced.
• The flow is represented by an arrow and a pin is a small rectangle added to an activity
rounded rectangle (no picture here)
Decision flows
Signals
Time signals
• Activities can be decomposed into subactivities. They can have input or output
parameters.
• A rake in an action node signals a subactivity
• The subsidiary activity diagram has an input and an output parameter (object nodes)
Partititions
Sequence Diagrams are used primarily to design, document and validate the architecture,
interfaces and logic of the system by describing the sequence of actions that need to be
performed to complete a task or scenario. UML sequence diagrams are useful design tools
because they provide a dynamic view of the system behavior which can be difficult to extract
from static diagrams or specifications.
Although UML sequence diagrams are typically used to describe object-oriented software
systems, they are also extremely useful as system engineering tools to design system
architectures, in business process engineering as process flow diagrams, as message sequence
charts and call flows for telecom/wireless system design, and for protocol stack design and
analysis.
This tutorial describes the basic drawing elements used in sequence diagrams and when they are
used. These are the diagram elements that are supported by the Sequence Diagram Editor tool.
Some are not part of the UML specification and may not be supported by other UML tools.
The header portion of the sequence diagram represents the components or objects of the system
being modeled and are laid out horizontally at the top of the diagram. See an example sequence
diagram here.
These are some of the main benefits of using UML sequence diagrams.
1. Help you discover architectural, interface and logic problems early. Because they allow
you to flesh out details before having to implement anything, sequence diagrams are useful tools
to find architectural, interface and logic problems early on in the design process. You can
validate your architecture, interfaces, state machine and logic by seeing how the system
architecture would handle different basic scenarios and special cases.
This is particularly true for systems involving the interaction of components that are being
implemented in parallel by different teams. In the cell phone example, each task would typically
be implemented by a separate team. Having a set of sequence diagrams describing how the
interfaces are actually used and what messages/actions are expected at different times gives each
team a consistent and robust implementation plan. You can also document how special cases
should be handled across the entire system.
The very act of creating the sequence diagrams and making them work with your architecture is
valuable because it forces you to think about details such as interfaces, states, message order,
assignment of responsibilities, timers/timeouts and special/error cases ahead of time.
2. Collaboration tool. Sequence diagrams are valuable collaboration tools during design
meetings because they allow you to discuss the design in concrete terms. You can see the
interactions between entities, various proposed state transitions and alternate courses/special
cases on paper as you discuss the design.
In our experience, having a concrete design proposal during design meetings greatly enhances
the productivity of these meetings even if the proposed design has problems. You can narrow
down the problems and then make corrections to solve them. The proposal serves as a concrete
starting point for the discussion and as a place to capture proposed changes.
Sequence diagram editor makes it so easy to edit your sequence diagrams that you could even
make the corrections in real time during the meeting and instantly see the result of the changes as
you make them.
3. Documentation. Sequence diagrams can be used to document the dynamic view of the system
design at various levels of abstraction, which is often difficult to extract from static diagrams or
even the complete source code. The diagrams can abstract much of the implementation detail and
provide a high level view of system behavior.
One of our colleagues shared this experience of joining the software team for a wireless
switching subsystem component:
"Our component was the primary interface between the call processing component of the
wireless base station and the Public Switched Telephone Network and had to support several
different network protocols including T1, E1 and SS7. The previous lead had developed several
dozen call flows describing the basic messaging and state transitions for common operations
such as call setups including mobile and land originated, call teardowns and features such as call
waiting and three way calling for each of the protocols, since each involved different states and
messages with the switching component. I found these diagrams invaluable in helping me learn
the software, interfaces and state machine and would refer to them often, even after working in
the project for a couple of years."
A class model is comprised of one or more class diagrams and the supporting specifications that
describe model elements including classes, relationships between classes, and interfaces. There
are guidelines for:
1. General issues
2. Classes
3. Interfaces
4. Relationships
5. Inheritance
6. Aggregation and Composition
1. General Guidelines
Because class diagrams are used for a variety of purposes – from understanding requirements to
describing your detailed design – you will need to apply a different style in each circumstance.
This section describes style guidelines pertaining to different types of class diagrams.
Figure 1. Analysis and design versions of a class.
A class is effectively a template from which objects are created (instantiated). Although in the
real world Doug, Wayne, John, and Bill are all student objects we would model the class Student
instead. Classes define attributes, information that is pertinent to their instances, and operations,
functionality that the objects support. Classes will also realize interfaces (more on this later).
Note that you may need to soften some of the naming guidelines to reflect your implementation
language or software purchased from a third-party vendor.
3. Interfaces
An interface is a collection of operation signature and/or attribute definitions that ideally defines
a cohesive set of behaviors. Interfaces are implemented, “realized” in UML parlance, by classes
and components – to realize an interface a class or component must implement the operations
and attributes defined by the interface. Any given class or component may implement zero or
more interfaces and one or more classes or components can implement the same interface.
For ease of discussion the term relationships shall include all UML concepts such as
associations, aggregation, composition, dependencies, inheritance, and realizations – in other
words, if it’s a line on a UML class diagram we’ll consider it a relationship.
6. Inheritance Guidelines
Inheritance models “is a” and “is like” relationships, enabling you to easily reuse existing data
and code. When “A” inherits from “B” we say that “A” is the subclass of “B” and that “B” is the
superclass of “A.” Furthermore, we say that we have “pure inheritance” when “A” inherits all of
the attributes and methods of “B.” The UML modeling notation for inheritance is a line with a
closed arrowhead pointing from the subclass to the superclass.
2) 1-level DFD
The basic/care modules of the system are represented in this phase and how data mane gates
through different modules is shown.
3) 2-Level DFD
The module details are represented in this level. Therefore, detailed Data Flow Diagrams can be
drawn with regard to the complexity of system.
Notations in DFD’s
Data Flow Diagrams show the passage of data through the system by using fine basic constructs
1) Data Flow
It shows flow of data from a source to a destination. It is shown with an arrowed line with the
arrowhead showing the direction of flow.
It can move from an external entity to a process, from a process to another process, into and out
of a store from a process, and from a process to an external entity as well.
It should be noted that the ‘Data flow’ cannot occur from external entity to a store or from a store
directly to an external entity.
2) Processes:
These are transformations which change incoming data flow into outgoing data flow.
They are drawn in circular boxes:
The name of the process should describe what may happen to the data as it passes through the
process.
3) Data/Stores
4) External entities:
They are external data processing units which represent some external process, outside of the
regular data flow .They rely outside the system boundaries.
5) Resource store:
It represents process with resource flow. It represents flow of material than data.
Example of Data Flow Diagrams
Data Flow Diagram (Level-0 and Level-1) for an ATM system can be represented as