News Feed
Jobs Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Anthony Ferrara's Blog:
Handling Plugins In PHP
March 09, 2012 @ 13:34:38

Anthony Ferrara has a new post today looking at plugin handling and a few of the more common design patterns that can be used to implement them in your applications.

A common problem that developers face when building applications is how to allow the application to be "plug-able" at runtime. Meaning, to allow non-core code to modify the way an application is processed at runtime. There are a lot of different ways that this can be done, and lots of examples of it in real life. Over a year ago, I wrote a StackOverflow Answer on this topic. However, I think it deserves another look. So let's look at some patterns and common implementations.

The patterns he covers are:

  • Observer
  • Mediator
  • Strategy
  • Decorator
  • Chain of Responsibility

For each there's both a bit of sample code showing it in use and links to some examples from various frameworks and other projects.

0 comments voice your opinion now!
plugin designpattern observer mediator strategy decorator chainofresponsibility


DevShed:
Expanding an Error Logger with the Chain of Responsibility Pattern
November 13, 2006 @ 10:57:00

Finishing off their look at the "chain of responsibility", DevShed has posted part three of the series - expanding on the code that they produced in the past, they add more functionality to their error logger.

Now, paying attention to the topics that will be covered in this tutorial, what you'll learn here will consist essentially of applying the chain of responsibility schema to expand the capacity of the error logging system that was developed previously.

They take a look back at what they produced in the previous tutorial (the simple error logger) and show how to expand on it by adding functionality to log errors to a file. The finish it off by showing how to implement it all in a simple script.

0 comments voice your opinion now!
error logger chainofresponsibility pattern expand error logger chainofresponsibility pattern expand


DevShed:
Building an Error Logger with the Chain of Responsibility Pattern in PHP 5
November 06, 2006 @ 10:32:00

With the next link in their look at the "chain of responsibility" pattern, DevShed has posted this new part in the series - adding an error logger to the mix.

At the end of this article you should be equipped with more robust knowledge of how to create a responsibility chain between PHP objects that perform truly useful tasks, like logging errors to specific components of a Web application.

They work from the code built up in the previous installations and show how to add the foundations of the error logger to the class before moving on to the more advanced bits. They then show how to use it to log some basic errors and, using only a bit more skill, logging some email-related errors.

1 comment voice your opinion now!
error logger chainofresponsibility pattern php5 tutorial error logger chainofresponsibility pattern php5 tutorial



Community Events











Don't see your event here?
Let us know!


symfony2 introduction component security code facebook framework hack language install release overview example application unittest composer opinion hhvm podcast package

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework