You are on page 1of 326

Design Methods

CT015-3-2 Version 1

Object Oriented Analysis and


Modelling Part 1
Topics and Structure of the Lesson

- UML Model and Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 18
Learning Objectives

• At the end of this lecture, you should be


able to :
-Understand UML Model and Diagram
-Creating UML diagrams in models

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <3> of 18
Key Terms

• UML
• Model
• Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <4> of 18
UML

• Unified Modeling Language


• A standard language for specifying, visualizing, constructing, and
documenting the artifacts of software systems.
• Developed to provide standardized graphical language and
notations for describing object-oriented model
• UML also includes new concepts that were not present in other
major methods at the time, such as extension mechanisms and a
constraint language.
• It was developed in the mid-1990s as a collaborative effort by
James Rumbaugh, Grady Booch and Ivar Jacobson, each of whom
had developed their own notation in the early 1990s

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <5> of 18
UML Models

• System development focuses on three different models of the


system
– Functional model: describes the functionality of the system
from the user’s point of view
– Object model: describes the structure of the system in terms of
objects, attributes, associations, and operations
– Dynamic model: describes the internal behavior of the system

• We describe UML diagrams for representing these models

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <5> of 18
UML Model
• Use models to:
– Specify structure, behavior, or both
– Visualize an existing system to improve understanding
– Automate system development (Model-Driven Development)
• UML model files (.emx) contain:
– Model elements
– Diagrams
– Profile information
– User preferences
– Workspace information

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <6> of 18
Developing multiple model

• You can model a system using


multiple models
– How many models to use
depends on:
• The modelled system and model complexity
• Team development and configuration
management considerations
• Organizational standards and practices
• Your own preference

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <7> of 18
UML Diagrams
• UML diagrams graphically depict a view of a part of your
model or code
• Different diagrams represent different views of the system
you are developing
• A model element appears in zero or more diagrams

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <8> of 18
UML diagram versus UML model

• A model can contain one or more diagrams.


• A diagram presents a view of parts of a model.
• A model element that appears only once in your
model can appear in one or more diagrams.
– Different diagrams present different contexts.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <9> of 18
UML Views
• There are five different views that the UML aims to
visualize through different modeling diagrams
– User's View
– Structural Views
– Behavioral Views
– Environmental View
– Implementation View

• This is done through different types of UML diagrams.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <8> of 18
UML Diagrams Types

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <10> of 18
How many diagrams do you
need?
• Depends on the artifacts being modeled and the needs of users
– Use diagrams to visualize the system from different
perspectives
– No complex system can be understood in its entirety from
only one perspective
• Model elements can appear in zero or more diagrams
– A class can:
• Appear in zero or more class diagrams
• Be represented in a state machine diagram
• Have instances that appear on a sequence diagram
– Each diagram provides a different perspective

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <11> of 18
Creating UML diagrams

• Use diagrams to represent different views of the system


or application:
– UML diagrams
– Non-UML (freeform) diagrams
• Create diagrams in:
– Models
– Model elements
• Packages
• Components
• And so on

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <12> of 18
Freeform diagrams and geometric
shapes
• Freeform diagrams can include UML and non-UML
Elements
– No free-form modelling standards
– Most common that included when creating UML
packages
– Can display geometric shapes and another non-UML
notation
– Use for sketches and other informal modeling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <13> of 18
Freeform diagrams and geometric
shapes

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <13> of 18
Review : Diagram editor

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <14> of 18
Quick & Review Question

• What is UML?
• List all UML diagram.
• What is free form diagrams?

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <15> of 18
Summary of Teaching points

• UML Model and Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <16> of 18
Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <17> of 18
What We Will Cover Next

• Object Oriented Analysis and Modelling


Part 2

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <18> of 18
Design Methods
CT015-3-2 Version 1

Object Oriented Analysis and


Modelling Part 2
Topics and Structure of the Lesson

• Overview of UML Notation

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 32
Learning Objectives

• At the end of this lecture, you should be


able to :
-Understand UML diagrams and notations
-Explain UML Extension Mechanisms

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <3> of 32
Key Terms

• Notations

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <4> of 32
Use case diagram

• A use case defines a sequence of interactions between the


actor and the system.
• In Use case diagram :
- An actor is depicted as a stick figure
- The system is depicted as a box.
- A use case is depicted as an oval inside the box.
- Communication associations is depicted as line
that connect actors with the use cases
- Relationships among use cases are defined by means of
include and extend relationships.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <5> of 32
Use case diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <6> of 32
Classes and Objects

• Classes and objects are depicted as boxes.


• The class box holds the class name
• Optionally, the attributes and operations of a class may
also be depicted.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <7> of 32
Classes and Objects

• To distinguish between a class (the type)


and an object (an instance of the type), an
object name is shown underlined.

• Classes and objects are depicted on


various UML diagrams
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <8> of 32
Class diagram

• In a class diagram, classes are depicted as


boxes, and the relationships between them
are depicted as lines connecting the boxes.
• 3 main types of relationships between
classes are supported:
- associations
- whole/part relationships
- generalization/specialization

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <9> of 32
Class diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <10> of 32
Class diagram

• On each end of the association line joining the classes is


the multiplicity of the association, which indicates how
many instances of one class are related to an instance of
the other class.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <11> of 32
Interaction diagram:
Communication diagram
• Shows how cooperating objects
dynamically interact with each other by
sending and receiving messages.
• Objects are shown as boxes,
and lines joining boxes represent
object interconnection.
• Labeled arrows indicate the name
and direction of message transmission
between objects and must be numbered.
• Iteration is indicated by an asterisk (∗)
• An optional condition means that the
message is sent only if the condition is true.
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <12> of 32
Interaction diagram: Sequence
diagram
• A two-dimensional diagram in which the objects participating in the
interaction are depicted horizontally and the vertical dimension
represents time.
• Starting at each object box is a vertical dashed line, referred to as a
lifeline. (Optionally, each lifeline has an activation bar, depicted as a
double solid line, which shows when the object is executing )
• Labeled horizontal arrows represent messages which sent from the
source object to the destination object.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <13> of 32
State machine diagram

• In shorter term statechart


• States are represented by rounded boxes, and
transitions are represented by arrow that connect the
rounded boxes
• Initial state is depicted by an arrow originating from a
small black circle.
• A final state may be depicted by a small black circle
inside a larger white circle

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <14> of 32
State machine diagram

• On the arrow representing the state transition, the notation


Event [condition]/Action is used.
- The Event causes the state transition.
- The optional condition must be true, when the event occur
- Action is performed as a result of the transition.
• Optionally, a state may have any of the following:
- entry action, performed when the state is entered
- exit action, performed on exit from the state

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <15> of 32
State machine diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <16> of 32
Composite state with orthogonal
substates
• When the composite B is initially entered,
each of the substates B1 and B3 is also
entered.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <17> of 32
Packages

• Package is a grouping of model elements


– for example, to represent a system or
subsystem.
• A package is depicted by a folder icon, a
large rectangle with a small rectangle
attached on one corner.
• Packages may also be nested within other
packages.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <18> of 32
Packages

• Possible relationships between packages are


dependency and generalization/specialization
relationships.
• Packages may be used to contain classes, objects, or
use cases.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <19> of 32
Concurrent communication
diagram
• An active object can be used to
depict a concurrent object, process,
thread, or task.
• Depicted by a rectangular box with
two vertical parallel lines on the left-
and right-hand sides.
• An active object has its own thread
of control and executes concurrently
with other objects.
• A passive object has no thread of
control and executes only when
another object (active or passive)
invokes one of its operations.
• Depicted by a rectangular box
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <20> of 32
Concurrent communication
diagram
• Message send between tasks are either asynchronous (loosely
coupled) or synchronous (tightly coupled).

• Use simple messages during analysis modeling when no


decision has yet been made about the type of message
communication.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <21> of 32
Concurrent communication
diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <22> of 32
Deployment diagrams
• A deployment diagram shows
the physical configuration of the
system in terms of physical nodes
and physical connections
between the nodes, such as
network connections.
• A node is shown as a cube, and
the connection is shown as a line
joining the nodes.
• A deployment diagram is
essentially a class diagram that
focuses on the system’s nodes

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <23> of 32
UML Extension Mechanism

• UML provides three mechanisms to allow


the language to be extended.
- stereotypes
- tagged values
- constraints.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <24> of 32
UML Extension Mechanism :
stereotypes
• defines a new building block that is
derived from an existing UML modeling
element but tailored to the modeler’s
problem

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <25> of 32
UML Extension Mechanism :
Tagged values
• A tagged value extends the properties of a UML building
block thereby adding new information.
• A tagged value is enclosed in braces in the form {tag =
value}.
• Commas separate additional tagged values.
• For example, a class may be depicted with the tagged
values {version = 1.0, author = Gill}

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <26> of 32
UML Extension Mechanism :
Constraints
• A constraint specifies a condition that
must be true.
• In UML, a constraint is an extension of the
semantics of a UML element to allow the
addition of new rules or modifications to
existing rules

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <27> of 32
UML as a Standard
UML 2.0
(2004)

UML 1.5 Model business


(March, ‘03) process

UML UML 1.1


Partners’ (Sept. ‘97)
Expertise
UML 1.0
(Jan. ‘97) Associated more
with software
UML 0.9 and UML 0.91 engineering and
(June ‘96) (Oct. ‘96) system design
Public
Unified Method 0.8 Feedback
(OOPSLA ’95)

Booch ’93 OMT - 2

OOSE Other Booch ‘91 OMT - 1


Methods

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <28> of 32
Quick & Review Question

• Lists notation in use case diagram


• Describe the difference between active
and passive objects?

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <29> of 32
Summary of Teaching points

• Overview of UML Notation

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <30> of 32
Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <31> of 32
What We Will Cover Next

• Object Oriented Analysis and Modelling


Part 3

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <32> of 32
Design Methods
CT015-3-2 Version 1

Object Oriented Analysis and


Modelling Part 1
Topics and Structure of the Lesson

• Software Methodology (COMET)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Learning objectives

• At the end of this lecture, you should be


able to :
– Explain and identify COMET
– Explain comparison of the COMET with
other Software Processes

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Key Terms

• COMET

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET
(Collaborative Object Modeling
and Architectural Design Method)

• An iterative use case–driven and object-oriented method that


specifically addresses - requirements, analysis, and design
modeling phases of the software development life cycle.
• Development process for the COMET method is a use case–based
software process.
• The COMET method ties in the three phases of requirements,
analysis, and design modeling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET
(Collaborative Object Modeling
and Architectural Design Method)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET Phases:
Requirements modeling
• A requirements model is developed in which the functional
requirements of the system are described in terms of actors
and use cases.
• A narrative description of each use case is developed.
• In this phase, user inputs and active participation are
essential
• Throwaway prototypes can help to clarify the requirements.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET Phases:
Analysis modeling
• The use case is realized, to describe the objects that participate in the
use case and their interactions
• Static and dynamic models of the system are developed.
– Static Models
• Defines the structural relationships among problem domain
classes which depicted on class diagrams. Object structuring
criteria are used to determine the objects to be considered for the
analysis model.
– Dynamic Models
• The use cases from the requirements model are realized to show
the objects that participate in each use case and how they interact
with each other which are depicted on either communication
diagrams or sequence diagrams. In the dynamic model, state-
dependent objects are defined using statecharts.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET Phases:
Design modeling
• The software architecture is developed, describing
components and their interfaces
• The software architecture of the system is designed
in which the analysis model mapped to an operational
environment.
• The analysis model, with its emphasis on the problem
domain, is mapped to the design model
• Subsystem structuring criteria are provided to
structure the system into subsystems, which are
aggregate or composite objects.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET Phases:
Design modeling
• For sequential systems: the emphasis is on the object-
oriented concepts of information hiding, classes, and
inheritance.
• For concurrent systems: such as real-time, client/server,
and distributed applications, it is necessary to consider
concurrent tasking concepts in addition to object-oriented
concepts.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET Phases:
Incremental Software Construction
• The software subsystems are incrementally constructed and
integrated into incremental prototypes.
• Select subset of system based on use cases
• This phase consists of:-
- detailed design
- coding
- unit testing
• Gradually constructed and integrated until the whole system
is built.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET Phases:
Incremental Software Integration
• The integration testing of each software increment is
performed based on the use cases selected for the
increment.
• Integration testing is a form of white box testing, in which
the interfaces between the objects that participate in
each use case are tested.
• If significant problems are detected in the software
increment, iteration through the requirements modeling,
analysis modeling, and design modeling phases might
be necessary.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET Phases:
System testing
• System testing includes the functional testing of
the system
- testing the system against its functional
requirements.
• This testing is black box testing and is based on
the black box use cases
• Any software increment released to the
customer needs to go through the system
testing phase.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Comparison Of The Comet
Life Cycle With Other Software
Processes

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Unified Software Development
Process (USDP)
• Also known as RUP - trademark name for
IBM
• A use case–driven software process that
uses the UML notation.
• Consists of 5 workflows and 4 phases and
is iterative.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
USDP

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET vs USDP

• Directly compatible with COMET


– The first three phases even have same names
• USDP’s Testing phase is broken into
COMET’s Incremental Integration and
System Testing phases
– These activities should be performed by
separate teams.
• Incremental Integration -> Development Team
• System Testing -> Testing Team

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Spiral

• A risk-driven process model


• Each cycle of the spiral model iterates
through these four quadrants and the
number of cycles is project-specific.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Spiral

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
COMET vs Spiral
• The COMET method can also be used with the spiral model
when project manager decides what specific technical activity
should be performed in the third quadrant.
 (I) Quadrant : Objective identification
 (II) Quadrant : Risk analysis
 (III) Quadrant : Product development
- Requirement Modeling
- Analysis Modeling
- Design Modeling
 (IV) Quadrant : Cycle planning

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Quick & Review Question

• What is COMET?
• List all the phases in COMET.
• Explain the difference between USDP and
COMET life cycle?

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Summary of Teaching points

• Software Methodology (COMET)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
What We Will Cover Next

• Object Oriented Analysis and Modelling


Part 3 (Continue)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 24
Design Methods
CT015-3-2 Version 1

Object Oriented Analysis and


Modelling Part 2 (Continue)
Topics and Structure of the Lesson

• Activities in COMET

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Learning objectives

• At the end of this lecture, you should be


able to :
– Understand modeling activities in
COMET

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Key Terms

• Black-box use case

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Modeling Activities in COMET

• COMET defines the modeling phases


thus:
– Requirements: defining the function of the
system.
– Analysis: Decomposing the problem for better
understanding.
– Design: Producing the solution into a
complete system.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Requirements Modeling

• The functional requirements of the system


are described in terms of use cases and
actors
• Addressing nonfunctional requirements is
also important at the requirements phase.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Analysis Modeling

• Emphasis on understanding the problem


in terms of domain objects and the
information passed between them:
– Static Modeling
– Object Structuring
– Dynamic Interaction Modeling
– Dynamic State Machine Modeling

* Important note: Other design issues deferred to design phase, e.g.


active/passive, sync/async, operation invoked

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Analysis Modeling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Analysis Modeling :
Static Modeling
• Define problem-specific static model*
– Structural view
• Classes defined in terms of attributes
– Emphasis on info modeling of real-world classes
in the problem domain
• Relationships between classes defined

* Important note: Operations are defined in the design


model
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Analysis Modeling :
Object Structuring
• Determine the objects that participate in each
use case, e.g.
– Entity
– Interface
– Control
– Application logic

• After objects determined, dynamic relationships


are determined in dynamic model

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Analysis Modeling :
Dynamic Interaction Modeling

• The use cases are refined to show the


interaction among the participating objects
• Communication diagrams or sequence diagrams
are developed

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Analysis Modeling :
Dynamic State Machine
Modeling
• State-dependent system properties
defined
– Using hierarchical state-charts
– Each state-dependent object determined is
defined in terms of its constituent statechart

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Design Modeling

• During this phase, the analysis model is mapped to a


concurrent design model which is software
architectures, the following activities are performed:
- Integrate the object communication model. Develop
integrated object communication diagram(s). (Ch13)
- Make decisions about subsystem structure and interfaces.
Develop the overall software architecture. Structure the
application into subsystems. (Ch13)
- Make decisions about what software architectural and design
patterns to use in the software architecture. (Ch12, 15, 16,
17, 18)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Subsystem Structure Example

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Software Architectural and
Design Patterns Example

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Design Modeling

- Make decisions about class interfaces. For each subsystem,


design the information hiding classes (passive classes).
Design the operations of each class and the parameters of
each operation. (Ch14)
- Make decisions about how to structure the distributed
application into distributed subsystems, in which subsystems

are designed as configurable components, and define the


message communication interfaces between the components.
(Ch13, 15, 16, and 17).

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Activities in Design Modeling

- Make decisions about the characteristics of objects,


particularly whether they are active or passive. For each
subsystem, structure the system into concurrent tasks (active
objects). (Ch18)
- Make decisions about the characteristics of messages,
particularly whether they are asynchronous or synchronous
(with or without reply). (Ch12, 13, 15, 16, 17, and 18)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Quick & Review Question

• Describe the activities in Requirement


Modeling.
• Explain activities that occur in Analysis
Modeling.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Summary of Teaching points

• Software Methodology (COMET)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
What We Will Cover Next

• Use Case Modelling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 21
Design Methods
CT015-3-2 Version 1

Use Case Modeling


Topics and Structure of the Lesson

• Use case notations


• Relationship

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Learning objectives

• At the end of this lecture, you should be


able to :
– Describe the elements in a use-case
diagram
– Describe the associations and
relationships possible in a use-case
model
– Create a use-case diagram
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1
Key Terms

• Association
• Actor
• System Boundary

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case

• A use case defines a sequence of interactions between


one or more actors and the system.
• A use case diagram elements - actors, use cases and
system boundaries.
• The system is defined through the system boundaries.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Diagram Purpose

• Built in early stages of development


• To demonstrate the different ways that a user might
interact with a system.
• Purpose
– Specify the context of a system
– Capture the requirements of a system
– Validate a systems architecture
– Drive implementation and generate test cases
– Developed by analysts and domain experts

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• System Boundary
– The use cases of the system are placed inside the system
shape, while the actor who interact with the system are put
outside the system.
– The use cases in the system make up the total requirements of
the system System Name

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• Use Case
– represents a user goal that can be achieved by accessing the
system or software application
– Use case naming is based on “verb + noun”
– Example: Check Balance

Check Balance

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• Actor
– Are the entities that interact with a system
– Usually used to represent the users of system
– Actor represents a role that a user can play but not a specific
user

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• Association
– Actor and use case can be associated to indicate that the actor
participates in that use case
– A single line without any arrowhead

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Exercise

• In a XYZ library system, a user can register as client.


While an admin able to view the client details.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• Generalization
– Used to represent inheritance relationship between model
elements of same type
– A single line with blank arrowhead

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• Include
– The behavior for the inclusion use case is inserted into the
behavior defined for the base use case
– The child use case must be completed before parent use case
can be executed
– included use case cannot stand alone and the original use case
is not complete without the included one

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• No need Include
– A customer can make an order and payment using the system.

• Need Include
– A customer can only make a payment once the order is placed
using the system.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• Extend
– A use case conditionally adds steps to another first class use
case
– Base use case is complete (concrete) by itself, defined
independently
– Extending use case is optional, supplementary

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Use Case Notation

• No need Extend
– In a system user can make registration or look for help if need
guide to make a registration.

• Need Extend
– In a system user can make registration and able to seek for help
during the registration before complete the process.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Guideline to Draw Use Case
Diagram
• A use case diagram should be as simple as possible
• A use case diagram should be complete
• A use case diagram should represent all interactions with
the use case
• If there are too many use cases or actors, then only the
essential use cases should be represented
• A use case diagram should describe at least a single
module of a system
• If the use case diagram is large, then it should be
generalized

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Example of Use Case Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Example of Use Case Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Exercises

1. Draw Use Case Diagram for the following:

When the customer completed the registration, the


admin sends approval notation

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Exercises

2. Draw Use Case Diagram for the following:

A student able to register up to four courses per


semester, an admin also may help students to
register for the courses

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Exercises

3. Draw Use Case Diagram for the following:

A customer need to make a payment. The customer


have an option to print a receipt upon complete
payment.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Exercises

4. Draw Use Case Diagram for the following:

A lecturer, academic leader and any ABC Tuition Center


employees may view student’s feedback.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Quick & Review Question

• Draw and explain all the elements in use


case.
• State the purposes of Use Case Diagram.
• State six guideline to draw a use case
diagram.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Summary of Teaching points

• Use case modelling


• Use case notations
• Relationship

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


What We Will Cover Next

• Use Case Specifications

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Design Methods
CT015-3-2 Version 1

Use Case Specifications


Topics and Structure of the Lesson

- Documenting Use Cases in the Use Case


Model
- Use Case Relationships

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 14
Learning objectives

• At the end of this lecture, you should be


able to :
– Documenting use cases

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <3> of 14
Key Terms

• Dependency
• Pre-condition
• Post-condition

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <4> of 14
Use Case Description

• Each use case in the use case model need to be


documented in a use case description.
• A textual description of the sequence of
transactions of a use case is needed to
understand what really happens in a use case.
• The flow-of-events is written in terms of what the
system should do, not how the system does it.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <5> of 14
Templates for a Use Case
Specifications
Components Description
Use case Each use case is given a name
Description A brief description of the use case
Actors Names the actors in the use case. Generally, primary
actor that initiates the use case. In addition, there may be
secondary actors that also participate in the use case
Preconditions/ One or more conditions that must be true at the start of
Dependency use case, from the perspective of this use case
Postconditions Condition that is always true at the end of the use case
(from the perspective of this use case) if the main
sequence has been followed; for example, customer’s
funds have been withdrawn

<<include>>
View Login
profile
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <6> of 14
Templates for a Use Case
Specifications
Components Description
Standard Process A series of declarative steps - sequence of interactions
between the actor and the system. The description is in
the form of the input from the actor, followed by the
response of the system
Alternative Narrative description of alternative branches off the main
Process sequence – to complete standard process
Exception Process There may be several alternative branches from the main
sequence – to handle error in standard process

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <6> of 14
Sample of Use Case Description

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <9> of 14
Sample of Use Case Description

Use case UC1_Make Order Request


Description This use case is used to help customer to make an order on the
products they have selected. The purchase can only be made via
credit card.
Actors Customer
Preconditions/ One product at least must be selected by customer to start make
Dependency an order.
Postconditions Delivery order has successfully created.
Standard Process 1- Customer provides order detail
2- System checks customer information
3- System retrieves customer payment information record
4- System checks customer credit card for purchase amount, if
approves, proceed with confirmation
5- Customer confirm the order
6- System create delivery order with order details and customer
details
7- System display success order and display order information to
CT015-3-2 Design Methods
customerObject Oriented Analysis and Modelling Part 1 Slide <10> of 14
Sample of Use Case Description

Alternative Step 5a: Cancel order


Process 5a.1- The system prompt cancelation successful
5a.2- Terminate the order process
5a.3- Exit the use case

Exception Flow Step 2a: Not login into account / Invalid account
2a.1- The system prompts customer request to login or create an
account
2a.2- The flow continue from step 1

Step 3a: No payment detail found


3a.1- The system prompts customer a page for payment details
3a.2- Once completed, proceed to step 4.

Step 3b: Credit card request denied


3b.1- The system prompts error message.
3b.2- The customer have an option to enter new credit card details
proceed to step 3a, or cancel the order proceed to step 5a.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <10> of 14
Quick & Review Question

• Explain flows-of-event.
• Defines preconditions.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <11> of 14
Summary of Teaching points

- Documenting Use Cases in the Use Case


Model
- Use Case Relationships

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <12> of 14
Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <13> of 14
What We Will Cover Next

• Activity Diagram Modeling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <14> of 14
Design Methods
CT015-3-2 Version 1

Activity Diagram Modeling


Topic and Structure of the Lesson

- Elements in an activity diagram


- Control and object flows

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Learning objectives

• At the end of this lecture, you should be


able to :
– Describe the kinds of actions in an
activity
– Describe control and object flows
– Create an activity diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Activity Diagram

• Depicting the flow of control and


sequencing among activities.
• An activity diagram shows the sequence of
activities, decision nodes, loops, and even
concurrent activities.
• To depict one or more steps in the use
case description.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Activity Diagram

• Activity diagrams can describe system


workflow, use case, class, or operation
behaviour
– Read like a flowchart
• Can model control and dataflow
– Sequential and synchronous actions

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 ‹#›
Elements in Activity Diagram
Elements Notation Explanation
Initial Node Indicates the first action
or actions in the activity.

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Control Flow A connector that shows
the flow of control
between actions.

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Action A rectangle with rounded
corners. A step in the
Activity activity, in which the
users or software
perform some task.

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Decisions A diamond represents a decision with
alternate paths. Has one input and two or
more outputs. An incoming token emerges
on just one of the outputs.

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Activity Final Node An end to the activity.
When a token arrives,
the activity terminates.

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Flow Final Node A flow final node terminates a flow.
Unlike the activity final node, which
ends an entire activity.

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Fork node Used to split a single incoming flow into
multiple concurrent flows. It is
represented as a straight, slightly thicker
line in an activity diagram.

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Join node Joins multiple concurrent flows back into a
single outgoing flow. It is represented as a
straight, slightly thicker line in an activity
diagram

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Merge node A merge event brings together multiple flows
that are not concurrent. Bring back together
different decision paths that were created
using a decision-node.

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Activity Partition The individual elements of an activity
Partition 1 Partition 2 diagram can be divided into individual
areas or 'partitions'. Various criteria can
lead to the creation of these partitions:
organization entities, cost centers,
locations, etc:

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Elements in Activity Diagram
Elements Notation Explanation
Call Behaviour A call behavior action represents a linked
Action call to a separate activity (and its
corresponding activity diagrams)

Example:

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Call operation action: modelling
class operations
• A call operation action transmits an operation call
request
• To create, drag an operation onto the
diagram to create a call operation
action
– The action takes the name of the operation

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1
Object flow

• Object flow models the data flow within an activity


• Object flow can only be attached to object nodes or
pins on actions
• Object nodes and object flow provide the
capabilities for explicit data flow modeling
•An object node represents the data participating in
an activity diagram
– It represents an instance of a classifier (such as
a class), as well as the corresponding data and
behaviour
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1
Object Flow

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object Flow

• An object node is an abstract class, and is


specialized by the following object nodes:
• Pins
• Activity parameter nodes
• Data stores

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object Flow : Pins

• Pins are either input pins or output pins


• Pins model where actions and activities
are sending and receiving data

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object Flow: Activity Parameter

• Represent the data parameters coming


into or going out of an activity
– Can send and receive
– May have an associated data type (such
as a class or interface)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object Flow: Data store

• Used to model persistent data, such as


saving information to a database, or
retrieving information from a database

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object Flows Example

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1
Review

• Draw and explain all the elements in


activity diagram.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


2
>

o
f

1
4

Summary of Teaching points

- Elements in an activity diagram


- Control and object flows

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


3
>

o
f

1
4

Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


4
>

o
f

1
4

What We Will Cover Next

• Static Modeling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Design Methods
CT015-3-2 Version 1

Static Modelling
Topics and Structure of the Lesson

• Static Modeling
-Notations
-Relationships

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 26
Learning objectives

• At the end of this lecture, you should be


able to :
– Describe static modelling
– Describe the elements in a class
diagram
– Describe the associations and
relationships possible in a class model
– Create a class diagram
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <3> of 26
Key Terms

• Object
• Associations
• Composition / Aggregation
• Generalization / Specialization

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <4> of 26
Static Modelling
• Describes static structure of the system being
modeled, which is considered less likely to change
than the functions of the system
• The UML class diagram notation is used to depict
static model
• In OO Analysis Modelling
– Define classes in system
– Defines attributes of classes
– Defines relationships between classes
• In OO Design Modelling
– Defines operations of each class

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <5> of 26
Object and Classes

• Objects represent “things” in real world


– Provide understanding of real world
– Form basis for a computer solution
• An Object (object instance) is a single “thing”
– E.g., an account, an employee
• A Class (object class) is a collection of
objects with the same characteristics
– E.g., account, employee
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <6> of 26
Example of code for object and
class
class Student1{ //class
int id;
String name;

public static void main(String args[]){


Student1 s1=new Student1(); //creating an object of Student
System.out.println(s1.id);
System.out.println(s1.name);
}
}

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <7> of 26
UML notation for objects &
classes

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <8> of 26
Modeling with class diagrams

• Class diagrams are used to capture static


structure in:
– Conceptual modelling
– Detailed design modelling
– Implementation modelling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <9> of 26
Relationship on Class Diagram

• Relationships between classes


– Associations
– Composition / Aggregation
– Generalization / Specialization
• Other type of relationship
– Dependency
– Realization

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <10> of 26
Relationship on Class Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <11> of 26
Association

• Association is
– Static, structural relationship between classes
– E.g, Employee works in Department
• Navigability can be unidirectional or
bidirectional
• Multiplicity of Associations
– Specifies how many instances of one class may

relate to a single instance of another class


CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 ‹#›
Association

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <13> of 26
Multiplicity of Association
• 1-to-1 association
– Company has President
• 1-to-many association
– Bank manages Account
• Numerically specified association
– Car has 2,4 Door
• Optional association (0 or 1)
– Customer owns Debit Card
• Optional association (0, 1, or many)
– Customer owns Credit Card
• Many-to-Many association
– Course has Student
– Student attends Course

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <14> of 26
Aggregation

• Aggregation
– Part objects of aggregate object may be created
and deleted independently of aggregate
object.
– it is binary association
– symbolized by a clear white diamond
– “is part of”

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 ‹#›
• A car needs a wheel to function correctly, but a wheel
doesn’t always need a car. It can also be used with the
bike, bicycle, or any other vehicles but not a particular
car. Here, the wheel object is meaningful even without
the car object. Such type of relationship is called UML
Aggregation relation.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 26
Composition

• Whole and part objects are created, live, die together


• A composition is a stronger relationship than an aggregation
• Often also has a physical association
• “is entirely made of”
• Association between instances
• symbolized by a black diamond
– E.g., Composite class: ATM
– Part classes:
Keypad, CardReader, CashDispenser,
ReceiptPrinter

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 ‹#›
• The folder could contain many files, while
each File has exactly one Folder parent. If
a folder is deleted, all contained files are
removed as well.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <#> of 26
Generalization

• A generalization relationship is one in


which a class shares the structure and
behavior of one or more classes
• Subclass inherits a superclass
• Often described as an “is a” relationship
– E.g., Coupe is a Automobile
Sedan is a Automobile

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <19> of 26
Dependency
• A dependency relationship describes a case
where one class uses another
• Dependencies may exist between classes
because:
– A message is sent from one class to the other
– One class is part of another's data
– One mentions the other as a parameter to an
operation

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <21> of 26
Realization

• A realization relationship describes a client


implementing a supplier's specification (an
interface)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <22> of 26
Class Diagram Example

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹#› of 9
Quick & Review Question

• What is the difference between


aggregation and composition?
• Which relationships can be bidirectional?

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <23> of 26
Summary of Teaching points

• Static Modeling
-Notations
-Relationships

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <24> of 26
Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <25> of 26
What We Will Cover Next

• Object and Class Structuring

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <26> of 26
OBJECT ORIENTED METHODS
CE52604-5

Class Diagram Part 2


Lecture Objectives

At the end of this lecture, you should be able


to:

1.describe what CRC is and how it is used


with respect to class diagram.

2. draw a class diagram based on CRC


specifying attributes and methods.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Keywords

At the end of this lecture You will be able to :

• Class Responsibility Collaboration (CRC)


• Class diagram
• Collaborator
• Responsibility

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Analysis & Design

Use Case Diagram Analysis

CRC & Class Diagram Design

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


What is an Object?

• “Something you can do things to. An


object has state, behavior, and
identity”(Booch, 1994)
• “A Software package that contains a
collection of related data and functions”
• An object represents either a real world or
invented entity

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


What does an object do?

• holds information - it has what is called a


state and behaviour
• participates proactively or reactively in
processes
• communicates with other objects (client-
server systems)
• allow to use (or reuse) existing software
components

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object Formal Definition

• We mentioned before that an object has :-


• State
• Behavior
• Identity
• But what does this mean?

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object State

• The state of an object is one of the


possible conditions in which it may exist
(Booch, 96)
• The state can change over time
• The state is represented by the values of
an object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


State Example 1…

• Here is an example of another object:-


A Car
• The car is stopped
• The engine is off
• The car is currently in a non-moving state.
• Start the engine and change gear and the
car will be in a different state!

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


State Example 2 …
• The state of a particular object is the values of
its attributes at any particular moment. For
example, a cat might have the following state:
• Name: Max
• Breed: American Shorthair
• Colour: Black, brown & white
• Age: 3 years, 4 months, 8 days
• Weight: 5.1 kg
• Some of these attributes change constantly.
Others stay the same for long periods or forever.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object Behavior

• “Behavior determines how an object acts


and reacts; its state changes and
interaction with other objects” (Booch, 96)
• The Object Behavior defines how it will
react to other objects
• Each object has a set of operations which
it can perform which determines its
behavior

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Object Identity

• Each Object is unique even if its state is


the same as another object

Student

Student_ID Student_Name +Student_ID: Int


+Student_Name: String

Student +EnrollModule()

Class Diagram
ERD

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Objects - Our Intuition

• We are all familiar with the idea of an object. We are


surrounded by them: cars, books, people, houses, cats,
etc.
• Objects have attributes/state, e.g. colour, size, age, name.
• Objects also have behavior/method. They can do things,
e.g. grow, breathe, run, stop.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Attributes and Behaviour

