terminal-auspicious

Topics

programming

php drupal scheme scheming macros design patterns da la

design

design css

random thoughts

scribbles

alter ego

other me 'em that link us my space me linked in

Collections

Programmable web
PHP design patterns

PHP Design Patterns

  • A catalogue of php design pattern shorts
    • Accumulator passing
    • Closure
    • Control abstraction
    • Coroutines (generator based)
    • Dynamic dispatch
    • Dynamic loading
    • Facade
    • Factory and Abstract Factory
    • Fluent Interfaces/ Method chaining
    • Generator (iterator protocol based)
    • Generic function
    • Hooks
    • Interpreter
    • Iterator (based on protocol method)
    • Lazy evaluation
    • Memoization
    • Nested scope
    • Observer
    • Partial Evaluation
    • Protocol method
    • Proxy
    • Singleton
    • State
    • Strategy Pattern
  • Models, records, databases, friends and foes

Similar things

  • Learning lessons from Lisp or patterns and languages in PHP
  • Emulating closures in PHP
  • Some ways to use saved state with closures in php
  • Scoped php functions or more ways to abuse php
  • PHP Design Patterns
  • Strategy Pattern
  • Memoization
  • Singleton
  • Facade
  • Partial Evaluation

guild
Home » PHP Design Patterns » A catalogue of php design pattern shorts

Factory and Abstract Factory

design patterns | php
Intent
Creating objects (products) without specifying the exact class(type) of object that will be created.
Motivation
We want our program logic to determine the type of logger to be used
Implementation
Classes in php can be considered (weak) runtime objects, the nessessity of the dual factory/product heirarchy is diminished
Invisible in php
Might still want factory objects to handle families of similar objects
Examples
$product_type = which_product(); $probuct = new $product_type();
‹ FacadeupFluent Interfaces/ Method chaining ›
printer-friendly version | add new comment
Home » PHP Design Patterns » A catalogue of php design pattern shorts

dikini.net

spreading confusion by accident since 1970