douyun6399 2010-05-14 19:53
浏览 27


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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥15 powerbuilder出现这样的报错
  • ¥15 h3.6m 人类行为预测论文复现
  • ¥50 wordpress项目注册报失败刷新后其实是成功状态,请求排查原因
  • ¥20 linxu服务器僵尸进程不释放,代码如何修改?
  • ¥15 pycharm激活不成功
  • ¥40 如果update 一个列名为参数的value
  • ¥15 基于51单片机的水位检测系统设计中LCD1602一直不显示
  • ¥15 OCS2安装出现问题,请大家给点意见
  • ¥15 ros小车启动launch文件报错
  • ¥15 vs2015到期想登陆但是登陆不上