Concrete realizations

  class N : public R {  
\fbox{N}
public: N(int i) : n(i) { } void action() { cout << n << endl; } protected: int n; }; A::A(int n) { rep = new N(n); }
// constructor for A
  class S : public R {  
\fbox{S}
public: S(char* p) : s(p) { } void action() { cout << s << endl; } protected: char* s; }; A::A(char* s) { rep = new S(s); }
// constructor for A

slide: Concrete realizations