title: Defining array of unknown type of objects and assign the correct type of objects in the constructor
body: <p>I am trying to achieve generic behavior of foo_unknown class, which calls foo_func1(), foo_func2() methods; and it depends on the type of objects defined in the constructor of foo class that which foo_func1() and foo_func2() method implementations are called. 
  Any new revolutionary design pattern is welcome too. Which takes care of all the issues. </p>