-
Notifications
You must be signed in to change notification settings - Fork 10
designGuideAPI
Sebastian Schlicht edited this page Aug 26, 2013
·
1 revision
This design guide is a summary of a Google Tech Talk from Joshua Bloch (2007)
http://www.youtube.com/watch?v=heh4OeB9A-c
- collect requirements
- create short specification (~1 page)
- gain feedback from as many stakeholders as possible
- improve your page until it matches the requirements
- select a short name explaining the functionality
- create an early draft (e.g. Java interface)
- create example code
- create production code
Keep in mind:
- use consitent names that are self-explanatory
- you can add parameters whenever you want but you can not remove one ("When in doubt, leaave it out")
- document everything (classes, interfaces, methods, fields)
- reuse your interfaces
- only constants are allowed to be public fields
- name must match the most important functionality
- favor interfaces and the most specific types possible as arguments
- use consistent argument ordering
- 1-3 arguments ideally (otherwise split/use a builder)