 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Diniki.net: PHP Design Patterns
by Chris Cornutt July 25, 2006 @ 06:08:07
Patterns in PHP are becoming more and more popular, and sites like this one are doing well to provide summaries of each with code examples to help clarify.
Following my petty wingeing about the design patterns in php on the web I have to bite the bullet and do something about it. So here it comes a collection of design pattern examples, some from the GOF book, some collected from around the net, some (maybe) I have discovered.
The intent of these pages is to show the shapes of the patterns not a fully fledged implementation. In real life probably a combination of patterns will be employed. Everyone has their own favourites following their political, religious and style differences.
He admits that the pages are a work in progress and aren't complete, but they're a start to share his studies with the world. His list of patterns so far includes:
with more to come. All of his examples under each pattern are written in PHP.
voice your opinion now!
design patterns listing control abstraction hooks facade observer design patterns listing control abstraction hooks facade observer
DevShed: An Introduction to the Observer Pattern in PHP
by Chris Cornutt July 17, 2006 @ 13:48:34
DevShed is starting off a new series today with the first part of their look at design patterns, specifically this time, the Observer pattern.
If you have reached the point in your programming life where you are using design patterns, you will want to read this article. The first of a three-part series, it covers the Observer pattern, which can be just the thing for situations where objects need to send information to a centralized mechanism.
I hope you'll be wondering how all this boring theory can be translated into functional PHP code. That's what I'm going to do in the course of this article, by introducing some friendly examples of how to implement the Observer pattern in PHP applications.
They just right in and create a more practical example, opting for demonstration over a lot of explaination. Their sample code manipulates strings to change them to uppercase and save them off to a file. They attach a basic error logger to it and then conform it to fit in with the Observer pattern style.
voice your opinion now!
design pattern observer introduction tutorial part1 design pattern observer introduction tutorial part1
|
Community Events
Don't see your event here? Let us know!
|