Specification Pattern

This article is excerpted from "design patterns should be learned this way"1 definition of specification modeSpecification Pattern can be considered as an extension of composite pattern. Many times, some conditions in the program determine the business logic. These conditions can be extracted and combined in a certain relationship (an ...

Posted by supernova on Thu, 25 Nov 2021 15:37:49 -0800

Spring MVC construction case

Article catalog What is spring MVC A long time ago, SSH was the most popular architecture mode(   Spring   Struts encapsulates servlet s   hibernate  );–> Baidu Encyclopedia SSH Framework Then came SSM(   Spring   Struts   Mybatis  ) ; Note that it's not working here yet   Spring MVC &nbs ...

Posted by cwiddowson on Wed, 24 Nov 2021 08:01:56 -0800

Thoroughly understand the static, dynamic, and pseudo dynamic dispatch of visitor patterns

This article is excerpted from "design patterns should be learned this way" 1. Scenario of KPI assessment using visitor mode At the end of each year, the management will begin to evaluate the work performance of employees for one year. Employees are divided into engineers and managers; The management includes CEO and CTO. CTO pays at ...

Posted by Invincible on Wed, 24 Nov 2021 00:50:18 -0800

With so many groups of wechat and QQ, how should we manage the friend relationship?

This article is excerpted from "design patterns should be learned this way" 1. Application scenario of intermediary mode In real life, the existence of intermediaries is indispensable. Without intermediaries, we can't communicate with distant friends. Each colleague object will reference each other. If each object interacts with mult ...

Posted by roliver on Tue, 23 Nov 2021 13:54:13 -0800

100 lines of code, easy to handle the draft box in the text editor

This article is excerpted from "design patterns should be learned this way"1 use memo mode to realize the draft box functionWe have all used the rich text editor in web pages. The editor usually comes with operations such as draft box and undo. The following code is used to realize such a function. Suppose we publish an article in the ...

Posted by discobean on Mon, 22 Nov 2021 23:37:01 -0800

Refactoring the player control bar using command mode

This article is excerpted from "design patterns should be learned this way"1 UML class diagram of command patternThe UML class diagram of the command pattern is shown in the following figure.2 reconstruct the player control bar using command modeIf we develop a player, the player has playback function, drag progress bar function, stop ...

Posted by ghjr on Mon, 22 Nov 2021 15:10:15 -0800

Chapter 12 Linux startup and kernel management -- CentOS startup management

Chapter 12 Linux startup and kernel management Content overview Startup process for versions prior to CentOS 6Service managementGrub managementStart troubleshootingKernel managementLaunch process of CentOS version 7 and laterUnit introductionService management and viewingStart troubleshootingCrack root passwordRepair Grub2 1.CentOS 6 startup ...

Posted by ebbatten on Mon, 22 Nov 2021 08:19:26 -0800

Chapter 10 network protocol and management configuration

3.5.7 sub network division Sub network division: divide a large network (with more hosts) into multiple small networks (with less hosts), reduce the number of host ID bits, increase the number of network ID bits, and borrow the network ID bit from the host ID bit The number of subnets divided is determined by the bits borrowed from the host I ...

Posted by Darghon on Tue, 16 Nov 2021 02:00:41 -0800

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

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