[开发流程] 全新的开发方式:组件开发
当我们考虑开始一个新的项目,如何进行开发?#
可能的方式有:
- 手动创建 (terrible)
- 选择合适的框架 (Laravel or Symfony
)
- 组件式开发(Components Development)?
Building better application more quickly instead of wasting time reinventing the wheel.
So, what is component?#
简单的描述,组件就是为了解决一个简单问题而编写的一大堆 Classes, Interfaces, traits 等文件的集合;
Good Component#
- 专注:组件的目标应该是去解决一个单一的问题;
- 短小:对代码体积并没有太多限制,但是短小精悍的代码总是讨人喜欢;
- 协作:组件式开发更强调代码复用和团队协作,所以好的组件更应该遵循代码规范和主流的标准(PSR-*)
- 完整的测试
- 清晰,全面的文档支持(至少要有简明的使用说明)
找到合适 / 优秀的 Components#
Packgist http://packgist.org
Awesome PHP: https://github.com/ziadoz/awesome-php
How to use components?#
Composer https://getcomposer.org/doc/00-intro.md
Create your own components!!!#
- Modern PHP Chapter 4
- Skelton:https://github.com/thephpleague//skeleton
本帖已被设为精华帖!
推荐文章: