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

PHPMaster.com:
Manage Complexity with the Facade Pattern
June 11, 2013 @ 11:54:25

On PHPMaster.com today a new tutorial has been posted about using the Facade design pattern to help reduce the complexity of your application. It can help interface between other pieces of code an make using them simpler (a "facade" on top of them).

Design patterns are built to standardize solutions for common problems faced in software development. [...] Facade is a design pattern used in almost every web application, but often without knowing. The term "design pattern" creates a mental image of something complex and difficult to understand. Even though this can be true sometimes, the Facade pattern is simple to implementation. Let's see what Facade is and what it does to help us write good code.

A simple example is given to help make the concept of a facade clearer - the process behind borrowing a book. As borrowing and returning a book could involve multiple library types, they use a facade to provide a common interface to all of them. With the concrete example in place, they then move on to the official definition of the pattern and two more "real world" examples: authentication against multiple social networks and working with WordPress meta functions.

0 comments voice your opinion now!
designpattern facade tutorial social network interface

Link: http://phpmaster.com/manage-complexity-with-the-facade-pattern

Zend Developer Zone:
My Favorite Design Patterns
April 25, 2011 @ 10:38:13

On the Zend Developer Zone there's a new article from Keith Casey where he talks about some of his favorite design patterns he's come across in his time as a developer - adapter, facade and decorator.

Within the Design Patterns world, there are four main categories: Architectural, Structural, Creational, and Behavioral. Architectural patterns describe the system as a whole, Structural patterns describe the relationships between objects, Creational handle creating objects, and finally Behavioral describe the communication patterns between objects. Each of the categories is worth discussion on its own, but in this case we'll stick to the Structural patterns of Adapter, Facade, and Decorator.

He describes each of the patterns (no code in this one, just descriptions) and for each mentions some of the tools that the Zend Framework has to offer that match up. For example, the Adapter pattern is used in quite a few places in the framework including in the Zend_Db component for the connection types to different databases.

0 comments voice your opinion now!
designpattern zendframework adapter facade decorator


DevShed:
Handling File Data with the Facade Pattern in PHP 5
January 23, 2007 @ 13:31:27

DevShed has posted the last installment of their series looking at the use of the Facade design pattern. This time, they're looking specifically at its use in handling file data for the items on the local file system.

I'm going to continue demonstrating the application of the facade pattern, this time by developing yet another illustrative application. It will take care of processing the contents of a selected data file in different ways.

They start from scratch with the development of the sample script - creating a simple class that implements the pattern, then modifying it to work as a string processor and finally pulling them together to read the data for a file and echo out the processed results.

2 comments voice your opinion now!
php5 facade design pattern handle file data process string php5 facade design pattern handle file data process string


DevShed:
Introducing the Facade Pattern in PHP 5
January 16, 2007 @ 11:19:00

DevShed continues with their look at design patterns in PHP with the first part of a new series today discussing the Facade pattern as created in PHP 5.

In this case, you have a class that hides all the complexity required for serializing the mentioned objects, but there's also a group of classes that know nothing about the class that called them. As you can see, these classes are only responsible for performing the serialization/unserialization sequence on several objects and nothing else. Period.

The Facade pattern is best seen as an interface between the real meat of the application and the part that displays the results. It provides a buffer between the two to make it easier for the output class to call. They create a basic implementation of this and show how to use compression and provide all the code you'll need to get it working.

0 comments voice your opinion now!
facade pattern php5 tutorial http cmpresssion facade pattern php5 tutorial http cmpresssion


Diniki.net:
PHP Design Patterns
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.

1 comment voice your opinion now!
design patterns listing control abstraction hooks facade observer design patterns listing control abstraction hooks facade observer



Community Events











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


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

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