Hi,
this is more of a design question:
lets say that I have some internal type definitions that I absolutely want to keep secret (not exposed to my service consumers. However, i do need to exchange data with the service users. some of the types I want to share with the users are exactly the same as the internal ones while others are a simplified version of the internal type. same object or not - my primary concern is that the internal object will never be exposed to the outside world, my secondary concern is now making too much duplicate code...
The Idea is that I really don't want to have the situation where the internal object will be exposed to the WCF by mistake(this has just happened to me for internal object not even marked as [DataContract] ), so I thought about the following approach:
Design My WCF service contracts files not having any reference to the internal types namespace. - this will provide some better safety.
Implement translations between the internal types and its corresponding public representation objects at the service implementation code.
Is this the right approach? are there any known patterns that better solve the above issues?
Many thanks, Ofer