Skip to content

What Is Object-Oriented Methodology In Php ?

Object Oriented Methodology is a technique used for the development of computer softwares. The main aim of this technique is to guide the development process by analyzing the system requirements.

In this technique, different objects of the system and the relationship between them are determined and their behaviour over time is analysed. Then the coding is implemented. Clearly, as the name suggest objects of the system plays the important role in Object Oriented Methodology.

There are several types of Object Oriented Methodology namely Object Modelling Techniques(OMT), Rational Unified Process(RUP), Object Process Methodology(OPM) etc.Also check some of best php editor to fast output of php development.

The process of developing a computer software using this methodology is described below. Also check out our Php students feedback , we got very positive response from our students.

 PROCESS OF DEVELOPING A COMPUTER SOFTWARE USING OBJECT ORIENTED METHODOLOGY

OBJECT ORIENTED SYSTEM ANALYSIS

This is the first phase of developing a computer software. In this, a web developer finds out all the essential requirements of the system. After analysing the whole system a basic model is made which gives an idea how different objects are inter-related with each other.

OBJECT ORIENTED SYSTEM DESIGN

This is the second phase of the development process in which a design of the whole system is made. The system may include smaller subsystems which in turn includes different objects of the system. This phase concentrates wholly on the objects and as a matter of fact the processes are not considered as the main part of the development stage.

OBJECT DESIGN

This is the third stage of the development process of a computer software. In this phase, all the information gathered from the analysis and design of the system is executed. This phase also requires knowledge of some important object oriented programming concepts which are described below in detail.

(1) Class : It is data type which uses local data and local functions. You can use public, protected and private functions inside a class.
Public- This is used to make function or variable accessible from anywhere.
Protected- This is used to make function or variable accessible or visible only within the class itself and by the classes that inherit the declared classes..
Private- This is used to make function or variable accessible only by the member class that declared it.

Example 1 : An example of class using public function is shown below.

php-class-1024x516

php-class-output-1024x349

Output : The output of the above public function used is shown below.

php-class1-1024x518

Example 2 : Another example using constructor function is shown below.

php-class1-output-1024x326

Output : The output of the above php code using construct function is shown below.

(2) Inheritance : It is defined as the process of inheriting the existing function of a parent class. In this, a child class(derived class) inherits or acquires the property of  functions and variables of a parent class(base class).
Syntax- class child extends parent {

Example : An example of inheritance is shown below.

php-inheritance-1024x517

php-inheritance-output-1024x343

Output : Following is the output of the above php code using inheritance.

(3) Encapsulation : It is defined as the process of encapsulating(enclosing) all the object data and member functions within another object to form a single unit or module. It helps the outer object to have a control over the internal data. This is generally used to hide the internal data(information hiding).

Example : An example of encapsulation is shown below.

php-encapulation-1024x515
php-encapulation-output-1024x369

Output : You will get the following output of the above written php code using encapsulation.

(4) Data Abstraction : It is the process of putting all the relevant information of the object in terms of variables and methods in a class. You cannot instantiate the abstract class.

php-abstract-1024x518

Example : An example of data abstraction is shown below.

php-abstract-output-1024x342

Output : You will get the following output of the above php code using abstract function.

(5) Interfaces : Interfaces enables a web developer to create codes by using the ‘implements’ operator. These are used to determine which methods a class should implement. You can also use ‘extends’ operator in order to extend the interfaces.

php-interface-1024x516

Example : An example using interfaces is shown below.

php-interface-output-1-1024x352

Output : You will get the following output of the above php code using the interfaces.

(6) Polymorphism : As the name suggests, it is the process of using a single interface for different implementations. In this, same function of the class is used for different purposes. It is one of the most important object oriented concept in php by the use of which an application get its modular features.

php-poly-1024x519

Example : An example using polymorphism is shown below.

php-poly-output-1024x341

Output : The output of the above php code using polymorphism is shown below.

IMPLEMENTATION

This is the last stage of the development process in which all the information gathered from the system analysis, system design and object design are implemented by writing suitable codes. We have seen that in the whole Object Oriented Methodology the focus lies on the inter-connectivity of different objects of the system. So coding is done only after the whole analysis is made on the object.

MODELS USED IN OBJECT ORIENTED METHODOLOGY

  1. Object Model : In this model, the interconnection between different objects of the system is described. This model deals with the static nature of all the objects and not with their dynamic nature.
  2. Dynamic Model : In this model, dynamic nature of all the objects is described. It gives the information about the changing behaviour of an object with respect to time in a system.
  3. Functional Model : In this model, transformation of data in the system is described. It deals with the data flow and data reorganization.

BENEFITS OF OBJECT ORIENTED METHODOLOGY

There is a huge advantage of Object Oriented Methodology regarding the development of computer softwares which are listed below.

  1. This model provides simplicity to the web developers to develop computer softwares.
  2. It allows a web developer to make changes if needed in the system.
  3. It enables a web developer to reuse the code in the new system as well.
  4. Using Object Oriented Methodology results in increased standard and quality of an application.
  5. This methodology helps in the rapid development of a computer software.
  6. It provides flexibility and modularity to the system.
Facebook
Twitter
LinkedIn
Pinterest