I created an API wrapper called Chargify.NET and I’m starting to see a pattern develop that could potentially be solved by targeting .NET 4.
The issue is that as they enhance the API, I need to create more and more overloaded functions to handle one specific action (Creating a subscription, in this case). Right now, I have MANY (I think too many) overloaded CreateSubscription functions, and it’s getting hard to manage the different signatures.
IS it possible (and/or suggested) to build the library against .NET 4 and use optional parameters and hope that the users of the library can use the .NET 4 library? Or should I continue along the path I’m on with 3.5? Or somehow target both?
Need some discussion about this ..
Optional parameters have been fully supported by .NET well before 4.0. However, they have only recently gotten language support from C#. Remember that optional parameters are not required to be fully supported by a CLS compliant language – the compiler is allowed to ignore the default values you provide.