最近美国那边的架构师过来为我们做了为期两周的培训,内容主要是围绕TDD,Refact和Agile,培训结束后他推荐了Robert C.Martin 的 Agile Software Development Principle,Patterns and Practices.由于这次培训确实有一些感悟想记录下来,并且向把这本书好好读一读,虽然大师的作品可能无法完全吸收其精髓,我想通过边读,边记录的形式促进自己学习和成长。
这次培训在讲TDD这些内容之前,先花了大约2小时在探讨面向对象的五个基本原则和四个特点,即SOLID原则和抽象、继承、封装和多态。这些是面向对象中非常基本的概念,但知道和灵活运用之间的差距真是有天壤之别。几乎每个人都知道要依赖抽象而不要依赖具体,那么依赖抽象的好处在哪里,很多人很难说出个所以然来,并且我们在项目中通常规定要强调依赖注入,抽提接口和类及函数的单一职责原则,这究竟是为什么,仅仅是从设计的角度出发吗?跟测试有没有关联,这些问题其实挺值得思考的。就像这本书在前面显要位置提出的几个观点:
1. Our highest priority is to satisfied the customer through early and continuous delivery of valuable software.
我们最优先要做的是通过早期和持续的交付有价值的软件来满足客户。
2.Welcome changing requirement,even late in development.Agile processes harness change for the customer's competitive advantage.
欢迎需求的变化,即使在开发的后期也一样。敏捷过程利用变化来为客户创造竞争优势。
3.Deliver working software frequently,from a couple of weeks to a couple of months,with a preference to the shorter timescale.
经常交付可以工作的软件,从几个星期到几个月,优先采用较短的时间尺度。
4.Business people and developer must work together daily throughout the project.
整个项目实施过程中业务人员和开发人员必须每天在一起工作。
5.Build project around motivated individuals.Given them the environment and support they need,and trust them to get the job done.
由主动性的人来构建项目。给他们所需要的环境和支持,并相信他们能够完成任务。
6.The most efficient and effective method of conveying information to and within a development team is face to face conversation.
无论是给团队传递信息还是团队内部消息传递,面对面的沟通时效率最高和效果最好的方式。
7.Working software is the primary measure of progress.
可用的软件是衡量进度的主要指标。
8.Agile process promote sustainable development.The sponsors,developers,and users should be able to maintain a constant pace indefinitely.
敏捷过程促进可持续开发。发起人、开发者和用户应该能够保持速度恒定的步伐。
9.continuous attention to technical excellence and good design enhance agility.
持续地关注并提升技术和良好的设计能够使得敏捷过程更加卓越。
10.Simplicity - the art of maximizing the amount of work not done - is essential.
未完成的工作最大化的艺术是简单且必要的。[不明白]
11.The best architectures,requirement,and designs emerge from self-organizing teams.
最佳的架构,需求,和设计来自于自发组织的团队。
12.At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.
团队要定期反省如何能够做到更有效,并相应地调整团队的行为。
这是Martin提出的12个我们在做敏捷开发的时候应该遵循的Principle,强调自由、灵活的开发过程管理,清晰的目标导向和最佳实践。敏捷是一个非常广泛的概念。这本书的重点字眼是Development而不是Programming。敏捷更加强调过程的重要性,而不仅仅一种编程方法。