You are here: Re: Learning patterns... Decorator « PHP Programming Language « IT news, forums, messages
Re: Learning patterns... Decorator

Posted by Willem Bogaerts on 09/28/07 13:21

> Thanks Willem, I'll have to have a further play with classes/patterns
> and look for more examples. The point is, I'm trying to justify using
> them to myself over functional programming, at the moment I try building
> class based projects and most of the time they just end up being more
> confusing, taking longer and not really adding much benefit.

One word of advice: patterns are not holy. Don't try to force your code
into a pattern. Even if an existing pattern would be appropriate, you
might choose the wrong one. Read about patterns and see _why_ they are
useful. You may very well come up with a number of patterns of your own.
Some programming languages even create a need for them.
For me, patterns emerge from my code. And as my code is not that unique,
many patterns are recognizable from textbooks as well. Reading about
patterns helps you to identify them if they emerge. But if they don't
emerge, no problem.

And do not be afraid to change things later. No program is perfect and
even if it were today, it wouldn't be tomorrow. If I may suggest a good
read, read "refactoring" by Martin Fowler. It features a nice "let's put
a class statement around this" program and it shows how to morph it into
a real object-oriented one.

Good luck,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация