tags:

views:

121

answers:

3

Hi,

Does anyone have any good source that I can read how to develop API for C++ or C#?

Thanks in advance.

+7  A: 

"Develop API" is somewhat vague request, but in general an excellent resource for API design is the "Framework Design Guidelines" book by Cwalina & Abrams. These are the folks who shaped many parts of the .Net base class library, and they know a thing or two about API usability.

Framework Design Guidelines on Amazon

Addys
+1 for Framework Design Guidelines. It's like getting the chance to sit in on a pow-wow with the people who laid the direction for .NET--they're some great tips and notes hiding in that book.
STW
awesome! thanks.
Bopha
+2  A: 

Another great (and free!) resource is the patterns & practices Application Architecture Guide 2.0. It's a complete guide written by the MS Patterns & Practices group.

Colin
thanks I will take a look.
Bopha
A: 

Start of by asking:

  • Who will be using the API?
  • What will the API be used for?
  • How many people will use the API?
  • How will the API have to change over time?
  • What Language(s) will the caller of the API be using?

E.g if all uses of the API are in the same cope base as the API, then it is possible to refractor the API at a later date without having to keep backwards compatibility.

If the API will be used by 3rd party developers and have to be callable from all .net languages, then the "Framework Design Guidelines" book should be a great starting point. However more modern fluent interface may also be a good option, see Moq and Fluent-NHibernate for good examples.

Cost must also come into it, if thousands of developers will be calling your API you can afford to spend lots of time on prototyping and usability testing of the API. However if it is just one to two developers calling the API a few times, then “good enough is good enough”.

Design by committee does not create great APIs, it creates middle of the road API, that has a lower risk of getting a terrible API then having one person design it.

Ian Ringrose