App Controller pattern implementation in c++