Title: Object Modeling OBJECT-ORIENTED ANALYSIS AND MODELING USING THE UML Read: Chapter 6
1Object ModelingOBJECT-ORIENTED ANALYSIS AND
MODELING USING THE UML Read Chapter 6
- Dr Manolya Kavakli
- Department of Computing
- Macquarie University
- Sydney, Australia
2Chapter Objectives
- Explain how object-oriented analysis can be used
to describe an information system - Define object modeling terms and concepts,
including objects, attributes, methods, messages,
classes, and instances - Explain relationships among objects and the
concept of inheritance - Draw an object relationship diagram
3Chapter Objectives
- Describe Unified Modeling Language (UML) tools
and techniques, including use cases, use case
diagrams, class diagrams, sequence diagrams,
state transition diagrams, and activity diagrams - Explain the advantages of using CASE tools in
developing the object model - Explain how to organize an object model
4Introduction
- You learn about object-oriented analysis, which
is another way to view and model system
requirements - You use object-oriented methods to document,
analyze, and model the information system
5Introduction to Object Modeling
- Object-oriented analysis (OOA)
- an approach used to
- study existing objects to see if they can be
reused or adapted for new uses - 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.
6Overview 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
7Overview of Object-Oriented Analysis
- Object-Oriented Terms and Concepts
- Unified Modeling Language (UML)
- Attributes
- Methods
- Message
- Class
- Instance
8Objects, 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
- Attribute the data that represent
characteristics of interest about an object. - Object instance each specific person, place,
thing, or event, as well as the values for the
attributes of that object.
9Objects, Attributes, Instances (cont.)
10Overview of Object-Oriented Analysis
11Overview of Object-Oriented Analysis
12Overview of Object-Oriented Analysis
13Overview of Object-Oriented Analysis
14Overview 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
15Overview 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
16Method (Behavior) Encapsulation
- Behavior the set of things that the object can
do that correspond to functions that act on the
objects data (or attributes). - In object-oriented circles, an objects behavior
is commonly referred to as a method, operation,
or service. - For object order
- Addorder
- Deleteorder
- modifyorder
-
17Overview of Object-Oriented Analysis
- Polymorphism
- The same message to two different objects can
producethe same result. - Black box
- A messages triggers changes within the object
without specifying how the changes must be
carried out. - E.g., Gas pump
- Blackbox is an example of Encapsulation
- All data and methods are self-contained.
- The object prevents its internal code from being
altered by another object.
18Overview of Object-Oriented Analysis
- Messages
- 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 - These objects could be used by other schools
19Overview 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
20Overview of Object-Oriented Analysis
21Relationships Among Objects and Classes
- Inheritance
- enables a child object to derive attributes from
a parent object. - Child
- Parent
22Relationships Among Objects and Classes
- Object Relationship Diagram
- provides an overview of the system.
23UML
- 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
24Object/Class Relationships
- Object/class relationship a natural business
association that exists between one or more
objects and classes.
25Aggregation
- 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.
26Composition
- 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.
27Messages
- Message communication that occurs when one
object invokes another objects method (behavior)
to request information or some action
28Object 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
29Object 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
30Object 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 - Use case description
- When you identify use cases, try to group all the
related transactions into a single use case
31Object Modeling with the Unified Modeling Language
- Use Case Diagrams
- Use case diagram
- System boundary
- After you identify the system boundary, you place
the use cases on the diagram, add the actors, and
show the relationships
32Object Modeling with the Unified Modeling Language
- Class Diagrams
- Class Diagram
- 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 classs
attributes and methods - Cardinality
33Object Modeling with the UML
- Class Diagrams represents a detailed view of a
single use case - Show classes and their relationships
34Object Modeling with UML
- Sequence Diagrams dynamic model of a use case,
showing the interaction over time - Sequence diagram
- Include symbols such as
- Classes
- Lifelines duration of interaction
- X end of lifeline
- Messages
- Focuses indicate when an object sends/receives
messages
35Object Modeling with the Unified Modeling Language
- State Transition Diagrams show how an object
changes from one stateto another, depending on
events
36Object Modeling with the Unified Modeling Language
- State Transition Diagrams
- The small circle to the left is the initial
state, or the point where the object first
interacts with the system - Reading from left to right, the lines show
direction and describe the action or event that
causes a transition from one state to another - The circle at the right with a hollow border is
the final state
37Object Modeling with the Unified Modeling Language
- Activity Diagrams resembles a horizontal
flowchart that shows the actions and events as
they occur
38Object Modeling with the Unified Modeling Language
- Activity Diagrams
- 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
39Object Modeling with the Unified Modeling Language
- CASE Tools
- Object modeling requires many types of diagrams
to represent the proposed system - Creating the diagrams by hand is time-consuming
and tedious, so systems analysts rely on CASE
tools to speed up the process and provide an
overall framework for documenting the system
components
40- UML http//www.youtube.com/watch?v2yoahl1Hf5Ufea
turerelated - MicroSoft Visio
- http//www.youtube.com/watch?vgCMWCBLl7Q4feature
related - http//www.youtube.com/watch?vxmDjmm0btO8feature
related
41Organizing the Object Model
- You should develop an object relationship diagram
that provides an overview of the system - You should organize your use cases and use case
diagrams so they can be linked to the appropriate
class, state transition, sequence, and activity
diagrams - It is much easier to repair a diagram now than to
change the software later
42Modeling the Functions of the System
- The following steps evolve the requirements
use-case model into an analysis use-case model - Identify, define, and document new actors.
- Identify, define, and document new use cases.
- Identify any reuse possibilities.
- Refine the use-case model diagram (if necessary).
- Document system analysis use-case narratives.
- System analysis use case a use case that
documents the interaction between the system user
and the system. It is highly detailed in
describing what is required but is free of most
implementation details and constraints.
43Revised System Use-Case Model Diagram
44Use-Case Narrative
45Use-Case Narrative (cont.)
46Abstract Use-Case Narrative
47Modeling Use-Case Activities
- Activity diagram a diagram that can be used to
graphically depict the flow of a business
process, the steps of a use case, or the logic of
an object behavior (method). - One or more activity diagram can be constructed
for each use case (more than one if use case is
long or contains complex logic). - Solid dot represents the start of the process.
- A rounded-corner rectangle represents an
activity or task that needs to be performed. - Arrows depict triggers that initiate activities.
- A solid black bar is a synchronization bar that
allows you to depict activities that occur in
parallel.
48Example of an Activity Diagram
49Finding and Identifying the Business Objects
- Find the Potential Objects
- Review each use case to find nouns that
correspond to business entities or events. - Select the Proposed Objects
- Not all nouns represent business objects.
- Ask
- Is the candidate a synonym of another object?
- Is the candidate outside the scope of the system?
- Is the candidate a role without unique behavior,
or is it an external role? - Is the candidate unclear or in need of focus?
- Is the candidate an action or an attribute that
describes another object?
50Partial Use-Case Narrative with Nouns Highlighted
51Potential Object List
52Proposed Object List
53Organizing the Objects and Identifying their
Relationships
- Identifying Associations and Multiplicity
- Identifying Generalization/Specialization
Relationships - Identifying Aggregation Relationships
- Prepare the Class Diagram
- Class diagram a graphical depiction of a
systems static object structure, showing object
classes that the system is composed of as well as
the relationships between those object classes.
54Chapter Summary
- This chapter introduces object modeling, which is
a popular technique that describes a system in
terms of objects - The Unified Modeling Language (UML) is a widely
used method of visualizing and documenting an
information system - At the end of the object modeling process, you
organize your use cases and use case diagrams and
create class, sequence, state transition, and
activity diagrams