Professional Documents
Culture Documents
Object Modeling
Object Modeling
Object Modeling
Object Modeling
Introduction to Object Modeling
Object-oriented analysis (OOA)
an approach used to
1. study existing objects to see if they can be
reused or adapted for new uses
2. define new or modified objects that will be
combined with existing objects into a useful
business computing application
Object modeling – a technique for identifying
objects within the systems environment and the
relationships between those objects.
Overview of Object-Oriented Analysis
• Object-oriented analysis is a popular approach
• sees a system from the viewpoint of the
objects themselves as they function and
interact
3
Overview of Object-Oriented Analysis
• Object-Oriented Terms
and Concepts
– Unified Modeling
Language (UML)
– Attributes
– Methods
– Message
– Class
– Instance
4
Objects, Attributes, & Instances
Object – something that is or is capable of being seen,
touched, or otherwise sensed, and about which users
store data and associate behavior.
– Person, place, thing, or event
– Employee, customer, instructor, student
– Warehouse, office, building, room
– Product, vehicle, computer, videotape
7
Overview of Object-Oriented Analysis
• Objects
8
Overview of Object-Oriented Analysis
• Objects
9
10
Overview of Object-Oriented Analysis
• Attributes
– If objects are similar to nouns, attributes are
similar to adjectives that describe the
characteristics of an object
– Some objects might have a few attributes; others
might have dozens
– State:
• Describes the objects current status
11
Overview of Object-Oriented Analysis
• Methods
– A method defines
specific tasks that an
object can perform
– Just as objects are
similar to nouns and
attributes are similar to
adjectives, methods
resemble verbs that
describe what and how
an object does
something
12
Overview of Object-Oriented Analysis
• Messages
– A massage is a command that tells an object to
perform a certain method.
– A major advantage of O-O designs is that systems
analysts can save time and avoid errors by using
modular objects, and programmers can translate
the designs into code, working with reusable
program modules that have been tested and
verified
13
Method (Behavior) & Encapsulation
Behavior – the set of things that the object can do
that correspond to functions that act on the object’s
data (or attributes).
– In object-oriented circles, an object’s behavior is
commonly referred to as a method, operation, or service.
15
Overview of Object-Oriented Analysis
• Classes
– An object belongs to a group or category called a
class
– All objects within a class share common attributes
and methods
– Subclasses
– Superclass
16
Overview of Object-Oriented Analysis
• Classes
17
RELATIONSHIPS AMONG OBJECTS AND
CLASSES
18
Relationships Among Objects and Classes
• Inheritance:
• enables a child object to
derive attributes from a
parent object.
• Child
• Parent
19
Relationships Among Objects and Classes
• Object Relationship Diagram:
• provides an overview of the system.
20
UML
Unified Modeling Language (UML) – a set of
modeling conventions that is used to specify or
describe a software system in terms of objects.
– The UML does not prescribe a method for
developing systems—
– only a notation that is now widely accepted as a
standard for object modeling.
– DFDs model data and processes
– UML describes OO systems
Object/Class Relationships
Object/class relationship – a natural business
association that exists between one or more
objects and classes.
Aggregation
Aggregation – a relationship in which one larger “whole” class
contains one or more smaller “parts” classes. Conversely, a
smaller “part” class is part of a “whole” larger class.
Composition
Composition – an
aggregation
relationship in
which the “whole”
is responsible for
the creation and
destruction of its
“parts.” If the
“whole” were to
die, the “part”
would die with it.
Messages
Message – communication that occurs when one
object invokes another object’s method (behavior) to
request information or some action
Object Modeling with the Unified
Modeling Language
• The UML uses a set of symbols to represent
graphically the various components and
relationships within a system
• It mainly is used to support object-oriented
systems analysis and to develop object models
26
Object Modeling with the Unified
Modeling Language
• Use Case Modeling
– Actor
– Symbol for a use case is
an oval with a label that
describes the action or
event
– Use cases also can
interact with other use
cases
27
Object Modeling with the Unified
Modeling Language
• Use Case Modeling
– When the outcome of one use case is
incorporated by another use case, we say that the
second case uses the first case
28
Use case description
29
Use Case Diagrams
– A use case diagram is a visual summary of several
related use cases within a system or subsystem
– The system boundary shows what is included in the
system (inside the rectangle) and what is not
included in the system (outside the rectangle).
– After you identify the system boundary, you place
the use cases on the diagram, add the actors, and
show the relationships
30
31
Class Diagrams
– class diagram represents a detailed view of a single
use case, shows the classes that participate in the use
case, and documents the relationship among the
classes.
– Evolves into a physical model and finally becomes a
functioning information system
– Each class appears as a rectangle, with the class name
at the top, followed by the class’s attributes and
methods
– Cardinality which describes how instances of one class
relate to instances of another class
32
Object Modeling with the UML
• Class Diagrams: represents a detailed view of a
single use case
• Show classes and their relationships
33
Sequence Diagrams
• : A sequence diagram is a dynamic model of a
use case, showing the interaction among classes
during a specified time period.
• Include symbols such as:
• Classes
• Lifelines: duration of interaction
– X: end of lifeline
• Messages
• Focuses: indicate when an object sends/receives messages
34
Sequence Diagrams
CLASSES that send or receive messages are shown at the top of the sequence
diagram.
LIFELINES A lifeline is identified by a dashed line. The lifeline represents the time
during which the object above it is able to interact with the other objects in the use
case. An X marks the end of the lifeline.
FOCUSES A focus is identified by a narrow vertical shape that covers the lifeline.
The focus indicates when an object sends or receives a message.
35
Sequence Diagrams
36
State Transition Diagrams
• show how an object changes from one state
to another, depending on events that affect
the object.
38
Activity Diagrams
• Activity Diagrams: resembles a horizontal
flowchart that shows the actions and events
as they occur
39
Sequence diagrams, state transition
diagrams, and activity diagrams are
dynamic modeling tools that can help a
systems analyst understand how
objects behave and interact with the
system.
40