Search code examples
wcfdesign-patternsarchitectural-patterns

Naming conventions for a project containg only WCF ServiceReferences?


Let's say we have a back-end that needs to talk to N external systems using some kind of Web Services.

What I do is: Create a separate project and generate there the proxy classes (using the service's WSDL in the WCF Service Reference dialog).

About the project name suffix:

I firstly though XxAdapter. But then, I started creating classes with additional logic like CircuitBreakers so I ended up with XxAgent (from ServiceAgent).

What should be the "correct" suffix for the name of such projects.


Solution

  • The most appropriate suffix is "Proxies" because of several reasons:

    1. Your component contains all the web service proxy classes.
    2. In case that you want to make calls to several service proxies transparent, you can create a new class named MyLocalProxy, and perform the action

      public class MyServiceProxy { public void DoSomething() { var serviceProxy1 = new ServiceProxy1(); serviceProxy1.DoOneThing();

              var serviceProxy2 = new ServiceProxy2();
      
              serviceProxy2.DoAnotherThing();
          }
      }
      

    The additional class helps you to not depend on concrete service proxies, so you can interchange them as you wish.

    Cheers.