douyun6399 2010-05-14 19:53
浏览 27
已采纳

使用PHP在工作场所使用的设计模式的频率

I read a book awhile back called PHP Design Patterns and Practice, and ever since then I have been using design patterns whenever I think they are needed. However it just occurred to me that maybe most companies do not use design patterns very often for PHP, or at all. What I was wondering is, do most companies use design patterns to help improve code flexibility? And if so, what are the best design patterns to learn for PHP?

Thanks for any help on this, Metropolis

Thanks for all of your great answers on this!
The conclusion I can take from this is: Patterns are used in almost all work places with PHP, and the most common ones need to be understood and memorized. Also, the MVC architectural pattern is very important and everyone will expect you to know it.

  • 写回答

5条回答 默认 最新

  • douliang2087 2010-05-14 20:08
    关注

    In my experience, the answer is: very often. Almost every place I've worked at uses design (and architectural) patterns. These are larger projects and it helps in implementation, maintenance and analysis to use known solutions to common problems.

    You'll want to learn all the biggies (because you'll both use and run into them) starting with: Factory, Singleton, Observer, Strategy.

    MVC is an architectural pattern that you should know well.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?