A new solution to the abstract factory model of C # design pattern

Source: Internet
Author: User
Tags abstract

Overview

In the software system, it often faces the creation of "a series of interdependent objects", and because of the change of the demand, more and more series objects are created. How to deal with this change? How do you bypass the normal object creation method (new) and provide a "wrapper mechanism" to avoid the tight coupling of client programs and this "multiple-series concrete object creation"? This is the abstract factory model we are talking about.

Intention

Provides an interface to create a series of related or interdependent objects without specifying their specific classes.

Model Diagram

Logical Model:

Physical Model:

Examples of life

The purpose of an abstract factory is to provide an interface to create a series of related or interdependent objects without specifying their specific classes. This model can be found in the metal stamping equipment used by the car manufacturer. This punching machine can make car body parts. The same machines are used to press the right side doors of different models, the left door, the right front fender, the left front fender and the hood, and so on. By using the runner to change the stamping disc, the specific class that the machine produces can be changed in three minutes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.