12 OOP Concepts
12 OOP Concepts
};
EXAMPLE: IN REAL WORLD
We can build a set of classes that describe
a library of publications. Let there be two
types of publication: Periodical and Books.
So we will create a class named Publication
by defining data items.
Next we will define two derived classes
named Periodical and Book.
EXAMPLE: IN REAL WORLD
Here Book and Periodical class share the
characteristics of Publication class while having
their own attributes.
ADVANTAGES OF OOP…
EASE OF FABRICATION AND MAINTENANCE:
MAINTENANCE
The concepts such as Encapsulation, Abstraction
allow for very clean designs. When an object is
going into disallowed states, which are not
permitted, only its methods need to be
investigated. e.g. if student is getting more than
maximum marks, only the functions are to be
retested. This narrows down search for problem.
ADVANTAGES OF OOP…
EASY REDESIGN AND EXTENSION:
EXTENSION The
concepts explained above also facilitate
redesign and extension.
EASE OF COMPREHENSION:
COMPREHENSION The
classes can be set up to closely represent
the generic application concepts and
process. OOP codes are more near to real
world models than other ‘programming
methodology codes’.
ADVANTAGES OF OOP…
RE-USE OF CODES:
CODES Linking of code to
objects and explicit specification of relations
between objects allows class definitions to
be re-used in other applications. The
availability of a consistent interface to
object lessens code duplication.