Skip to content

imgul/php-design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Design Patterns

Introduction

This repository contains examples of design patterns in PHP. The examples are based on the book Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides.

Table of Contents

Creational Patterns

Abstract Factory

The Abstract Factory pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes.

Builder

The Builder pattern is used to separate the construction of a complex object from its representation so that the same construction process can create different representations.

Examples

  1. Conceptual Example

Factory Method

The Factory Method pattern defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

License

MIT License (MIT) - see the LICENSE file for more details.

Author Information

This repository is owned and maintained by Muhammad Gulzab. If you would like to contact me.

About

Design Patterns with PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages