Polymorphic Services with WCF

I am trying to adhere to the DRY principle when developing WCF services for our application, but it seems that I am losing a lot of rabbit holes. My initial idea was to have an abstract base class for storing code common to all services, and get derived classes for each specific service, but cannot make VS2012 play well.

Whenever you create a service class, it is INSISTS when placing the contract (interface) and implementation classes in the same project, and trying to separate them seems to stretch the wiring that VS made under the hood, so then break.

I think that all my years of “classic” OO design have been bothering me, I wanted specific services to be derived from the UI class and the abstract base class, but I was not very lucky. I found questions / blogs about the presence of polymorphic data types used by services, but did not find examples of polymorphic SERVICE types. Can anyone point me to?

Thanks Peter

UPDATE: Maybe I'm completely thinking about it, I'm NOT really trying to inherit OPERATIONS, since a complex approach will make more sense, I just want to keep the common code in one place (obviously ...), and the whole approach is a “static helper class "always feels" dirty "for me, like it wins the whole OO approach ... I hope that I can just inherit class classes based on an abstract base class, that it’s NOT necessary to implement any particular service contract, but that's just l You are a way to save DRY code ...

SEE ALSO: I'm trying to use a template template for service classes since the general structure of services is so similar (devil is always in the details ...)

+4
1
+4

All Articles