title: C++ Interface Implementation and Subclassed Object Instatiation
body: <p><strong>Update</strong>
  The actual context is that I need to create a package to submit to NIST, trying to test a Facial Recognition Algorithm I am working on. The API to use can be found at <a href="https://www.nist.gov/sites/default/files/documents/2018/04/03/frvt_11_concept_and_api_3.0.pdf" rel="nofollow noreferrer">NIST API</a> and the project to git is at <a href="https://github.com/usnistgov/frvt" rel="nofollow noreferrer">git project</a></p>
  
  <p>Some code to make a summary of the scenario:</p>
  
  <p><strong>a.h</strong> - interface <code>A</code>, composed by pure virtual methods and one static method (frvt11.h at NIST project)</p>
  
  <pre><code>class A {
     public:
        virtual ~A() {}
        virtual void pure_virtual_method_a() = 0;
        virtual void pure_virtual_method_b() = 0;
        static int static_method();
  }
  </code></pre>
  
  <p><strong>b.h</strong> - header file for <code>b.cpp</code>, where interface <code>A</code>'s methods are implemented</p>
  
  <pre><code>#include "a.h"
  
  class B : A {
     public:
        void pure_virtual_method_a();
        void pure_virtual_method_b();
        static int static_method();
  }
  </code></pre>
  
  <p><strong>b.cpp</strong> - Implementation of interface <code>A</code>'s methods.</p>
  
  <pre><code>#include "b.h"
  
  void pure_virtual_method_a() {/*implementation*/};
  void pure_virtual_method_b() {/*implementation*/};
  int static_method() {/*implementation*/};
  </code></pre>
  
  <p><strong>c.cpp</strong> - A file with only a main method and where I want to instantiate an object of <code>B</code> to use its methods.</p>
  
  <pre><code>#include "b.h"
  
  int main(){
      B obj;
      obj.pure_virtual_method_a();
      return 0;
  }
  </code></pre>
  
  <p><strong>Question 1:</strong> To instantiate an object of <code>B</code> in <code>c.cpp</code>, do I need to write the header file <code>b.h</code> like above? That seems to be so redundant! It looks like interface <code>A</code> is so unnecessary :-(</p>
  
  <p><strong>Question 2:</strong> Is the code presented the right way to implement interface <code>A</code>, and use an object of type <code>B</code>?</p>
  
  <p><strong>Question 3:</strong> Do I need to declare a constructor for <code>B</code> in <code>b.h</code> and implement it in <code>b.cpp</code>?</p>