Re: What design patterns do you usually use?
| From: | Jochem Maas | Date: | Wed, 27 Feb 2008 13:48:38 +0000 |
| Subject: | Re: What design patterns do you usually use? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-270282@lists.php.net to get a copy of this message | ||
Paul Scott schreef:
On Wed, 2008-02-27 at 19:50 +0800, skylark wrote:there seems to be some misunderstanding ... a design pattern is not a component (or anything else of substance) but merely a conceptual strategy used to tackle a problem ... ever find yourself writing code that's conceptually identical to previously written code (in a different site/project/context), if so you've got yourself a pattern and as such it's probably been documented as an 'official' design pattern with suitable fancy name (something like 'Observer', 'Delegator', 'Factory') chances are then that you're already using design patterns - it's just that you don't know them by name :-)What design patterns do you usually use?I am not sure that you are understanding what a design pattern is. It is not a piece of software or a thing to use, but it is a set of repeatable components that you use in whatever app you are writing. Take for instance an observer pattern. When would you use that? Why would you use that? Have you used it somewhere before and what were the circumstances? Is it repeatable? Is your previous code re-usable? Answer some of those questions, look up design patterns (even on wikipedia to get an overview) and buy some books to see solid examples. If you suspect that you "need" to use a specific pattern, or are interested in how to implement a specific pattern, write some throwaway code to do it and ask opinions. Look at the simple things that you would probably have used already - factory, singleton and MVC and expand on those a little to get them to be actual design "patterns" that you can use/reuse.
Don't "use design patterns" because you heard it on TV - same as "Web2.0" _think_ about what it means to you and your enterprise before asking for a buzzword generator to do your job for you! :) --Paul ------------------------------------------------------------------------ All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm