A class factory constructs instances of other classes. Typically, the classes they create share a common base class or interface, but derived classes are returned.
For example, you could have a class factory that took a database connection string and returned a class implementing IDbConnection
such as SqlConnection
(class and interface from .Net)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…