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

A catalogue of php design pattern shorts

design patterns | php
What can you find on these pages?
A pattern catalogue with php pseudo-codish examples. For working implementations you can always check what the kitty thinks of that. I might have problems with over implementation, but those are my problems, it does not mean those pages are notr worth as a reference.
Why?
A reminder and a tantrum space
Why have you moved the catalogue to this page?
Because I wanted to separate this catalogue from longer descriptions I plan to put, and all of them should live under design patterns
Warnings and notices

warning I realised, late enough not to correct it, that I'm using a particular case of wishful thinking - using any php callable in $callable(...) expressions. The reality is abit uglier. We need to use either call_user_func($callable,...); call_user_func_array($callable,...) How I wish php could do that out of the box, especially when it actually does it, just not in the short syntax. Anyone happy to hold my hand to do a php patch for that feature? I'm very unfamiliar with the internals, sorry.

notice As Jared notes in his comment calling functions/methods with $ in a lot of cases you can use $obj->$meth(...) instead of call_user_func($callable,...);. Indeed you can use the following code as part of the remedy list($object,$method) = some_call() $object->$method(...) unfortunately this discriminates against functions, which are lighter to use than their method brethren

and a mention The above two used to live on the top pattern page until I moved them here

  • 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
‹ PHP Design PatternsupAccumulator passing ›
add new comment

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <br /> <br> <div> <a> <em> <strong> <cite> <pre> <code> <ul> <ol> <li> <dl> <dt> <dd> <h3> <img> <blockquote> <q> <strike> <small> <h4> <h5> <h6>
  • Link to content with [[some text]], where "some text" is the title of existing content or the title of a new piece of content to create. You can also link text to a different title by using [[link to this title|show this text]]. Link to outside URLs with [[http://www.example.com|some text]], or even [[http://www.example.com]].
  • Lines and paragraphs break automatically.
More information about formatting options
Home » A catalogue of php design pattern shorts

dikini.net

spreading confusion by accident since 1970