Sunday, February 5, 2012

C++ Factory Example

Posted by Jason On September - 29 - 2009

An Example/Tutorial of the Factory Design Method

A factory method is a static method of a class that returns an object of that class’s type.  Unlike a constructor, the actual object it returns might be an instance of a subclass.  It can return existing instances multiple times.  The factory method is basically a “creator” design pattern in C++ for creating sub classes from a base type class.

C++ Factory Example

Add A Comment

You must be logged in to post a comment.