PHP Design patterns : Part 2 – Template pattern

The Template pattern is the use of a class that inherits a class and adds functionality that can prevent redundancy in code usage. To use the adapter class from part 1, you need to constantly specify the connection parameters to the database. To prevent specifying the database details in every php file, we can use […]
Continue reading…

Enjoyed this post? Share it!

 
 

PHP Design patterns : Part 1 – Adapter pattern

The Adapter pattern is used to provide access to an object via a specific interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface, into calls to the original interface, and […]
Continue reading…

Enjoyed this post? Share it!

 
 

PHP Design patterns : Part 1 – Introduction

Design patterns are generalized solutions to classes of problems that software developers encounter frequently. The fundamental idea of design patterns is that problems and their corresponding solutions tend to follow repeatable patterns. A design pattern is a description or template for how to solve a problem that can be used in many different situations. Object-oriented […]
Continue reading…

Enjoyed this post? Share it!