4.Sv Object Oriented Programming
4.Sv Object Oriented Programming
OVERVIEW
◼ Object oriented design is a common programming
paradigm
Data and the means to manipulate is described together in a formal
structure called a class
◼ Unless declared static, each class object has its own copy of the
class properties
◼ Static properties shared between all instances of class
◼ Static properties can be used with out creating object
CLASS
const properties
◼ Global constant have an initial value as a part of their declaration. They
can not be assigned a value anywhere other than in the declaration
◼ $cast() can also be used as a function that check if the type of the arguments
match. It returns a true if they match and a false if they do not
OOP POLYMORPHISM
POLYMORPHISM
introduction(1)
◼ Consider a base class that is multiply derived into subclasses, each
of which overrides a common base method