Factory Design Pattern
The "Factory" can receive different parameters, indicate which object user want. All object should all extend from a parent class.
- For instance, if there is a
chessFactory
, there would be a abstract class callPiece
, where all other chess pieces such asKing
,Knight
would inherent from it