tags:

views:

285

answers:

4

Hi, I'm developing a small SDK in C, is there any good book or article on best practice and guidelines in the subject? I mean functions design, source code organization, portability issues etc.

A: 

Read up on SDKs on wikipedia.

It is mainly an API with any needed documentation and code/ddls packaged into a "kit".
This means that you more or less have to expose the features you want to let the developers use through some kind of plugin interface or service, and make it easy to use through clearly defined methods and a good documentation package.

What is this SDK intended for?

Lars Mæhlum
+2  A: 

Good question! I haven't seen any good book on this topic. But I have seen these things about the importance of making an effort and some general thoughts.

PDF

Video

Personally I'd focus on:

  1. Try to create what is expected of a framework, intuitively.
  2. Hide internal workings in header files that is not part of the delivery headers.
  3. Repeat a used pattern, ie first parameter is always the "context"
  4. Use common patterns from other SDK's, ie directional same as strcpy(dst, src) or zero is "OK"

Well stuff like that...

epatel
A: 

Lars writes

What is this SDK intended for?

We've a piece of software which does some data processing and shows the result in several different views. Some of our clients want to use our data processing algorithms and our views in their own software, so I've started working on some kind of SDK for them. I've never done that before. Although I've used Microsoft SDK a lot and, in general, I've an idea how SDK should look like however it would be great to consult some good books on the subject.

Serge
+1  A: 

Scott Meyers has some interesting things to say about designing APIs. His maxim is:

Make interfaces easy to use correctly and hard to use incorrectly.

There's an article by him on the subject here (pdf). Googling for that also thew up this page listing various articles on API design.

Ned