Skip to main content

Object Oriented Programming (OOP) in PHP

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...

Comments

  1. Just read it for update OOP basics i.e., best article to understand about Object Oriented programming in PHP.

    ReplyDelete

Post a Comment

your Comment is sent for moderation, Thankyou

Popular posts from this blog

Network Topologies (Tutorial-4)

Topology refers to the way in which the network of computers is connected. The choice of topology is dependent upon--- Type and number of equipment being used  Planned applications and rate of data transfers  Required response times  Cost Types of Network Topologies Physical Topology: Physical topology defines how devices are connected to the network through the actual cables that transmit data(physical structure of the network)  Logical Topology: Logical Topology (also referred to as Signal Topology) is a network computing term used to describe the arrangement of devices on a network and how they communicate with one another.

Networking (Tutorial-8) IEEE Standards

IEEE INTRODUCTION Institute of Electrical And Electronics professional organization for the advancement of technology related to electricity.  Formed in 1963 by the merger of IRE( Institute of Radio Engineers ) and AIEE(American Institute of Electrical Engineering)  IEEE is one of the leading standards-making organizations in the world. IEEE performs its standards making and maintaining functions through the IEEE Standards Association(IEEE-SA).  IEEE Standards The Institute of Electrical and Electronics Engineers Standards Association (IEEE-SA) is a leading developer of global industry standards in a broad-range of industries, including:  Power and Energy  Biomedical and Healthcare  Information Technology  Telecommunications  Transportation  Nanotechnology  Information Assurance  Development of IEEE Standards The IEEE standards development process can be broken down into seven basic steps, as follows: ...

Cisco Hierarchical Model

Cisco Hierarchical Model Defined by Cisco to simplify the design, implementation, and maintenance of responsive, scalable, reliable, and cost-effective networks. The 3 layers are logical and not physical – there may be many devices in a single layer, or a single device may perform the functions of 2 layers, eg: core and distribution. The Cisco Hierarchical Model