Use a special factory mode

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_37597675/article/details/93489754

TBOX one kind of factory model used in
order to make the actual vendor interfaces and methods to achieve separation, a pure virtual class defines the interface as the interface file, then the definition of a factory class. Note that this document is only defined two classes, it did not materialize.
Is defined in another file then the actual file supplier, supplier factory class file implemented, the actual supplier factory class instance creat. And vendor class is a subclass of the interface file, so, to get where it calls the factory class is instantiated class implements to create a real factory supplier

Guess you like

Origin blog.csdn.net/weixin_37597675/article/details/93489754