Now that we can declare dynamic objects in C#, how should we define our APIs? Typed, dynamic, mixed? In this session we will learn that sometimes it’s useful to create an API in two incarnations: as strong typed and dynamic one. Such API can be adopted by developers with either preference and exposed to .NET platoforms that lack DLR support. We will study the principles of designing a dual API, demonstrate how to ensure maximum code sharing between typed and dynamic versions, and how to package and publish library files so they can be consumed on variety of .NET platforms, including iOS and Android.
Our case study will be based on an open-source OData client library that the speaker happens to maintain and which became a testbed of the technique presented in the talk. We will also have a look at other real-world scenarios that benefit from using dynamic C#, such as XML parsers and micro-ORMs.