以适当的怀疑态度收集需求
- 多听取他人的建议
––也许存在更好的方案 - 你的工作是提取真正的需求
––应该采用用例的形式 - 建造更一般的东西往往更简单,回报也更高
以一个《简短的说明》开始 –– 一页纸就够了
- 在这个阶段,敏捷性胜过完整性
- 迅速采集尽可能多的需求
––倾听他们的意见并认真对待 - 如果你保持说明书简短,就很容易修改
- 通过编码及时实现自己的想法
尽早编写并及时修改
- Start before you’ve implemented the API
–– 减少无效工作
2.Start before you’ve even specified it properly
–– Saves you from writing specs you’ll throw away - 在充实API的过程中持续编写API
–– 防止令人讨厌的意外
–– 代码基于用例、单元测试而存在
Writing to SPI is Even More Important
- Service Provider Interface (SPI)
–– Plug-in interface enabling multiple implementations
–– Example: Java Cryptography Extension (JCE) - Write multiple plug-ins before release
––If you write one, it probably won’t support another
–– If you write two, it will support more with difficulty
–– If you write three, it will work fine - Will Tracz calls this “The Rule of Threes”
(Confessions of a Used Program Salesman, Addison-Wesley, 1995)
Maintain Realistic Expectations
- Most API designs are over-constrained
–– You won’t be able to please everyone
–– Aim to displease everyone equally - Expect to make mistakes
–– A few years of real-world use will flush them out
–– Expect to evolve API