title: Strategy on how to share parameters between an object and one of its members
body: <p>I would like to ask what is the "best" way to share a parameter between an object and one of its members. I try to explain better my problem: I have  a class A which needs a specific a parameter to be defined:</p>
  
  <pre><code>class A
  {
  public:
    A(int);
    ~A();
  private:
    int ParameterA;
    ...
  }
  </code></pre>
  
  <p>Also I have a second class B which contains an object of class A as its member and needs another parameter to be defined:</p>
  
  <pre><code>class B
  {
  public:
    B(int);
    ~B();
  private:
    A  MemberA;
    int ParameterB;
    ...
  }
  </code></pre>
  
  <p>Now my question is: if ParameterA and ParameterB are always equal, what is the "best" (clean) strategy to use?</p>
  
  <p>I thought of three possibility</p>
  
  <ol>
  <li>First option is to have two copies of the same value saved with
  different names as in the code above. This seems to me quite
  "dangerous", it would force me to always check that the two values
  are equals.</li>
  <li>Declare public the ParameterA, so class B can access it</li>
  <li>Define a get function so class B can access ParameterA using the get function</li>
  </ol>
  
  <p>Is there any other (better/standard) approach to deal with this case? What method should I follow?</p>