TPAC 2011 Discussion Topic: API Design Approaches
Understanding API design approaches
- The reasons for particular API design approaches are not always clear or widely shared
- API development and prototyping occurs in diverse places, both within W3C and beyond
- As approaches evolve, the rationales should be discussed to promote smoother evolution and convergence
- A better, shared understanding of effective API design approaches will have various benefits in W3C and beyond
- Faster convergence toward standardized APIs
- More consistent API designs simplify developer effort
- Less fragmentation, resulting in fewer implementation dead-ends and backward compatibility breaks
The goal of this session
- Put some specific design approaches on the table for discussion
- Gather advice on them from API design experts in W3C, e.g.
- What are leading examples of each approach?
- How well do they fit into the Web architecture?
- What are some specific pros/cons of the approaches?
- End the session with a better and more shared understanding
- As needed, start a process of further dialog and documentation
Some design approaches
- declarative (via markup language features, e.g. HTML5's <video> tag)
- JavaScript (object/procedural interfaces ala window.open())
- XHR/REST using HTTP scheme URLs such as in conventional RESTful Web APIs
- XHR with non-HTTP scheme URLs handled by the browser or some local system-registered URL handler
Some goals to be balanced
- Minimal browser impact: faster/wider deployment, flexible distribution of data/service providers accessed via the API
- Avoiding of dependence on plugins or device components other than the browser
- Security that fits into the Web security model and Web user agent UX
- ...