Restrictions imposed on the IContract interface

Feb 11, 2008 at 10:09 PM
According to the http://msdn2.microsoft.com/en-us/library/bb384205.aspx , we do not allow complex types like DataSet in Contract signatures.

However, I created the solution, which easily uses DataSet in Contract signature.

My question is the following. Is it safe to use DataSet in Contract signature ? Is the article here http://msdn2.microsoft.com/en-us/library/bb384205.aspx outdated?
Feb 12, 2008 at 5:24 PM
The article isn't quite outdated but it's a little misleading and definitely chose an unfortunate example. I'll talk to our doc team and try to clear it up.

The first thing to note is that we have very few hard requirements on Contract assemblies (the only ones that we enforce are the ones we need to in order to make the discovery process smoother). We don't actually enforce any of the "restrictions" on the signatures for your contracts. We do however have a list of strong recommendations which, if you follow, will help ensure that you have a good experience today and moving forward as you version your application. My college has posted a good write up of these descriptions on our blog here: Restrictions on Contracts

The relevant section of that article is that we do “allow” signatures that include Serializable types defined in the .Net Framework which would include DataSet. The one thing I would be careful with, however, is that by exposing a DataSet directly to your add-ins you are exposing them to any changes you may make to your database between versions of your application. If you instead wrapped the DataSet in some other object-model it would be easier to adapt if you decided down the line that you needed to change your schema but still wanted to keep your older add-ins working. It’s completely up to you, and passing a DataSet directly does make sense in many cases, but you should just be aware of the long term implications of the decision.

--Jesse