Thoroughly understand the principle of Spring state machine and realize the decoupling of order and logistics

This article is excerpted from "design patterns should be learned this way"1 UML class diagram of state patternThe UML class diagram of the state pattern is shown in the figure below.2. Use the status mode to realize the free switching of login statusWhen we read articles in the community, if we think the articles are well written, we ...

Posted by LucidParody on Tue, 16 Nov 2021 00:17:19 -0800

Singleton mode of design mode

Singleton mode Baidu Encyclopedia: Singleton mode is a common software design mode of creation type. The class created by the method of singleton mode has only one instance in the current process (if necessary, it may belong to singleton in a thread, for example, only the same instance is used in the thread context) summary Personal ...

Posted by rekha on Fri, 12 Nov 2021 03:23:52 -0800

Introduction to policy mode and its specific usage scenarios

preface Today, I optimized the previous business code with the strategy mode and reviewed the relevant concepts of the design mode. I'll record it here 1, Introduction to policy mode definition: The policy pattern defines the algorithm family and encapsulates them separately so that they can replace each other. This pattern makes ...

Posted by stubarny on Fri, 12 Nov 2021 02:02:41 -0800

Ten thousand words long text and practical cases make the abstract factory no longer abstract

This article is excerpted from "design patterns should be learned this way"1 about product hierarchy and product familyBefore explaining the abstract factory, we need to understand two concepts: product hierarchy and product family, as shown in the figure below.In the figure above, there are three kinds of figures: square, circle and ...

Posted by Fribbles on Thu, 11 Nov 2021 21:46:46 -0800

Tell a Romantic Love Story with Face-to-Face Mode for a Great Wedding

Design Mode Notes - Face Mode Facade Design Mode Basic Introduction The facade design mode is a structural mode. Generally speaking, it refers to the surface of a building, especially the most attractive one. It can represent a behavior and appearance that easily misleads one's true feelings or situations. When people pass through the surfac ...

Posted by geekette on Thu, 11 Nov 2021 09:09:02 -0800

Comprehensive and thorough analysis of factory method mode

This article is excerpted from "design patterns should be learned this way" 1. Application scenario of factory method mode The factory method mode is mainly applicable to the following application scenarios. (1) Creating objects requires a lot of repetitive code. (2) The client (application layer) does not depend on the details of ho ...

Posted by oldtimer on Wed, 10 Nov 2021 21:15:18 -0800

Design pattern learning - using go to implement bridging patterns

Bridging mode preface definition advantage shortcoming Application scenario code implementation reference resources Bridging mode preface The code implementation of the bridge mode is very simple, but it is a little difficult to understand, and the application scenarios are relatively limited. Therefore, equivalent to the agent mode, the ...

Posted by bolerophone on Wed, 10 Nov 2021 17:50:10 -0800

The beautiful world of Java design pattern Monads

[note] this article is translated from: [Beautiful World of Monads - DEV Community](https://dev.to/siy/beautiful-...)Let me start with the disclaimer. From the perspective of functional programming, the following explanation is by no means accurate or absolutely accurate. On the contrary, I will focus on the clarity and simplicity of the explan ...

Posted by CrowderSoup on Wed, 10 Nov 2021 13:37:45 -0800

Thoroughly explain the details of the simple factory that you haven't paid attention to

This article is excerpted from "design patterns should be learned this way" 1 encapsulate product creation details using simple factory mode Next, let's look at the code and take the creation of an online course as an example. Assuming that there are courses such as Java architecture, big data and artificial intelligence, an ecosyste ...

Posted by caster001 on Wed, 10 Nov 2021 13:02:47 -0800

Thoroughly explain the details of the simple factory that you haven't paid attention to

This article is excerpted from "design patterns should be learned this way"1 encapsulate product creation details using simple factory modeNext, let's look at the code and take the creation of an online course as an example. Assuming that there are courses such as Java architecture, big data and artificial intelligence, an ecosystem h ...

Posted by SieRobin on Tue, 09 Nov 2021 23:08:46 -0800