PHP Classes

PHP Design Patterns with Real World Examples: Implementation of design patterns with examples

Recommend this page to a friend!
  Info   View files Example   View files View files (94)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2022-06-03 (15 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 78 This week: 2All time: 9,878 This week: 72Up
Version License PHP version Categories
php-design-patterns 1.0MIT/X Consortium ...5PHP 5, Design Patterns
Description Author

This package provides an implementation of design patterns with examples.

It provides classes that implement well-known design patterns with real examples classes to demonstrate how to use each design pattern in practice.

There are two groups of implemented design patterns:

- Creational for creating new class objects

* Abstract Factory
* Builder
* Factory Method
* Pool
* Prototype
* Simple Factory
* Singleton
* Static Factory

- Structural for structuring class objects

* Adapter
* Bridge
* Composite
* Data Mapper
* Decorator
* Dependency Injection
* Facade
* Fluent Interface
* Flyweight

Picture of Niko Peikrishvili
  Performance   Level  
Name: Niko Peikrishvili <contact>
Classes: 3 packages by
Country: Georgia Georgia
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Files folder imagesrc (2 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageCreational (8 directories)
Files folder imageStructural (9 directories)

  Files folder image Files  /  src  /  Creational  
File Role Description
Files folder imageAbstractFactory (10 files, 1 directory)
Files folder imageBuilder (8 files, 2 directories)
Files folder imageFactoryMethod (7 files, 1 directory)
Files folder imagePool (2 files, 1 directory)
Files folder imagePrototype (3 files, 1 directory)
Files folder imageSimpleFactory (2 files, 1 directory)
Files folder imageSingleton (1 file, 1 directory)
Files folder imageStaticFactory (4 files, 1 directory)

  Files folder image Files  /  src  /  Creational  /  AbstractFactory  
File Role Description
Files folder imagetests (1 file)
  Plain text file CSVWriterInterface.php Class Class source
  Accessible without login Plain text file init.php Example Example script
  Plain text file JsonWriterInterface.php Class Class source
  Plain text file UnixCSVWriter.php Class Class source
  Plain text file UnixJsonWriter.php Class Class source
  Plain text file UnixWriterFactory.php Class Class source
  Plain text file WinCSVWriter.php Class Class source
  Plain text file WinJsonWriter.php Class Class source
  Plain text file WinWriterFactory.php Class Class source
  Plain text file WriterFactoryInterface.php Class Class source

  Files folder image Files  /  src  /  Creational  /  AbstractFactory  /  tests  
File Role Description
  Plain text file AbstractFactoryTest.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Builder  
File Role Description
Files folder imageParts (4 files)
Files folder imageTest (1 file)
  Plain text file AbstractVehicle.php Class Class source
  Plain text file BuilderInterface.php Class Class source
  Plain text file Car.php Class Class source
  Plain text file CarBuilder.php Class Class source
  Plain text file Director.php Class Class source
  Accessible without login Plain text file init.php Aux. Auxiliary script
  Plain text file Truck.php Class Class source
  Plain text file TruckBuilder.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Builder  /  Parts  
File Role Description
  Plain text file Door.php Class Class source
  Plain text file Engine.php Class Class source
  Plain text file VehiclePartInterface.php Class Class source
  Plain text file Wheel.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Builder  /  Test  
File Role Description
  Plain text file BuilderTest.php Class Class source

  Files folder image Files  /  src  /  Creational  /  FactoryMethod  
File Role Description
Files folder imagetest (1 file)
  Plain text file FileLogger.php Class Class source
  Plain text file FileLoggerFactory.php Class Class source
  Accessible without login Plain text file init.php Aux. Auxiliary script
  Plain text file LoggerFactoryInterface.php Class Class source
  Plain text file LoggerInterface.php Class Class source
  Plain text file StdOutLogger.php Class Class source
  Plain text file StdOutLoggerFactory.php Class Class source

  Files folder image Files  /  src  /  Creational  /  FactoryMethod  /  test  
File Role Description
  Plain text file FactoryMethodTest.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Pool  
File Role Description
Files folder imagetest (1 file)
  Plain text file StringReverseWorker.php Class Class source
  Plain text file WorkerPool.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Pool  /  test  
File Role Description
  Plain text file WorkerPoolTest.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Prototype  
File Role Description
Files folder imagetest (1 file)
  Plain text file BarPrototype.php Class Class source
  Plain text file BookPrototype.php Class Class source
  Plain text file FooPrototype.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Prototype  /  test  
File Role Description
  Plain text file PrototypeTest.php Class Class source

  Files folder image Files  /  src  /  Creational  /  SimpleFactory  
File Role Description
Files folder imagetest (1 file)
  Plain text file Bicycle.php Class Class source
  Plain text file SimpleFactory.php Class Class source

  Files folder image Files  /  src  /  Creational  /  SimpleFactory  /  test  
File Role Description
  Plain text file SimpleFactoryTest.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Singleton  
File Role Description
Files folder imagetest (1 file)
  Plain text file Singleton.php Class Class source

  Files folder image Files  /  src  /  Creational  /  Singleton  /  test  
File Role Description
  Plain text file SingletonTest.php Class Class source

  Files folder image Files  /  src  /  Creational  /  StaticFactory  
File Role Description
Files folder imagetest (1 file)
  Plain text file Formatter.php Class Class source
  Plain text file NumberFormatter.php Class Class source
  Plain text file StaticFactory.php Class Class source
  Plain text file StringFormatter.php Class Class source

  Files folder image Files  /  src  /  Creational  /  StaticFactory  /  test  
File Role Description
  Plain text file StaticFactoryTest.php Class Class source

  Files folder image Files  /  src  /  Structural  
File Role Description
Files folder imageAdapter (5 files, 1 directory)
Files folder imageBridge (6 files, 1 directory)
Files folder imageComposite (4 files, 1 directory)
Files folder imageDataMapper (3 files, 1 directory)
Files folder imageDecorator (5 files, 1 directory)
Files folder imageDependencyInjection (2 files, 1 directory)
Files folder imageFacade (3 files, 1 directory)
Files folder imageFluentInterface (2 files, 1 directory)
Files folder imageFlyweight (4 files, 1 directory)

  Files folder image Files  /  src  /  Structural  /  Adapter  
File Role Description
Files folder imagetest (1 file)
  Plain text file BookInterface.php Class Class source
  Plain text file EbookAdapter.php Class Class source
  Plain text file EbookInterface.php Class Class source
  Plain text file Kindle.php Class Class source
  Plain text file PaperBook.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Adapter  /  test  
File Role Description
  Plain text file AdapterTest.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Bridge  
File Role Description
Files folder imagetest (1 file)
  Plain text file BridgeService.php Class Class source
  Plain text file FormatterInterface.php Class Class source
  Plain text file HelloWorldService.php Class Class source
  Plain text file HtmlFormatter.php Class Class source
  Plain text file PingService.php Class Class source
  Plain text file TextFormatter.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Bridge  /  test  
File Role Description
  Plain text file BridgeTest.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Composite  
File Role Description
Files folder imagetest (1 file)
  Plain text file ButtonElement.php Class Class source
  Plain text file Form.php Class Class source
  Plain text file InputElement.php Class Class source
  Plain text file RenderableInterface.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Composite  /  test  
File Role Description
  Plain text file CompositeTest.php Class Class source

  Files folder image Files  /  src  /  Structural  /  DataMapper  
File Role Description
Files folder imagetest (1 file)
  Plain text file StorageAdapter.php Class Class source
  Plain text file User.php Class Class source
  Plain text file UserMapper.php Class Class source

  Files folder image Files  /  src  /  Structural  /  DataMapper  /  test  
File Role Description
  Plain text file DataMapperTest.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Decorator  
File Role Description
Files folder imagetest (1 file)
  Plain text file BookingDecorator.php Class Class source
  Plain text file DecoratorInterface.php Class Class source
  Plain text file DoubleBedBooking.php Class Class source
  Plain text file ExtraBed.php Class Class source
  Plain text file Wifi.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Decorator  /  test  
File Role Description
  Plain text file DecoratorTest.php Class Class source

  Files folder image Files  /  src  /  Structural  /  DependencyInjection  
File Role Description
Files folder imagetest (1 file)
  Plain text file DataBaseConfiguration.php Class Class source
  Plain text file DatabaseConnection.php Class Class source

  Files folder image Files  /  src  /  Structural  /  DependencyInjection  /  test  
File Role Description
  Plain text file DependencyInjectionTest.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Facade  
File Role Description
Files folder imagetest (1 file)
  Plain text file BIOS.php Class Class source
  Plain text file Facade.php Class Class source
  Plain text file OperatingSystem.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Facade  /  test  
File Role Description
  Plain text file FacadeTest.php Class Class source

  Files folder image Files  /  src  /  Structural  /  FluentInterface  
File Role Description
Files folder imagetest (1 file)
  Plain text file SQLBuilder.php Class Class source
  Plain text file SQLBuilderInterface.php Class Class source

  Files folder image Files  /  src  /  Structural  /  FluentInterface  /  test  
File Role Description
  Plain text file FluentInterfaceTest.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Flyweight  
File Role Description
Files folder imagetest (1 file)
  Plain text file Char.php Class Class source
  Plain text file TextFactory.php Class Class source
  Plain text file TextInterface.php Class Class source
  Plain text file Word.php Class Class source

  Files folder image Files  /  src  /  Structural  /  Flyweight  /  test  
File Role Description
  Plain text file FlyWeightTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:78
This week:2
All time:9,878
This week:72Up
For more information send a message to info at phpclasses dot org.