Start using boost library. Use boost::factory for component creation.