Object Attributes Behaviour

Registration number Start


Car Make Stop
Model Turn
Year Accelerate
Colour Flash lights

Cat Name Sleep


Breed Eat
Colour Purr
Age Climb
Weight Scratch

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Describing An Object

• How would you describe this to a


computer: A man
• Mr John Smith
• 42 years old
• Brown hair, blue eyes
• Height 1.6m and weight 70kg

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


CRC

• CRC (class responsibility collaborator)


modeling process for identifying user
requirements.
- An effective, low-tech method for
developers and users to work closely
together to identify and understand
business requirements.
• Consists of class, responsibility and
collaboration.
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1
CRC

• A class represents a collection of similar object


• A responsibility is anything that a class knows
or does.
- Customers have names, customer numbers, and
phone numbers. These are the things that a
customer knows.
- Customers order products, cancel orders, and
make payments. These are the things that a
customer does.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


CRC

• Sometimes a class will have a responsibility


to fulfill, but will not have enough information
to do it. When this happens it has to
collaborate with other classes to get the job
done.
-To calculate the order total, the Order object collaborates
with each Order Item object to calculate its own total,
and then adds up all the totals to calculate the overall
total. For each Order Item to calculate its individual
total, it has to collaborate with Item to determine the cost
of the ordered item, multiplying it by the number ordered
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1
CRC

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
Scenario

Students are allowed to borrow books, return books and


make advanced bookings for books via a librarian. Students
make payment for books overdue. Students may cancel
bookings. The option of canceling a booking is possible
whilst a book is being borrowed.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
Step 1
Step 1: Identify Candidate Classes

Hint:
(i) Classes are nouns
(ii) Just identify the ones that are obvious to you. You
may identify more later.
Candidate Classes:

Student
Book
Booking
Payment

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
Step 2
Step 2: Draw CRCs for each identified class.

Hint:
(i) Each identified class in step (i) becomes a CRC
with the same name.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
Step 3
Step 3: For each CRC, fill what you think might be
the responsibilities & collaboration

Hint:
(i) Collaborators are identified classes – i.e student,
book, etc.
(ii) There could be one responsibility having two
collaborators and vice versa.
(iii) It is possible to have a responsibility with NO
collaborators.
(iv) Each responsibilities should ideally be expressed in
a few words (usually not more than 4) and must
begin with a verb.
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1
Creating Class Diagram
Step 3 (continued)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
Step 4
Step 4: Map CRC to create a class diagram.

Hint:
(i) Each CRC becomes a class of its own.
(ii) A CRC having two or more collaborators would
mean having similarly two or more connected
classes.
(iii) Responsibility of a CRC would turn out to be
methods of the class
(iv) Methods usually begin with a verb – i.e
generateReport().

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
Step 4 (continued)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
Step 5
Step 5: Further refine class diagram with attributes,
multiplicities, new classes (if found) and new
methods (if found).
Hint:
(i) Every class should have at least one method.
(ii) You may include NEW classes to your class
diagram without worrying about having to make
similar updates to the CRC. Once the class
diagram has been created, all changes will ONLY
reflect the class diagram and no longer the
CRCs.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
Step 5 (continued)

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Creating Class Diagram
In Class Exercise 1
Create a CRC and a class diagram for the scenario below:

Inventory System

In order to generate an invoice a clerk must log in. If a


clerk is a first time user, one must have themselves
registered. There should be an option for a user to register
oneself within the login page. Any user can use the system
to view products online.The option of login is also provided
when a user views products online.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Summary

– describe what CRC is and how it is used with


respect to class diagram.
– draw a class diagram based on CRC
specifying attributes and methods.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Design Methods
CT015-3-2 Version 1

Object and Class Structuring


Topics and Structure of the Lesson

• Object structuring criteria and categories

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 30
Learning objectives

• At the end of this lecture, you should be


able to :
– Describe object structuring criteria and
categories

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <3> of 30
Key Terms

• Entity object
• Boundary object
• Control object
• Application logic object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <4> of 30
Object and Class Structuring

• First attempt at determining the software objects


in the system.
– a class is categorized by the role it plays in the
application. Object and class structuring criteria are
provided to assist the designer in structuring a system
into its constituent classes and objects.
• Determines and Categorizes the software
interfaces to the objects developed in the Static
Modeling phase.
• The beginnings of the Dynamic Model

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <5> of 30
Object and Class Structuring
Criteria

• Determine all software objects in system


– Use Object Structuring Criteria
– Guidelines for identifying object
• Structuring criteria depicted using stereotypes
– Stereotype defines a new building block that is derived
from an existing UML modelling element but is tailored to
the modeller's problem
– Depicted using guillemets
«entity», «boundary», «control»

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <6> of 30
Object and Class Structuring
Categories
• The four main categories :
1. Entity object
– represents the class where the data to be saved to or
retrieved from.
2. Boundary object
– Software object that interfaces to and communicates
with the external environment
Device Interface Objects connect to a hardware I/O device.
User Interface Objects provide for human user interaction.
System Interface Objects represent external systems or
subsystems.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <7> of 30
Object and Class Structuring
Categories
3. Control object
– Software object that provides the overall coordination
for a collection of objects. Control objects may be
coordinator objects, state-dependent control
objects, or timer objects.
4. Application logic object
– Software object that contains the details of the
application logic. Another category is service objects,
which provide services for client objects, typically in
service-oriented architectures and applications.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <8> of 30
Classification of application
classes by stereotype

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <9> of 30
Boundary Object

• Boundary objects are further categorized as:


– User interaction object
Software object that interacts with and interfaces to a
human user.
– Proxy object
Software object that interfaces to and communicates
with an external system or subsystem.
– Device I/O boundary object
Software object that receives input from and/or outputs
to a hardware I/O device.
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <10> of 30
Boundary :User interaction
• Communicates directly with
the human user, receiving
input from the user and
providing output to the user
via standard I/O devices
such as the keyboard,
visual display, mouse and
GUI.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <11> of 30
Boundary : Proxy
• Interfaces to an external system
– Interfaces to an
external system
– Hides details of how
to communicate with
external system
• E.g., Robot Proxy
• Interfaces to external (real-
world) robot

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <12> of 30
Boundary : Device I/O
• Interfaces to I/O device
• Input object
– E.g., Sensor
Interface
• Output object
– E.g., Actuator
Interface
• I/O (Input/Output) object
– E.g., ATM Card
Reader Interface

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <13> of 30
Device I/O boundary object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <14> of 30
Depicting External Classes and
Boundary Classes

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <15> of 30
Entity Classes and Objects

• Entity Objects are long living.


– Used by many use cases.
– Store information that persists across use
cases.
E.g., Account, Sensor
• Entity objects are instances of the entity classes
developed in the Static Modeling phase.
• Entity classes often mapped to relational
database during design

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <16> of 30
Entity Classes and Objects

