Hypertext
Pre-processor (PHP) is a server side scripting language that means it is
operated and executed on the server that means the result will be shown to your
browser and it really doesn’t depends on browser.PHP is pa procedural language
and you can do each and everything with PHP you can do using Object Oriented(OO)
approach. Objects Oriented Approach is just a mean of simplifying the
situation.
You could see it in a way as “Include and Reuse”. Object Oriented
Programming simplifies web-development by eliminating the need to Cut, Paste
and adapt existing code.
The
biggest argument about the OOP is that OOP is something that is for the large
group of developers that means if a number of programmers are involved in the
same project, an Object oriented Programming is required because in that environment
there is a great need of Collaboration
between the programmer. But a Lone Developer doesn’t need to worry about these
things. But a lone developer can easily use the solutions that are made in OOP.
While
using an OOP in PHP three basic concepts come in the Mind that is Class, Access
Modifier and Objects.
Class is
a data type. We can modify this statement as can say that “class is a data type
that is made up of other data Types that together describe an object”.
When we
are binding data in a class the most amazing feature of the Object oriented
programming comes in account is Access Modifiers. They Refines the object model
and Control how an object can be used or reused or we can understand it with an
example. Say if there is room in your home you can easily define that this is a
personnel room only family members are allowed to go in that room. It means no
person other than family members are allowed to go to that room or we can say
that others are not allowed to use that thing. So the same we can do with the
classes that is we can define rules on the subroutines or functions that how
they are being accessed or who can use them or if they can be accessed by the
outside of the class or not.
Conclusion:
Classes define objects, access modifiers determine how objects can be used, and inheritance makes it easy to adapt objects for different circumstances.
We will study those concepts (Classes, Access
modifiers) in brief in my upcoming posts.
Thank you...
Just read it for update OOP basics i.e., best article to understand about Object Oriented programming in PHP.
ReplyDelete