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

DevShed.com:
The Singleton and Factory Patterns in PHP - Building object-oriented forms
Nov 03, 2005 @ 11:47:24

In a new article from DevShed.com today, they look at one of the more techical aspects of programming (but undoubtedly one of the most useful) - design patterns. And, in this new article</a., they spotlight the Singleton and Factory Patterns in PHP, using them to create object-oriented forms.

Experienced PHP programmers know that web development problems are often tackled by using widely known design patterns within the context of an application. This article is the first in a series that will demonstrate how the Singleton and Factory patterns can be implemented in a real-world application.

I'll apply the above mentioned design patterns to building web forms, by utilizing an object-oriented approximation. Hopefully, the overall experience will be useful enough to teach how (X)HTML forms can be created by relying strongly on these two familiar patterns.

They start off with a look at the Singleton pattern - what is is, how it's used - and quickly move on into the Factory pattern. Once the reader has been intoduced to both, they're combined with a little bit of XHTML to create some of the form elements (textarea, text, radio, etc). This is just the first part of the series - keep an eye out for the next part where they put this "form builder" into a real-life situation...

tagged:

Link:


Trending Topics: