In normal usage, the client software creates a concrete implementation of the abstract factory and then uses the generic interface of the factory to create the concrete objects that are part of the theme. Le code client crée une instance concrète de la fabrique abstraite, puis utilise son interface générique pour créer des objets concrets de la thématique. Une fabrique abstraite encapsule un ensemble de fabriques ayant une thématique commune. Abstract Factory pattern lets a class defer instantiation to subclasses. 抽象工厂模式在 Java 中的实现。 示例代码包含详细注释和说明。 抽象工厂是一种创建型设计模式, 它能创建一系列相关的对象, 而无需指定其具体类。 Uma vez que utilizei a interface DbInterface para a criação de uma família de produtos relacionados, que nesse caso é para manipulação do SGBD If the abstract factory object will use information provided by the requesting client to select among multiple concrete factory objects, you can hard code the selection logic and choice of concrete factory objects in the abstract factory class. The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes. Experienced developers are probably already familiar with many of them, but our article would be extremely useful for all developers. Here's the Animal interface:. Patterns in PHP. 抽象工厂模式(Abstract Factory) ... AbstractFactory.php