Hi,
Does anyone have any good source that I can read how to develop API for C++ or C#?
Thanks in advance.
Hi,
Does anyone have any good source that I can read how to develop API for C++ or C#?
Thanks in advance.
"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.
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.
Start of by asking:
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.