title: Class implementations in interface dll?
body: <p>my problem: Inside an application, all interfaces are declared inside an own dll(project "interfaces", for example).</p>
  
  <p>Inside project interfaces, there are many class implementations, too.</p>
  
  <p>Now I need one of this implemented classes inside another project and get a ring dependency because this project is also a reference in project interfaces.</p>
  
  <p>So, what is the best way to get around this ring dependency? Could it be possible that this is a big mistake in the design of the application?</p>
  
  <p>Schematic representation:</p>
  
  <p>IBigInterface.cs (everything in one file):</p>
  
  <pre><code>interface ISomeInterfaceA
  {
      void SomeFunctionA(ClassB x);    // ClassB from newProject.cs
      void SomeFunctionB();
  }
  
  //
  // etc.
  //
  class ClassA
  {
      //
      // Code
      //
  }
  </code></pre>
  
  <p>newProject.cs (everything in one file):</p>
  
  <pre><code>class ClassB
  {
      //
      // used in interfaces.dll
      //
  }
  
  class ClassC
  {
      void SomeFunction(ClassA a)    // ClassA from IBigInterface.cs
      {
          //
          // do something
          //
      }
  }
  </code></pre>
  
  <p>First thing that comes into my mind would be sth. like:</p>
  
  <p>IBigInterface.cs:</p>
  
  <pre><code>interface ISomeInterfaceA
  {
      void SomeFunctionA(IInterfaceB x);    // use interface instead of a class
      void SomeFunctionB();
  }
  
  interface IInterfaceB
  {
      //
      // declarations
      //
  }
  
  class ClassA
  {
      //
      // implementation
      //
  }
  </code></pre>
  
  <p>newProject.cs:</p>
  
  <pre><code>class ClassB : IInterfaceB    // implementation of IInterfaceB
  {
  }
  
  class ClassC
  {
      void SomeFunction(ClassA a)
      {
          //
          // implementation
          //
      }
  }
  </code></pre>
  
  <p>so that project newProject wouldn't be a reference in project interfaces anymore (although this means changes in the whole application).</p>
  
  <p>P.S.: I inherited this application so the idea of implementing classes in an interface-project was not my idea :).
  In General, I would create one file per class (so don't point to this :).</p>