Search code examples
.netwinapisdk

.NET API vs .NET SDK


Disclaimer: I'm new to the Windows SDK and API, and somewhat new to API's and SDK's in general.

I once wrote a web application that used Evernote's API through it's PHP SDK, without really understanding SDKs versus APIs. Recently, a colleague told me that there's a Windows SDK which doesn't mention .NET much and that .NET has "its own SDK and API." Does that make sense? Can anyone give an analogy of this to the Evernote scenario?


Solution

  • An SDK is like what a travel agency might put together for you to be prepared to travel into an unknown area: tools, documentation, examples of use cases, header files. An API is like a standard way of doing things in that country that the locals promise to always adhere to.

    Evernote created a standard way to interact with their services: a contract of sorts. Often SDKs will provide documentation for available interfaces, including application programming interfaces (APIs) in that software development kit (SDK). For example, the Windows SDK has lots of tools, header files and other goodies that only developers would need and want. It doesn't appear to include WinAPI documentation as that is available on MSDN.

    The WinAPI is comprised of functions that are exposed through DLLs distributed with Windows. You can natively use them in Visual C++. Using them in .Net requires a platform invoke. These are common things that an application might want to do: create a new window, open and write to a file on disk, or open a browse dialog for a user to select a data file. I'm sure that you're familiar with the Windows open file dialog; imagine it that didn't exist, and every application has to make its own. For one, many users would be confused. Every application would have done it a little bit differently.

    .Net does indeed have an entire framework of functions that are native to any CLR (Common Language Runtime) language: C#, Vb.net, managed c++, and many others. Often times, the .net calls are actually just using a call to a WinAPI under the hood; that is, after all, the "way" to do things under Windows.

    One last note: there's a downloadable Windows SDK, but there's really no such thing as a single-download ".Net SDK." Together, Microsoft terms all .Net resource downloads as being part of a ".Net SDK", but usually an "SDK" is a single file that you unpack.