The Contract is better than the object

In Indigo (oops, WCF) we can define optional data members that can be versioned like here (winfx beta1)...
 
The more I work with contracts (from WSDL) the more I understand that objects are just a mean to message based programming, not an end
 
[DataContract]
public class Person
{
   [DataMember]
   public int Id;
   [DataMember]
   public string FirstName;
   [DataMember]
   public string LastName;
   [DataMember(IsOptional = true, VersionAdded = 2)]
   public string MiddleName;
   [DataMember(MustUnderstand = true, VersionAdded = 3)]
   public DateTime DateOfBirth;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s