clionlin 2022-05-22 11:57:06 阅读数:934
An abstract factory , A brand can have two products to be produced in this abstract factory
The functions that industry standard mobile phones need to realize
Which brand of products do customers choose , You can place an order if you get the products under this brand , Then the brand factory starts to produce the products required by customers （ Mobile phone or router ）
When the goods are received, the customer can use the functions of the product
Separate interface and Implementation
The client uses the abstract factory to create the required objects , And the client doesn't know who the implementation is at all , The client is just product oriented interface programming . in other words , The client is decoupled from the specific product implementation .
Make it easy to switch product families
Because a specific factory implementation represents a product family , For example, in the above example, from Xiaomi series to Huawei series, you only need to switch specific factories .
copyright：author[clionlin]，Please bring the original link to reprint, thank you. https://en.javamana.com/2022/142/202203140552568698.html