Example of entity class and object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <17> of 30
Control Classes and Objects

• Provides overall coordination for execution of a


group of objects
– Makes overall decisions
– Decides when, and in what order, other
objects participate in interaction sequence
• Entity objects
• Boundary objects

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <18> of 30
Control Classes and Objects

• Control Objects:
– Coordinator object
Overall decision-making object that determines the
overall sequencing for a collection of related objects.
– State dependent control object
Defined by finite state machine - depicted by using a
statechart.
– Timer object
A control object that is activated by an external timer –
e.g, a real-time clock or operating system clock.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <19> of 30
Control :Coordinator object

Example of
coordinator class
and object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <20> of 30
Control : state-dependent

Example of
state-dependent
control class and
object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <21> of 30
Control : Tmer

Example of a
timer class and
object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <22> of 30
Application Logic Classes and
Objects
• 3 kinds of application logic objects:
– Business Logic Object
Defines business specific application logic (rules) for
processing a client request. Usually accesses more
than one entity object
– Algorithm Object
Encapsulates algorithm used in problem domain. More
usual in scientific, engineering, real-time domains
– Service object
Provides a service to other objects and responds to
requests from client objects

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <23> of 30
Application Logic : business logic

Example of
business logic
class and object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <24> of 30
Application Logic : algorithm

Example of
algorithm class
and object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <25> of 30
Application Logic: service

Example of service
class and object

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <26> of 30
Quick & Review Question

• What is boundary object?


• State 3 sub-types of application logic
objects?

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <27> of 30
Summary of Teaching points

• Object structuring criteria and categories

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <28> of 30
Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <29> of 30
What We Will Cover Next

• Interaction Modeling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <30> of 30
Design Methods
CT015-3-2 Version 1

Interaction Modelling
Topics and Structure of the Lesson

• Interaction Modeling
-Types
-Notations
-Relationships

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <2> of 23
Learning objectives

• At the end of this lecture, you should be able to :


– Describe the purpose and use of
interaction diagrams
– Describe the elements and relationships
in interaction diagrams
– Create sequence and communication
diagrams

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <3> of 23
Key Terms

• Communication diagram
• Sequence diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <4> of 23
Dynamic Modelling
• Determine how objects interact with each other to
support use case:
– Start with external event from actor
– Determine objects needed to support
use case
– Determine sequence of internal events
following external event
– Depict on communication diagram or
sequence diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <5> of 23
Communication Diagram

• Graphically depicts objects interacting with


each other
– Show objects as boxes
– Show their message interactions as arrows
– Number sequence of messages

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <6> of 23
Sequence Diagram

• Shows sequence of object interactions in use


case
• Emphasis on messages passed between
objects
– Objects represented by vertical lines
– Messages represented by labeled
horizontal arrows

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <8> of 23
Message Sequence Description
• Describes sequence of object interactions
– Narrative description
– Corresponds to Communication Diagram or Sequence
Diagram
• Description corresponds to message sequence
numbering on diagrams
– Describe what object does on receiving message
• E.g., every time an object interacts with an entity object
– Describe the object being accessed
– Identify attributes referenced

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <10> of 23
Use Case Specification
Use case UC1_Make Order Request
Description This use case is used to help customer to make an order on the
products they have selected. The purchase can only be made via
credit card.
Actors Customer
Preconditions/ One product at least must be selected by customer to start make
Dependency an order.
Postconditions Delivery order has successfully created.
Standard Process 1- Customer provides order detail
2- System checks customer information
3- System retrieves customer payment information record
4- System checks customer credit card for purchase amount, if
approves, creates credit card purchase
5- Customer confirm the order
6- System create delivery order with order details and customer
details
7- System display success order and display order information to
customer
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <11> of 23
Use Case Specification

Alternative Step 3a: No payment detail found


Process 3a.1- The system prompts customer a page for payment details
31.2- Once completed, proceed to step 4.

Exception Flow Step 2a: Not login into account / Invalid account
2a.1- The system prompts customer request to login or create an
account
2a.2- The flow continue from step 1

Step 3b: Credit card request denied


3b.1- The system prompts error message.
3b.2- The customer have an option to enter new credit card details
proceed to step 3a, or cancel the order proceed to step 5a.

Step 5a: Cancel order


5a.1- The system prompt cancelation successful
5a.2- Terminate the order process
5a.3- Exit the use case

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <11> of 23
Message Sequence Description
for Make Order Request
• 1: Customer provides order detail
• 2: System checks customer information
• 3: System retrieves customer payment information
record
• 4: System checks customer credit card for purchase
amount, if approves, creates credit card purchase
• 5: Customer confirm the order
• 6: System create delivery order with order details and
customer details
• 7: System display success order and display order
information to customer
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <11> of 23
Communication Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <7> of 23
Communication Diagram
• Make Order Request use case

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <7> of 23
Sequence Diagram
• Make Order Request use case

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <9> of 23
Combined Fragments

• Combined fragment is an interaction fragment which


defines a combination (expression) of interaction
fragments.
• A combined fragment is defined by an interaction
operator and corresponding interaction operands.
• Through the use of combined fragments the user will be
able to describe a number of traces in a compact and
concise manner.
• Purpose: Eliminate repetitive modeling

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <12> of 23
Combined Fragments
Fragment type Description

Opt Optional. Encloses a sequence that might or might not happen. You can specify, in the
guard, the condition under which it occurs.
Alt Contains a list of fragments that contain alternative sequences of messages. Only one
sequence occurs on any occasion.

You can put a guard in each fragment to indicate under what condition it can run. A guard
of else indicates a fragment that should run if no other guard is true. If all guards are false
and there is no else, then none of the fragments executes.

Loop The fragment repeats some number of times. You can indicate in the guard the condition
under which it should repeat.

Loop combined fragments have the properties Min and Max, which indicate the minimum
and maximum number of times that the fragment can be repeated. The default is no
restriction.

Ref Interaction use is interaction fragment which allows to use (or call) another interaction.
Large and complex sequence diagrams could be simplified with interaction uses. It is also
common reusing some interaction between several other interactions.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <13> of 23
Combined Fragments
Alternative
fragment
box Optional
fragment
box

Interaction use
Loop/iterative / reference
fragment box fragment box

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <14> of 23
Sequence Diagram
• Make Order
Request use
case

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <15> of 23
Sequence versus Communication
Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <19> of 23
Quick & Review Question

• When would you use a sequence versus a


communication diagram?
• What is an interaction use in a sequence
diagram? Why would you use one?

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <20> of 23
Summary of Teaching points

• Interaction Modeling
-Types
-Notations
-Relationships

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <21> of 23
Exercise
Use case UC2_Delete Order
Description This use case is used to help admin to delete an order on the products they
have selected. The delete feature can only be access in admin panel.
Actors Admin
Preconditions/ One product at least must be selected by customer to start make an order.
Dependency
Postconditions Order has successfully deleted.
Standard Process 1- System display list of order
2- Admin select Order, and click delete
3- System request for confirmation
4- Admin confirm the deletion process
6- System delete the order in database
7- System display success deleted order
Alternative None

