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.

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

Windows 7 transformation pack for xp

As the windows 7 launched after that there are lot of screenshot available on the internet, There developer designed the transformation packs for xp to make it better lo0king like windows 7. There are some transformation packs for your xp. Download Vienna 2.5 – Windows 7 Transformation Pack (Mirror) Downloa d HFN Windows 7 Transformation Pack Download Windows 7 Transformation pack – NSFormation (Mirror) Download Vienna Transformation Pack v1