开发者

Implement IExtensibleDataObject on a Base class

We currently have several WCF services that expose our domain model directly across the wire. In other words, we don't have a layer of DTOs to map between our domain and service layers. I have no choice but to directly decorate our domain objects with [DataContract] and开发者_JAVA百科 [DataMember]. I want to implement IExtensibleDataObject on all of our domain objects that are exposed on the wire. Does anyone sees anything wrong with implementing IExtensibleDataObject on a base class? So I would have:

[DataContract]
public EntityBase:IExtensibleDataObject{///IExtensibleDataObject Impl}

[DataContract] 
public Person:EntityBase{}

[DataContract]
public Employee:Person{}

Thanks in advance


Thanks Matt. I guess I know that it works fine, but my questions is more related to SOA design. I know in the OO world this is just fine, but since my domain objects are also serving as DTOs I'm worried that adding this inheritance chain will lead to issues down the road. Is anyone else implementing IExtensibleDataObject? If so, are you implementing the IExtensibleDataObject on all your datacontracts or on a base class?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