> Design Patterns > Factory Method > Factory Method Design Pattern In C++

Factory Method Design Pattern In C++

Factory Method design pattern in C++ using subclass to create object of a derived class of another class which is not known.


Factory Method design pattern In C++

Output

ProjectCreator::NewProject()
UnisysProjectCreator::CreateProject()
UnisysProject::AddFile()
ProjectCreator::NewProject()
IBMProjectCreator::CreateProject()
IBMProject::AddFile()


Suresh Kumar Srivastava is founder of online learning site coursegalaxy.com and author of popular books C In Depth, Data Structures Through C In Depth. He has 18+ years experience in industry and worked on architecture and design of multiple products. This article Factory Method Design Pattern In C++ is from his Design Patterns course.