Exception 1a: No Order Record


1a.1 – System display message no order record found
1a.2 – Exit use case

4a: Admin Cancel Delete Operation


4a.1 – System terminate delete process
4a.2 – Success terminate delete displayed
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <23> of 23
Exercise
Use case1 UC2_Search Order
Description2 This use case is used to help admin to search an order has been
made by customer.
Actors1 Admin
Preconditions/ At least one order must be exist to use this features.
Dependency1
Postconditions1 Order made by customer has successfully listed.
Standard 1- Admin select order status pending/completed, and submit
Process5 2- System validate the record in database
3- System display list of record based on request status
Alternative1 None
Exception3 1a: No Order Record
1a.1 – System display message no order record found
1a.2 – Exit use case

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <23> of 23
Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <22> of 23
What We Will Cover Next

• Finite State Machines

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide <23> of 23
Design Methods
CT015-3-2 Version 1

Finite State Machine


Topics and Structure of the Lesson

• Finite State Machine Modeling


-Notations
-Relationships

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Learning objectives

• At the end of this lecture, you should be


able to :
– Describe the elements in a state machine
diagram
– Describe the relationships in a state
machine diagram
– Create a state machine diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Keywords

• State
• Orthogonal

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Finite State Machines

• Also referred to as state machine


• Finite state machines are used for
modeling the control and sequencing view
of a system or object.
• Notations used to define finite state
machines are the state transition,
triggering events and actions.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Finite State Machines

• Shows the behavior of one object of a


single class
– shows all possible states of this object
– shows how the object’s state changes as a
result of messages it receives

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


States
• State = a recognizable situation that exists over
an interval of time
•The arrival of an event at the finite state machine
usually causes a transition from one state to
another
•Some states represent the state machine waiting
for an event from the external environment

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


States

Updating
Waiting for Approval
Appointment

Creating Cancelling
Appointment Appointment

Viewing Appointment
List

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹#› of 20
State Actions

• Actions: Work the system does in response


to events
– States can have entry, exit, and do
activities performed while in the state
• E.g.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


State Action

Creating Appointment Cancelling Appointment

Entry/ load appointment Entry/ received request


detail
Do/ saving into database Do/ cancelling the
appointment
Exit/ display message Exit/ display message

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹#› of 20
Transitions

• A transition is the path taken during a


change of state from one state to the next
in response to a triggeringevent
• Guard condition: Optional condition to be
evaluated; if false, the transition is not taken

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


State Machines

• State transitions:
Possible paths the
system may take from
one state to another
• Triggering events:
Instantaneous events that
stimulate state transitions

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Transitions

Initiate [true]/ get appointment list

Viewing Appointment
List Trigger event or action

Trigger event or action [Guard condition]

Applying
Appointment

Submit Clicked submitted [false]/ request new input


[true]/ Creating

submitted [true]/ sent to approval queue


Creating
Waiting for Approval
Appointment

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹#› of 20
Orthogonal States

• To model different views of the same


object’s state.
• Are composite states with two or more
regions within the state.
• The two orthogonal statecharts are shown
separated by dashed line

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Playing
Radio

Display
Current
Time

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Choice Points

• Choice points realize a dynamic


conditional branch
– Outputs transitions, each with a guard
condition, one of which must be true.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Junctions
• Junctions realize a static conditional branch
– Can be used to split or join multiple transitions
– Guard conditions are evaluated before transitions

are fired
• If all guard conditions return false, then remain in the source

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Example of state machine
diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Example of state machine
diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Example of state machine
diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Quick & Review Question

• Which model elements can have


associated state machine diagrams?
• In what cases would you use state
machine diagrams?
• What is a choice point?
• What is a junction?

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Summary of Teaching points

• Finite State Machine Modeling


-Notations
-Relationships

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


What We Will Cover Next

• Revision and Assignment


Discussion/Progress

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1


Design Methods
CT015-3-2 & Version 1

Other UML Diagram


Topic & Structure of The Lesson

• Introduction to other UML diagrams

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹308› of 20
Learning Outcomes

• At the end of this topic, You should be able to:


- Have a basic knowledge of other UML diagrams .

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹309› of 20
Lecture Content

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹310› of 20
Structure Diagrams

• Object Diagram,
• Component Diagram,
• Package Diagram,
• Deployment Diagram.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹5› of 20
Object Diagram

• Is a graph of instances, including objects and


data values.

• A static object diagram is an instance of a class


diagram; it shows a snapshot of the detailed
state of a system at a point in time.

• Use a subset of the elements of a class diagram


in order to emphasize the relationship between
instances of classes at some point in time
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹6› of 20
Object Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹7› of 20
Component Diagram
• Higher level of
abstraction than a
Class Diagram
• Component
diagram shows
components,
provided and
required
interfaces, ports,
and relationships
between them.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹8› of 20
Component Diagram

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹315› of 20
Package Diagram
• Package diagram is UML structure diagram
which shows structure of the designed system at
the level of packages.
• Reflect the organization of packages and their
elements.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹316› of 20
Deployment Diagram

• Models the run-time architecture of a system


• Shows the configuration of the hardware
elements (nodes) and shows how software
elements and artifacts are mapped onto those
nodes

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹317› of 20
Composite Structure Diagram

• Composite Structure Diagram could be


used to show:
- internal structure of a classifier
- classifier interactions with environment
through ports,
- a behavior of a collaboration

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹318› of 20
Composite Structure Diagram

Overview shows
elements of
internal structure
of structured
classifier - roles,
parts, connectors.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹319› of 20
Interaction Diagrams

• Communication Diagram,
• Timing Diagram,
• Interaction Overview Diagram.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹320› of 20
Communication Diagram

• Formerly called a collaboration diagram, is an


interaction diagram that shows similar
information to sequence diagrams but its primary
focus is on object relationships.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹321› of 20
Timing Diagram
• Display the change
in state or value of
one or more
elements over time.
It can also show the
interaction between
timed events and the
time and duration
constraints that
govern them.

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹322› of 20
Interaction Overview Diagram.
• A form of activity
diagram in which
the nodes represent
interaction
diagrams.
Interaction
diagrams can
include sequence,
communication,
interaction overview
and timing diagrams
• Higher level view

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹323› of 20
Reading

• More details descriptions are available


from:
– http://www.sparxsystems.com/resources/
uml2_tutorial/
Others:
• http://www.tutorialspoint.com/uml/uml_2_o
verview.htm
• http://www.agilemodeling.com/essays/uml
Diagrams.htm
CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹324› of 20
Summary of Main Teaching Points

• Other UML Diagrams

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹325› of 20
Question and Answer Session

Q&A

CT015-3-2 Design Methods Object Oriented Analysis and Modelling Part 1 Slide ‹326› of 20

You might also like