0% found this document useful (0 votes)
14 views39 pages

Saad 6

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views39 pages

Saad 6

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Chapter 6

Object Modeling

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part.
 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

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 2
 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

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 3
 O-O methodology is popular because it
integrates easily with object-oriented
programming languages such as Java, Smalltalk,
VB.Net, Python, and Perl
 Programmers also like O-O code because it is
modular, reusable, and easy to maintain
 The end product of O-O analysis is an object
model
◦ Object model: Represents the information system in
terms of objects and O-O concepts

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 4
 Object-Oriented Terms and Concepts
◦ Unified modeling language (UML)
 Method of visualizing and documenting an information
system
◦ Attributes: Characteristics that describe an object
◦ Methods: Tasks or functions that the object performs
◦ Message: Command to perform a specific function
◦ A class is a group of similar objects
 Instance: Specific member of a class

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 5
 Objects
◦ Represented as a
rectangle
 The object name is at
the top, followed by
the object’s attributes
and methods

FIGURE 6-1 Objects have attributes,


can send and receive messages, and
perform actions called methods.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 6
FIGURE 6-2 The PARENT
object includes four
attributes and two
methods. Mary Smith,
Ahmed Ali, and Anthony
Greene are instances of
the PARENT object.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 7
FIGURE 6-3 The CHILD object includes five attributes and five methods. James Smith,
Amelia Ali, and Misty Greene are instances of the CHILD object.
Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 8
 Attributes
◦ Describe the characteristics of an object
◦ The number of attributes required depends on:
 Business requirements of the information system
 Requirements of users
◦ Attributes of an object are defined during the
system development process
◦ Objects possess a state
 State: Describes the object’s current status

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 9
 Methods
◦ Specific tasks that an object can perform
◦ Identify functions performed
◦ Describe the functions performed

FIGURE 6-4 The MORE FRIES method


requires the server to perform seven
specific steps.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 10
 Message
◦ A command that tells an object to perform a certain
method
◦ Polymorphism: Concept that a message gives
different meanings to different objects

FIGURE 6-5 In an example of polymorphism, the message GOOD NIGHT


produces different results, depending on which object receives it.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 11
 Message (cont.)
◦ A message to the object triggers changes within the
object without specifying how the changes must be
carried out
 An object can be viewed as black box
◦ Encapsulation: Idea that all data and methods are
self-contained, as in a black box

Figure 6-6 In a school information system, an INSTRUCTOR object sends an ENTER GRADE
message to an instance of the STUDENT RECORD class.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 12
 Classes
◦ An object belongs to a group or category called a
class
 All objects within a class share common attributes and
methods
◦ Subclasses: Categories within a class
◦ Super-class: A class belonging to a general
category

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 13
FIGURE 6-7 The VEHICLE class
includes common attributes and
methods. CAR, TRUCK, MINIVAN, and
SCHOOL BUS are instances of the
VEHICLE class.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 14
FIGURE 6-9 At the fitness center, the PERSON superclass includes common
attributes and methods. EMPLOYEE is a class within the PERSON superclass.
INSTRUCTOR is a subclass within the EMPLOYEE class.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 15
 Relationships
◦ Enable objects to communicate and interact as
they perform business functions and transactions
◦ Describe what objects need to know about each
other
 Inheritance
◦ The strongest relationship
◦ Enables an object to derive one or more of its
attributes from another object

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 16
FIGURE 6-10 An inheritance relationship exists between the INSTRUCTOR and
EMPLOYEE objects. The INSTRUCTOR (child) object inherits characteristics
from the EMPLOYEE (parent) class and can have additional attributes of its own.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 17
 Object Relationship Diagram
◦ Displays objects and how they interact to perform
business functions and transactions

FIGURE 6-11 Object relationship


diagram for the fitness center.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 18
 UML uses a set of symbols to represent
graphically the various components and
relationships within a system
 Use Case Modeling
◦ Use case: Represents the steps in a specific
business function or process
◦ An external entity, called an actor, initiates a
use case by requesting the system to perform a
function or process

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 19
 Use Case Modeling (Cont.)

◦ UML symbol for a use case is an oval with a label that


describes the action or event
◦ The actor is shown as a stick figure, with a label that
identifies the actor’s role
◦ Use case description: Documents the name of the use
case, the actor, a description of the use case
 Provides a step-by-step list of the tasks and other key
descriptions and assumptions

FIGURE 6-12 In a medical office system, a PATIENT


