Liar design Mode 1.0.1-----Factory mode

Source: Internet
Author: User
Tags dashed line
Big talk design mode The first chapter: Factory model Polite: The program can run is not necessarily optimal. Can be maintained, extensible, reusable, flexible, avoid duplication (can be more than one link to eliminate duplication) business logic and interface logic of the separate class and object abstract class, virtual method to implement different functions such as calling different functions, to use different classes, as long as a base class, using SWICTH to determine what function to use, You can then initialize the base class with subclasses. One of the most basic classes, inheritance allows all subclasses to have some kind of feature, and in order to implement some dispensable features, interfaces can be used. Principle: As far as possible to avoid duplication only separation can be better maintenance and reuse. To reuse, do not copy to loose coupling does not matter coupling UML diagram: One-way association with arrows, bidirectional not. +public-private#protected line plus blank triangle: inherited, arrow pointing to an inherited dashed line plus a white triangle: implemented, the arrow pointed to the implemented arrow: a class implementation of a class, class containing a class empty diamond plus arrows: aggregation, inclusion, in turn, Not the whole part, and the optional entity diamond plus arrows: synthesis, inclusion, the whole part, not separable, no, there will be numbers, such as a bird has 2 wings dashed arrows: dependence, people to rely on air, etc.

Liar design Mode 1.0.1-----Factory mode

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.