Home arrow PHP arrow The Singleton and Factory Patterns in PHP: Building object-oriented forms

The Singleton and Factory Patterns in PHP: Building 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.

TABLE OF CONTENTS:
  1. The Singleton and Factory Patterns in PHP: Building object-oriented forms
  2. When one is better than many: a quick look at the Singleton Pattern
  3. Object-oriented forms: applying the Factory pattern to a real application
  4. The first approximation to object-based forms: building form element classes
By: Alejandro Gervasio
Rating: starstarstarstarstar / 31
November 02, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Introduction

Many web developers around have started to use extensively object-oriented programming in PHP applications. Due to the fact that this approach requires a radical change in the way that situations are solved within a program, it takes a while to get an intimate grounding in this paradigm.

Going one step further, for PHP programmers with a certain level of experience, the use of widely known design patterns within the context of an application is definitely a common method for tackling many problems inherent in web development. Since design patterns are key concepts involved in software engineering, mastering them directly implies having a strong knowledge about their theory and practical implementation.

Of course, through this series, I'm not going to offer a detailed definition of the most used design patterns, since there's all sorts of clever information on the subject in many good books and rich-content articles that thoroughly cover the topic. Instead, the primary goal of this series is to demonstrate how the Singleton and Factory patterns can be implemented in a real-world application, without the need to incur in the use of rather impractical examples.

If you've read the article's title, surely know what I'm talking about. 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.

However, if you're just starting to learn about the topic, don't feel concerned. I'll cover briefly the corresponding definition for the Singleton and Factory Patterns, in order to help you clearly understand how they are used. 

All right, once we've introduced ourselves to the field of design patterns in PHP, it's time to learn more about them. Thus, let's get started.



 
 
>>> More PHP Articles          >>> More By Alejandro Gervasio
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: