views:

31

answers:

0

Is it a good idea to introduce an additional partial class for a svcutil generated proxy class at the service layer?

I am looking for some insight and thoughts concerning a proposed project structure along with the utilization of partial classes in an attempt transform entities to support backward compatibility in our service endpoints (V1, V2, etc...).

We are doing schema first development... So we are writing wsdl then generating a partial class (proxy) using the svcutil. We are attempting to maintain backward compatibility in older services (wsdl contracts) by introducing another partial class that implements the most current interface. The partial class is used to implement the latest interface, the theory is that it would handle any transformations that are required for a given entity then just pass on this entity to the business adapter (addcustomer). The business adapter would always take an interface param (ICustomerRequest). We wouldn't regenerate the service1 contract wsdl... However, we would apply an additional partial class that represents the latest interface contract.

This proposed mechanism just doesn't seem quite right to me even though on some simple examples it seems to work. The fact that we are exposing a contract via the wsdl but then attempting to apply a different contract (interface) at the service endpoint doesn't seem quite right to me. Does anyone have any thoughts or concerns with this proposed strategy?

Any guidance or thoughts that could be shared would be greatly appreciated!

Project Structure

Client (acts like contract/interface library) - wsdl - proxy server class generated from wsdl using svcutil

Service (service project) - Service1Base - Service1a - Service1b

ServiceLibrary - linked file from client project. (partial class that maps back to the svcutil generated proxy class)
- new partial class files that implement latest interface. Responsible for doing transformations on the object that is passed to the service. - previous version business objects (Service1Base, Service1a) - current version business objects (Service 1b) - current version interface definitions - adapter classes responsible for invoking the underlying business functionality. Operations utilize parameters that are all based on interfaces.