|
Object Oriented Programming Concepts
by: Rodelio P. Barcenas
Object
oriented differs a lot from the emprical (procedural) type of
programming. Objects, in Object Oriented Programing, represents
the abstraction of physical objects into program by defining its
properties, methods. The goal is to encapsulate the physical objects
into a programming representation and their behaviours and properties
with other objects to achieve the programming requirement.
To
illustrate;
Let us take for example a game called chess. Suppose we would
like to create a program for the chess software. In procedural
programming, the whole process has to be considered and the sequence
of programming commands bears significant weight. Everything has
to be in a proper sequence. One command is not able to do its
right function if the previous series of commands are incorrect.
To keep the programming a little bit organized, functions or subroutines
should eliminate repeatitive task.
In
object oriented programming, we just look at the problem in this
manner. When we look at the chess game, we see only three objects.
The objects are the chessboard, chesspiece and the player. We
only need to create three(3) objects(programs) representing the
objects.
The
chesspiece can have properties(instances) like "color","type
of piece","move pattern","location",
etc. The chesspiece can also do some methods such as move(),kill(),etc.
The
chessboard also has separate properties(instances), methods such
as whois_cell(), etc.
The
player can be the client over the network.
A
collection of procedures or subroutines does not qualify to be
created as an object. Objects should have ownership of properties,
methods. Since there is ownership of methods, an object can be
detached and replaced by another similar object and not affecting
the totality of the program.
In
procedural programming paradigm, everybody owns the method, properties,
etc. This makes it difficult in revising program, deleting modules,
etc. The whole program will be affected.
If
you been developing programs you will agree that program =
interface + process. Both interface and process should be
finished together, interface and process are dependent with one
another.
In
object oriented programming paradigm, it is possible to separate
both without affecting the other. We can represent the two as
just two objects that needs to be interconnected with each other.
|