[PHP] Re: php pattern, software development pattern

2005-03-23 Thread Jason Barnett
Symbulos Partners wrote:
 I looked at php pattern (www.phppatterns.com). I did not understand it well.

 Is that supposed to be pattern as in software development pattern? If so why
 the uml diagrams are not there?

They are design patterns for code.  But the design patterns there are
more micro than your typical UML (though I suppose you could diagram the
design using UML if you really want).

Think of those patterns as a blueprint for building a class.  While
your problem at hand is unique, there are repeatable solutions
(patterns) that you can use and re-use to solve those unique patterns.
*That* is what design patterns are all about.


 For example

 A sample Strategy pattern for form validation.

 What does that mean?

Form validation is a problem you will have over and over again.  The
strategy pattern is a *repeatable solution* to that problem.

So you can use the Strategy pattern to solve your form validation
problem the first time around.  Then the next time you need to validate
a form you say hey, wait a minute, I know how to solve this problem!
Poof!  Light bulbs go on, angels sing and the beer flows like water.

Better yet: if you're careful about the way you design your Strategy
class, then you can re-use it for future projects.  You become more
efficient because now you have this code base that you can re-use.
Easily.  *Hopefully*.  ;)  It takes a lot of practice to get good at
this and even then you will end up scrapping designs later.


 I am confused.

Hopefully you're less confused now.

To summarize: if you have a repeatable problem with a single answer that
you can use to answer that problem then design patterns are A Good
Thing.  In addition, having those classes around will make it easier
for you to get a solution the second, third, etc. time around.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


[PHP] Re: php pattern, software development pattern

2005-03-23 Thread symbulos partners
Thanks for your explanation, it makes things clearer, but I need to work on
it a bit more before saying that is perfectly clear for me.

Are there more pattern repositories available than simply
www.phppatterns.com?
-- 
symbulos partners
-.-
symbulos - ethical services for your organisation
http://www.symbulos.com

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