(actor) can MAKE APPOINTMENT (use case).

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 20
FIGURE 6-13 When a student adds a class, PRODUCE FITNESS-CLASS ROSTER uses the results of
ADD CLASS to generate a new class roster. When an instructor changes his or her availability, UPDATE
INSTRUCTOR INFORMATION uses the CHANGE AVAILABILITY use case to update the instructor’s
information.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 21
FIGURE 6-14 The
ADD NEW
STUDENT use
case description
documents the
process used to
add a current
student into an
existing class.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 22
 Use Case Diagrams
◦ A visual summary of several related use cases
within a system or subsystem
◦ The first step is to identify the system boundary
which is represented by a rectangle
 System boundary: Shows what is included in the
system (inside the rectangle) and what is not included
in the system (outside the rectangle)

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 23
FIGURE 6-16 A use case
diagram to handle work at
an auto service
department.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 24
 Class Diagrams
◦ Show the object classes and relationships involved
in a use case
◦ Each class appears as a rectangle, with the class
name at the top, followed by the class’s attributes
and methods
◦ Lines show relationships between classes and have
labels identifying the action that relates the two
classes
◦ Includes a concept called cardinality
 Cardinality: Describes how instances of one class
relate to instances of another class

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 25
FIGURE 6-17 Examples of UML notations that indicate the nature of the relationship between
instances of one class and instances of another class.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 26
FIGURE 6-18 Class diagram
for a sales order use case
(attributes and methods
omitted for clarity).

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 27
 Sequence Diagrams
◦ Dynamic model of a use case, showing the
interaction among classes during a specified time
period
◦ Graphically document the use case by showing the
classes, the messages, and the timing of the
messages
◦ Include symbols that represent classes, lifelines,
messages, and focuses

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 28
 Sequence Diagrams (Cont.)

◦ Classes
 Send or receive messages
 Shown at the top of the sequence diagram
◦ Lifelines
 Represent 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
◦ Messages
 Include additional information about the contents
◦ Focuses
 Indicate when an object sends or receives message

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 29
FIGURE 6-19 A sequence diagram
with two classes. Notice the X that
indicates the end of the CLASS 2
lifeline. Also notice that each message
is represented by a line with a label
that describes the message, and that
each class has a focus that shows the
period when messages are sent or
received

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 30
FIGURE 6-20 The sequence diagram for the ADD NEW STUDENT use case.
The use case description for ADD NEW STUDENT is shown in Figure 6 14.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 31
 State Transition Diagrams
◦ Show how an object changes from one state to
another, depending on events that affect the object
◦ All possible states must be documented in the state
transition diagram
◦ States appear as rounded rectangles with the state
names inside

FIGURE 6-21 An example of a


state transition diagram for a bank
account.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 32
 Activity Diagrams
◦ Show actions and events as they occur
◦ Show the order in which the actions take place and
identify the outcomes

FIGURE 6-22 An
activity diagram shows
the actions and events
involved in withdrawing
cash from an ATM.

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 33
 Business Process Modeling (BPM)
◦ Represents the people, events, and interaction in a
system
◦ Can be used anytime during the systems
development process
◦ Compatible with object modeling

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 34
FIGURE 6-23 The
Bizagi Modeler tool
supports business
modeling and simulation
using the standard BPM
notation.
Source: bizagi.com

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 35
 CASE Tools
◦ Provide an overall framework for documenting the
system components
 Object modeling requires many types of diagrams to
represent proposed systems
 CASE tools speed up the process
◦ Ensure consistency and provide common links
 Once objects are described and used in one part of the
design, they can be reused multiple times without
further effort

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 36
 Develop an object relationship diagram that
provides an overview of the system
 Support each diagram or object definition
with clear and relevant documentation that
can be accessed easily
◦ Organize use cases and use case diagrams so they
can be linked to the appropriate class, state
transition, sequence, and activity diagrams
 Maintain accuracy

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 37
• Object modeling is a popular technique that
describes a system in terms of objects
• Object-oriented terms include classes,
attributes, instances, messages, and
methods
 Objects can send messages, or commands,
that require other objects to perform certain
methods, or tasks

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 38
 The Unified Modeling Language (UML) is a
widely used method of visualizing and
documenting an information system
 Use case describes a business situation
initiated by an actor, who interacts with the
information system
 At the end of the object modeling process,
the use cases and use case diagrams are
organized and class, sequence, state
transition, and activity diagrams are created

Copyright ©2017 Cengage Learning. All Rights Reserved. May not be scanned, copied
or duplicated, or posted to a publicly accessible website, in whole or in part. 39

You might also like