Home > Java > JavaBase > body text

What are the java design patterns?

Release: 2019-11-20 11:54:15
Original
2651 people have browsed it

What are the java design patterns?

Design pattern (Design pattern) is a set of classification and cataloging summary of code design experience that is used repeatedly, known to most people. The purpose of using design patterns is to reuse code, make the code easier to understand by others, and ensure code reliability.

Generally speaking, design patterns are divided into three categories and 23 types:

Creational patterns, a total of five types: factory method pattern, abstract factory pattern, singleton pattern , builder mode, prototype mode.

There are seven structural modes: adapter mode, decorator mode, proxy mode, appearance mode, bridge mode, combination mode, and flyweight mode.

Behavioral patterns, eleven in total: strategy pattern, template method pattern, observer pattern, iterative sub pattern, chain of responsibility pattern, command pattern, memo pattern, state pattern, visitor pattern, mediator pattern , interpreter mode.

In fact, there are two categories: concurrent mode and thread pool mode.

Six principles of design patterns

1. Open Close Principle

2. Liskov Substitution Principle

3. Dependence Inversion Principle

4. Interface Segregation Principle

5. Demeter Principle (Demeter Principle)

6. Composite Reuse Principle

For more java knowledge, please pay attention to java basic tutorial.

The above is the detailed content of What are the java design patterns?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template