Professional Documents
Culture Documents
OBJE
CT Object=
Operations +
DAT Data
A
A program is a collection of
objects.
Operatio Operatio
ns ns
OBJE OBJE
CT CT
DATA DATA
Program= Collection of
Objects
Attributes and methods
• In object technology , operations or
functions are called methods. On the
other hand variables are called
attributes. Ear
s Eye
s
Nos
e
Tail
Leg
s
Rabbit Object and its
attributes
MESSAGES
• We can pass a message to
an object , requesting it to
perform a specific action.
• What message is specifically
required to perform a
function.
• Each object must publish a
list of methods that it
contains.
I can hear I can smell
I can see
I can run
Practical example of an
object
Attributes Methods
Roll No
Name •GetName
Class •GetClass
Division •GetDivision
Gender •GetGender
Date Of Birth •GetDateofBirth
Classes of object
• Another key concept related to
object technology is that of class. A
class Is a generic form of objects.
• From a programming perspective, we
declare an integer or a floating as int
i:
float f:
Class Object
Int i
Float f
Vehicle car
1234
Object
Class 4567
Object
7890
Object
• Figure describes a class with three objects corresponding to the class with their
unique identifier.
• A class has general characteristics , which all its object automatically inherits.
ABSTRACTION
• The concept of abstraction is very
important and fundamental in object
technology. Abstraction allows an
analyst to concentrate only on the
essential aspects of objects and to
ignore their non-key aspects. It
facilitates postponing of many
decisions to as late a date as
possible.
Encapsulation
• Encapsulation generally protects the
data in an object. One object cannot
interfere with the data within another
object except though properly
authorized requests.
CREATE UPDATE
EMPLOYEE
Employee object give the view of a black box , it tells the outside world
that its interface is made up of two methods, create and update. How
they work internally is not known.
• Thus, the main idea of encapsulation is
hiding of internal details of an object.
Changes to internal details doesn't cause
ripple changes to other object.
• By using encapsulation object, become
Message
self-sufficient and fairly independent of
each other.
Interface
Interface
Interface
? Message
Message
Interface
Message
Inheritance
• Inheritance is the process by which one object
acquires the properties of one or more other
objects.
• It involves sharing of attributes and operations
or methods among classes based on a
hierarchical relationships.
• A class can be created at a broad level and
then refined progressively into finer
subclasses. Each subclasses incorporates, or
inherits all the properties of its super class to
which it can add its own properties.
Object technology and
RDBMS
Identifying a record uniquely.
Identifying a RDBMS record uniquely in a table is the primary key associated
•
with that record. But In object technology, an object has an implicit object ID,
which helps the underlying technology to identify that record.
The main difference is that the primary key is explicit i.e visible to the entire
•
world whereas the object i.d is implicit i.e hidden from the external world.
Mapping classes to
tables
• If we need to store classes(actually objects) on a disk ,
there must be some way of mapping them to RDBMS
structures.
• Three possibilities of Mapping can emerge,
• One object maps to exactly one table.
• One object maps to more than one table.
• More than one object map to one table.
One object maps to one table
In OODBMS, an Object
on the disk has the Object
same layout.
RDBMS OODBMS
Java Object
• How Data is Stored
• Two basic methods are used to store
objects by different database vendors.
• Each object has a unique ID and is
defined as a subclass of a base class,
using inheritance to determine attributes.
• Virtual memory mapping is used for
object storage and management.
• Comparison to Relational Databases
• RDBMS
• Relational databases store data in tables that are two
dimensional.
• The tables have rows and columns.
• Relational database tables are "normalized" so data is not
repeated more often than necessary.
• All table columns depend on a primary key (a unique value in the
column) to identify the column.
• Once the specific column is identified, data from one or more
rows associated with that column may be obtained or changed.
• OODBMS
• To put objects into relational databases, they must be
described in terms of simple string, integer, or real number
data.
• For instance in the case of an airplane. The wing may be
placed in one table with rows and columns describing its
dimensions and characteristics. The fuselage may be in
another table, the propeller in another table, tires, and so
on.
• Breaking complex information out into simple data takes
time and is labour intensive. Code must be written to
accomplish this task.