Object-Oriented Concepts
Prof. Talib Damij, Ph.D. Faculty of Economics University of Ljubljana
Object-Oriented Concepts
Object-oriented concepts
Information system
object-oriented concepts:
Objects
An object is any thing, real or abstract, about which we store data and those operations that manipulate the data (Martin, Odell 1992). An object is a tangible or intangible thing that can be classified and uniquely identified (Sanders, 1995). An object is simply something that makes sense in an application context (Rumbaugh et al., 1991).
Prof. Talib Damij, Ph.D. Faculty of Economics, University of Ljubljana
3
Objects
An object is anything identified in the process of information system development and recognized by its properties (attributes) and behavior (operations).
Order, Shipment, organization. Invoice, Customer sales
Objects
Object identity
Identity (ID) is the property of an object which uniquely distinguishes it from other objects.
For example, invoice no. 1346, invoice no. 2612 and invoice no. 5270 - objects in the sales organization.
Classes
An object class describes a group of objects with similar properties (attributes), common behavior (operations), common relationships to other objects, and common semantics (Rumbaugh et al., 1991). Each group of objects - similar properties, behavior and relationships an abstraction called the object class.
Prof. Talib Damij, Ph.D. Faculty of Economics, University of Ljubljana
6
Classes
For example, patients John Kim, Joe Brown, and Mary Hurt are objects with similar properties, behavior and relationships. Therefore, for this group of objects we created an object class called PATIENT which describes what is common to all these objects (patients).
Objects
John Kim John Brown Mary Hurt
Class of Patients
PATIENT
Prof. Talib Damij, Ph.D. Faculty of Economics, University of Ljubljana
7
Attributes
An attribute is a data value held by the object in a class. An attribute is a property of objects in a class.
Patient-Id, Name, Address, Age, Weight, and Sex are attributes of class PATIENT. Customer-Id, Name, Address, and Phone, for example, are attributes of class CUSTOMER.
Attributes
A candidate key is a minimal set of attributes which uniquely identifies and represents an object.
Attribute Patient-Id - candidate key Patient-Id - minimal set of attributes identifies each object in class PATIENT.
Associations
Associations are relationships between attributes and also between classes.
10
Associations
One-to-one
One-to-one association
11
Associations
One-to-many
One-to-many association
12
Associations
Many-to-many
13
Operations
An operation is a function or transformation that may be applied to or by objects in a class (Rumbaugh et al., 1991). Each class operations behavior of objects in this class.
ORDER CLASS NAME Order-ID Date Accept Cancel Modify
14
Operations
Methods specify the way in which operations are encoded in software (Martin, 1993).
15
Operations
The operations of any class can access only the data structures of this class.
For example, if object A needs to use or manipulate data structures of object B, then object A has to call a certain operation of object B.
16
Inheritance
Inheritance: identifying and defining a system of hierarchies between classes, where a subclass can inherit attributes and operations from a higher superclass.
Inheritance can be added in two directions:
Prof. Talib Damij, Ph.D. Faculty of Economics, University of Ljubljana Object-Oriented Concepts Object Oriented Methodologies
17
Inheritance
Generalization
Generalization: creating a higher superclass for similar characteristics (common attributes and operations) of a determined group of existing classes.
ORDER
GENERALIZATION
Is-a
CUST-ORDER
Is-a
ORG-ORDER
18
Inheritance
Specialization
Specialization is refining existing classes into specialized subclasses. The created subclasses inherit the characteristics of the classes to which they are related. In addition, they can have their own unique characteristics.
STUDENT
SPECIALIZATION
Is-a
GRADUATE
Is-a
UNDERGRADUATE
19
Inheritance
Generalization and specialization are two different analyses of the same relationship.
20