Você está na página 1de 29

OBJECT ORIENTED DATA

MODELING
Bernard G. Sanidad
Objectives
2
At the end of the chapter, the student would be able to:
Understand the concept of Object oriented data
model;
Describe the phases of an object-oriented
development cycle;
Enumerate the advantages of object-oriented
modeling;
Compare object-oriented model with E-R model;
Distinguished the difference between Inheritance,
Encapsulation and Polymorphism.


Object-Oriented Data Modeling
3
Centers around objects and classes
Involves inheritance
Encapsulates both data and behavior
Benefits of Object-Oriented Modeling
Ability to tackle challenging problems
Improved communication between users, analysts, designers,
and programmers
Increased consistency in analysis, design, and programming
Explicit representation of commonality among system
components
System robustness
Reusability of analysis, design, and programming results
4
Progressive and interative development process
5
OO vs. EER Data Modeling
Object Oriented EER
Class
Entity type
Object
Entity instance
Association
Relationship
Inheritance of attributes Inheritance of attributes
Inheritance of behavior
No representation of
behavior
Classes
6
Class: An entity that has a well-defined role in
the application domain, as well as state,
behavior, and identity
Tangible: person, place or thing
Concept or Event: department, performance,
marriage, registration
Artifact of the Design Process: user interface,
controller, scheduler

Superclass general category
Instance
Instance - is a specific member of a class.



Objects
12
Object - is an instance of a class that encapsulates data
and behavior.
represents a real person, place, event, or transaction.
are similar to nouns.
State - An objects properties (attributes and
relationships) and the values those properties have.
Behavior - The way in which an object acts and reacts.
Behavior is expressed through operations that can be
performed on it


The state of an object is an adjective that
describes the objects current status.
Student can be a :
Future student
Current student
Past student.

Bank account can be:
Active
Inactive
Closed
Frozen
Attributes
- are similar to adjectives that describe the
characteristics of an object.
e.g.
if you own a car, it has attributes such as make,
model, and color.

Methods
are tasks or functions that the object performs when
it receives a message, or command, to do so.
defines specific tasks that an object can perform.
resemble verbs that describe what and how an
object does something.
The implementation of an operation
Example:
A car performs a method called OPERATE WIPERS
when you send a message by moving the proper
control.


Message - is a command that tells an object to
perform a certain method.

Polymorphism
concept that a message gives different meanings to
a different objects.
Abstract Operation: Defines the form or protocol of
the operation, but not its implementation
Polymorphism: The same operation may apply to
two or more different classes in different ways


Encapsulation
The technique of hiding the internal implementation
details of an object from its external view.
all data and methods are self-contained.
limiting access to internal processes, an object
prevents its internal code from being altered by
another object or process.

State, Behavior, Identity
20
State: attribute types and values
Behavior: how an object acts and reacts
Identity: every object has a unique identity, even if
all of its attribute values are the same.
21
Class diagram shows the static structure of an object-oriented
model: object classes, internal structure, relationships.
22
Object diagram shows instances that are compatible
with a given class diagram.
Operation
23
A function or service that is provided by all
instances of a class
Types of operations:
Constructor: creates a new instance of a class
Query: accesses the state of an object but does not alter
its state
Update: alters the state of an object
Scope: operation applying to the class instead of an
instance

Operations implement the objects behavior
Associations
24
Association:
Named relationship among object classes
Association Role:
Role of an object in an association
The end of an association where it connects to a class
Multiplicity:
How many objects participate in an association.
Lower-bound..Upper bound (cardinality)
25

Examples of association relationships of different degrees
Lower-bound upper-bound

Represented as:
0..1, 0..*, 1..1, 1..*

Similar to minimum/maximum
cardinality rules in EER
Unary
Binary
Ternary
Association Class
26
An association that has attributes or operations of its
own or that participates in relationships with other
classes

Like an associative entity in ER model

Overriding Inheritance
27
Overriding: The process of replacing a method
inherited from a superclass by a more specific
implementation of that method in a subclass
For Extension: add code
For Restriction: limit the method
For Optimization: improve code by exploiting
restrictions imposed by the subclass
Multiple Inheritance
28
Multiple Classification: An object is an instance of
more than one class

Multiple Inheritance: A class inherits features from
more than one superclass
Aggregation
29
Aggregation: A part-of relationship between a
component object and an aggregate object

Composition: A stronger form of aggregation in which
a part object belongs to only one whole object and
exists only as part of the whole object

Recursive Aggregation: Composition where component
object is an instance of the same class as the
aggregate object

Você também pode gostar