Karlstad University
Department of Information Systems
Adapted for a textbook by Blaha M. and Rumbaugh J.
Object Oriented Modeling and Design
Pearson Prentice Hall, 2005
Modeling Concepts
Remigijus GUSTAS Phone: +46-54 700 17 65 E-mail: [Link]@[Link] [Link]
Object-Oriented System Design
A. The theoretical part B. The practical part (mandatory)
Class diagrams State-transition diagrams Interaction diagrams (Use case, Activity and Sequence diagrams)
Note: the final report must be finalised prior to the examination date!
0 -2 Remigijus Gustas
Course Literature:
M Blaha, J Rumbaugh, Object-Oriented Modelling and Design with UML, second edition, Pearson, 2005. Complementary Literature: J Martin, J J Odell. Object-Oriented Methods: A Foundation. Second UML edition, Prentice-Hall, New Jersey, 1998. L A Maciaszek. Requirements Analysis and System Design: Developing Information Systems with UML, Addison-Wesley, Harlow, 2001. G Booch, J Rumbaugh, I Jacobson. The Unified Modelling Language User Guide. Addison-Wesley, 1999.
0 -3 Remigijus Gustas
What is Object Orientation (OO) ?
OO means organizing software as well as viewing analysis and design models as a collection of discrete objects that incorporate both data structure and behavior. In the previous programming approaches, structure and behavior are loosely connected. UML is the industry standard for specifying, visualizing, constructing and documenting the artifacts of information/software systems.
0 -4 Remigijus Gustas
Features of Object-oriented approach
Classification
Objects with the same structure and behavior are grouped into classes Encapsulation of attributes and operations
Polymorphism
Same operation may behave differently for different classes
Inheritance
Operations and attributes can be inherited from other classes
0 -5 Remigijus Gustas
Objects
Object: an entity with a well-defined role in an application Each object has:
State: defined by using the attributes, their values, and associations with other objects Behavior: represents how an object acts and reacts Identity (internal and external): uniqueness, no two objects are the same
0 -6
Remigijus Gustas
Classes
Class: a logical grouping of objects with similar attributes and behavior Operation: a function or service provided by all instances of a class Encapsulation: the technique of hiding internal implementation details of an object from external view
0 -7
Remigijus Gustas
Types of Operations
Constructor/Destructor
Creates (Removes) a new instance of a class
Query
Accesses the state of an object
Update
Alters the state of an object
Scope
Applies to a full class rather than an individual instance
0 -8
Remigijus Gustas
Modeling Concepts, not Implementation
Most of OO literature emphasize implementation rather than analysis and design. Premature focus on implementation restricts design choices. The real payoff in system development comes from conceptual modeling. OO modeling is a conceptual process independent of programming language. It is a way of thinking, not programming. Greatest benefits come from helping system developers and customers to communicate system specification to each other.
0 -9 Remigijus Gustas
A complete description of system requires three different viewpoints:
Class model describes the static structure of objects.
Class diagram
State model describes the behavioral aspects of an object that change over time.
State diagram
Interaction model describes how the objects in a system cooperate to achieve user goals.
Use case, activity and sequence diagrams
0 -10 Remigijus Gustas
Class diagram
0 -11
Remigijus Gustas
State transition diagram of AlarmSwithing
0 -12
Remigijus Gustas
Use-case diagram
Inactivate Clock extends
Clock Switching On
extends
Clock Switching Off
Switching Off Alarm extends Activate Bell
extends User
extends
Switching On Alarm
extends Inactivate Bell TimeModule extends
extends Stopping Bell
Stop Clock
0 -13
Remigijus Gustas
Activity diagram
0 -14
Remigijus Gustas
Sequence diagrams
Clock Switching On
ClockSwitchOff AlarmSwitchOff Controler ClockSwitching ShowClockOff User
SC1 SC2
SwitchOnClock
SetClockOn ClockOn ShowClockOn SetOnStatus
Clock Switching Off
AlarmSwitchOff User ClockSwitchOff Controler ClockSwitching
SC2 SC1
SwitchOffClock
SetClockOff ClockOff ShowClockOff SetOffStatus
0 -15
Remigijus Gustas
Sequence diagrams
SC2 SC3
Switching Off Alarm
Bell Activated User SwitchOffAlarm
Alarm Switch Off
Controler
AlarmSwitching
BellSwitching
ShowBellActivated SetAlarmOff
Ring
ActivateAlarm
SC4 SC2
ShowAlarmSwitchOff
DisableAlarm
SwitchOffBell
0 -16
Remigijus Gustas
Object-Orientation
The Unified Modeling Language (UML) is the industry-standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems, [Link] UML defines 12 types of diagrams:
Static diagrams (class, object, component, deployment), Dynamic diagrams (use case, sequence, activity collaboration, state transition), Diagrams that help to organize and manage system development process (packages, subsystems, models).
0 -17 Remigijus Gustas
Model of the Architecture
The models associated with a system or subsystem completely partition the elements, meaning that every element is owned by exactly one package View is a projection into a model A view typically may not cross system boundary
0 -18
<<system>> A
<<subsystem>> B
<<subsystem>> C
Remigijus Gustas
Modeling Views
Model is a special kind of package. Five architecture views are organized into a set of nonoverlapping models
0 -19
Remigijus Gustas
Diagram Types
Use Case view
Use case diagram
Logical view
Class diagram
Process View
State diagram Sequence diagram Activity diagram
Implementation view
Component (database, software) diagrams
Deployment view
Hardware topology diagram with components
0 -20
Remigijus Gustas