Friday 27 April 2007

Lecture on API design

It is only today when I came across the lecture about the API design. Its accuracy and comprehensiveness reminded me about some projects I was involved in some time ago.

A bit of history

It is nearly 11 months now, since I worked on the project aiming to deliver public SDKs to the masses. Before then, I had been exposed to the design issues of various library types (e.g. visual component libraries, class libraries) but none of them, maybe with one small exception, was considered to become part of the public domain. So before embarking on the new project, I though to spend some time and learn from gurus about pitfalls and best practices. To my surprise there was not much out there. It seemed like design of an SDK was a trivial task and it obviously was not...

Challenges we needed to face.
  • domain model simplification by
    • identification and extraction of commonalities to facilitate model reuse
    • unit test usage to prove simplicity of the application of the use cases
  • achieving paradigm consistency to
    • apply principle of least surprise
    • require minimal effort from end-user to learn new ways of doing things
  • making sure that end-user will be driven into pit of success by
    • design guiding the desired functionality flows
    • (re)use of exceptions to fail early
    • integration with the development environment for intellisense, hints and help
Many thanks

Therefore many thanks to Krzysztof Cwalina who delivered this presentation, recorded here , about API design. The fact that he needed to consider extremely broad end-user base, support for multiple CLR languages and multiple consuming products, make the lecture comprehensive and extremely valuable. And it is worth watching this API related blog...

His book is definitely the next one the list of the items to read.

No comments: