ch-2 - Introduction To UML
ch-2 - Introduction To UML
CHAPTER-2
Introduction To UML
The Unified Modeling Language (UML) is a standard
language for writing software blue prints.
Why?
There are several problems with this
1) Communicating the conceptual models to others is
error-prone unless everyone involved speaks the same
language.
2) There are some things about a software system you
can’t understand unless you build models that
transcend the textual programming language.
(Example : Class hierarchy)
3) If the developer who cut the code never wrote down the
models that are in his or her head, that information
would be lost forever or, at best, only partially
recreatable from the implementation, once that
developer moved on.
UML is a language for Specifying
Specifying means building models that are precise,
unambiguous and complete.
Forward Engineering
Reverse Engineering
UML is a language for Documenting
A software organization produces all sorts of artifacts in
addition to row executable code. The artifacts including
the following:
Annotational Note
Things in the UML
There are 4 kinds of things in the UML
1. Structural Things
2. Behavioral Things
3. Grouping Things
4. Annotational Things
1. Structural Things
Window Name
Origin
Size Attributes
class Open( )
Close( )
Operation
Move( )
Display( )
(2) Interface:-
ISpelling
Interface
(3) Collaboration:-
A collaboration defines an interaction and is a society of
roles and other elements that work together to provide
some cooperative behavior.
Withdraw money
Use case
The remaining three things- Active classes, components
and nodes- all are class like, ie., they also describe a
set of objects that share the same attributes, operations,
relationships and semantics.
(5) Active class:-
An active class is a class whose objects own one or
more processes or threads and therefore can initiate
control activity.
Event manager
Suspend()
Flush()
Active class
The remaining two elements –component and nodes-
they represent physical things, where as previous five
things ( class, interface, collaboration, usecase, active
class) represent conceptual or logical things.
(6) Component:-
A component is a physical and replaceable part of a
system that conforms to and provides the realization of a
set of interfaces.
Component
(7) Node:-
Node
2. Behavioral Things
These are the dynamic parts of UML models.
display
Message
An interaction involves a number of other elements,
including messages, action sequences and links.
(connection between objects.)
2. State machine:-
waiting
State
A State machine involves a number of other elements,
including states, transitions( the flow from state to state),
events (things that trigger a transition), and activities
( the response to a transition).
3. Grouping Things
Grouping things are the organizational parts of UML
models.
Package
4. Annotational Things
Annotational Things are the explanatory parts of the
UML models.
Note
2. Relationships in the
UML
There are four kinds of relationships in the UML.
1. Dependency
2. Association
3. Generalization
4. Realization
Dependencies
ASSOCIATION:-
0..1 *
employer employee
Association
GENERALIZATION:-
In this way, the child shares the structure and the behavior of the
parent.
Represented as a solid line with a hollow arrow head pointing to the
parent.
Generalization
REALIZATION:-
A realization is a semantic relationship between classifiers, wherein
one classifier specifies a contract that another classifier guarantees
to carryout.
Realization
3. Diagrams in the UML
A diagram is the graphically presentation of a set of elements, most
often represented as a connected graph of vertices (things) and
arcs (relationships).
Use case diagrams address the static use case view of a system.
Like any language, the UML has a number of rules that specify what
a well-formed model should look like.
The UML has semantic rules for:-
Names- What you can call things, relationships and diagrams.
1. Specifications
2. Adornments
3. Common Divisions
4. Extensibility mechanisms
1. Specifications:-
0..1 *
Employer Employee
3.Common Divisions
SpellingWizard.dll
ISpelling
1. Stereotypes
2. Tagged values
3. Constraints
Stereotypes
add( ) {ordered}
remove( )
flush( ) Constraints
Extensibility Mechanisms
• Graphically, a stereotype is rendered as a name
enclosed by guillemots and placed above the name of
another element (eg, <<name>>)
HumiditySensor
2.Tagged values:-
add( ) {ordered}
remove( )
flush( ) Constraints
Extensibility Mechanisms
3.Constraints:-
add( ) {ordered}
remove( )
flush( ) Constraints
Extensibility Mechanisms
Architecture
Modeling a System's Architecture
Architecture is set of significant
decisions about
The organization of the system
Selection of structural elements and their interfaces
Their behavior ,as specified in the collaborations among those
elements
Composition of these structural and behavioral elements
The architectural style that guides this organization (static dynamic
elements ,interfaces ,collaborations and their compositions)
Use case view
The use case view of a system includes the use cases that
describe the behavior of the system as seen by its end users,
analysts, and testers.
The static and dynamic aspects of this view are captured in the
same kinds of diagrams as for the design view, but with a focus
on the active classes that represent these threads and processes.
Implementation view
The implementation view of a system includes the components
and files that are used to assemble and release the physical
system.
However, to get the most benefit from the UML, you should consider
a process that is
Use case driven
Architecture-centric
Iterative and incremental
Use case driven means that use cases are used as a primary
artifact for establishing the desired behavior of the system, for
verifying and validating the system's architecture, testing,
communicating among the stakeholders of the project.