My favourite patterns are the following:

    factory
    singleton
    adaptor

These also happen to be the most common I come across.

Cheers,
Rob.


On Mon, 2008-02-25 at 10:31 -0500, Matty Sarro wrote:
> I agree, that head first book is fantabulous. Very well written and easy to
> read for a techie book. It makes the usage of design patterns incredibly
> easy to understand. But like all things simply understanding the theory
> doesn't always equal being able to practice it... that only comes with using
> them.
> 
> On Mon, Feb 25, 2008 at 9:51 AM, Eric Butera <[EMAIL PROTECTED]> wrote:
> 
> > On Mon, Feb 25, 2008 at 9:20 AM, tedd <[EMAIL PROTECTED]> wrote:
> >  > At 8:50 PM -0600 2/24/08, Larry Garfield wrote:
> > >  >Design patterns are just that: A formalization of various common
> > patterns that
> > >  >come up over and over in programming.  Ever get the feeling "wow, I
> > know I've
> > >  >written something kinda like this at least three times now?"  That
> > means it's
> > >  >probably a design pattern of some kind.
> > >  >
> > >  >Studying design patterns helps you recognize a give problem as being
> > similar
> > >  >to another, so the solution is probably similar.  It also can alert
> > you to
> > >  >common pitfalls and common ways around them.
> > >
> > >  I've read at least a couple of books on the subject and for something
> > >  that's designed to make programming easier, I find it difficult to
> > >  implement.
> > >
> > >  I'm more like -- "I've written something like this before -- I'm
> > >  going to find my code and alter it" -- type of guy.
> > >
> > >  I'm sure it's my failing, but I program trees and not forest. From my
> > >  perspective, you plant enough trees, the forest will take care of
> > >  itself. Besides, every forest I've designed ends up a lot different
> > >  than when I started. So I focus on trees -- it's simpler for me.
> > >
> > >  I think it's good to develop a methodology so that you can reuse past
> > >  code, but the "design patterns' I've read about seem too abstract for
> > >  me.
> > >
> > >
> > >  Cheers,
> > >
> > >  tedd
> > >  --
> > >  -------
> > >  http://sperling.com  http://ancientstones.com  http://earthstones.com
> > >
> > >  --
> > >
> > >
> > > PHP General Mailing List (http://www.php.net/)
> > >  To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> > To each their own I guess.  Just out of curiosity, are you primarily
> > writing entire web applications or one off scripts?
> >
> > I used to say "you don't need all that" but over time I just can't say
> > it much anymore.  It seems easy to just dive in and throw something
> > out the door, but then new features need to be added.  One of my
> > favorite programming books, Design Patterns Explained, says "Change
> > happens! Deal with it."  Using patterns helped me do just that with
> > minimal crying because the underlying architecture could be easily
> > modified.
> >
> > Also maybe look at Head First Design Patterns if you are interested in
> > ever understanding them.  Most of the books I've read say something
> > along the lines of it should be obvious when to use these patterns
> > when you read their book.  This might be true for some/most people but
> > I couldn't get my head wrapped around them till I read Head First.
> > Seeing their examples with the fun writing just made things click for
> > me.
> >
> > After reading that not only could I use them, but I started spotting
> > them in peoples code.  Another benefit of knowing patterns is having a
> > common language for explaining solutions to problems between
> > developers.  Saying I'm using the decorator pattern makes much more
> > sense then saying I'm wrapping this thing with another thing that
> > makes it do something else so I can swap out behaviors because they
> > work together, etc.
> >
> > ...but that is just the world I like to live in. :)
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to