Forward declaration container used to simplify class constructors
<p>I work on a huge legacy project. There are a number of classes that are created basically only once (they should be singletons, but oh well) and then passed around to almost every other class in the program.</p>

<p>So there is lots of code like this where the class has a nearly endless list of pointers in its constructor</p>

<pre><code>Foo(A* a, B * b, C * c, ...) 
   : Foo2(a,b,c),
     _a(a),
     _b(b),
     _c(c),
     ...,
{} 
</code></pre>

<p>I was thinking I could clean it up if I used an class to contain all of the pointers and use forward declaration to avoid creating more include dependencies. Each class could use the getters then to pull out anything they needed and include the appropriate headers. </p>

<pre><code>//No includes required
class A;
class B;
class C;
class InterfaceMngr
{
public:
      InterfaceMngr(A * a, B * b, C* c)
       :_a(a),
        _b(b),
        _c(c)
      {
      }
     A * GetA() const { return _a; }
     B * GetB() const { return _b; }
     C * GetC() const { return _c; }

private:
     A * _a;
     B * _b;
     C * _c;
};
</code></pre>

<p>So the foo example would look something more like this now</p>

<pre><code>Foo(Interface * inf) 
 : Foo2(inf),
   _a(inf-&gt;GetA()),
   _b(inf-&gt;GetB()),
   _c(inf-&gt;GetC())
{}
</code></pre>

<p>The nice thing is whenever a new class API comes into the picture I can just add it to Interface and don't need to change a few hundred constructors again....</p>

<p>Does anyone see an issue with this? I feel like I'm over exposing access to some classes, but it really simplifies editing the code.</p>
