Android Design Pattern opening

Source: Internet
Author: User

Below I will list some important points:

The design model provides solutions to solve many software engineering problems.

There are three categories based on the purpose of the Mode:

1. Creation Mode: it is related to object creation.

2. Structured mode: A combination of processing classes and objects.

3. behavior mode: describes how classes or objects interact and how responsibilities are assigned.

Two basic principles of object-oriented design:

1. Programming for interfaces, rather than implementing programming.

2. Object combination is preferred, rather than class inheritance.

Five design principles of object-oriented design:

1. Single Responsibility Principle (SRP)

2. Open and closed principle (OCP)

3. liskov replacement principle (LSP)

4. Dependency inversion principle (DIP)

5. Interface isolation principle (ISP)

Design Pattern in 23:

1. Creation Mode:

(1). Factory method mode

(2). Abstract Factory Model

(3). creator Mode

(4). prototype mode

(5). Singleton Mode

2. Structural Mode:

(6). Adapter Mode

(7). Bridge Mode

(8). Combination Mode

(9). decoration Mode

(10). Appearance Mode

(11). metadata sharing

(12). Proxy Mode

3. behavior mode

(13). interpreter Mode

(14). template method mode

(15). Responsibility Chain Model

(16). Command mode

(17). iterator Mode

(18) intermediary Mode

(19). Memorandum Mode

(20) Observer Mode

(21). Status Mode

(22). Rule Mode

(23). Visitor Mode

In addition, people later found many new models, such as the empty mode.

The following lists several common problems that may lead to re-design. The design pattern may be used for analysis and solution:

1. Create an object by specifying a class displayed

2. dependencies on special operations

3. Dependency on hardware and software platforms

4. Dependency on object representation or implementation

5. algorithm dependency

6. Tight coupling

7. Extend functions by using the production subclass

8. The class cannot be easily modified.

Software design Odor:

1. Rigidity

2. Vulnerability

3. intractable

4. Viscosity

5. unnecessary complexity

6. unnecessary repetition

7. Obscure

......

All in all, in a word, this is the case of object-oriented features + principles + models.

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.