Simple factory + strategy mode of design mode

introduction Original link: Take you to read several common design patterns first bullet I hope you can pay attention to my official account. There is a QR code at the end of the text. Thank you!   The purpose of writing design patterns is mainly to pave the way for writing spring series articles later. As we all know, spring uses a lot of d ...

Posted by csaba on Thu, 28 Apr 2022 19:39:21 +0300

Design Patterns - Structural Patterns

This article is a note made by myself after learning the graphic design mode of Mr. Han Shunping from Shang Silicon Valley. The code is all typed according to the video. I don’t know if there will be any suspicion of reprinting. If so, please remind me, thank you! Welcome to leave a message to discuss! 1 Adapter mode Overview: A p ...

Posted by riddhi on Thu, 28 Apr 2022 12:27:32 +0300

java proxy mode

proxy pattern What is an agent For example, you ask your friend (entrusted class, also known as agent class) to bring you food, and then your friend brings it to you when he goes out to dinner. At this time, you are in the dormitory bb and ask him to bring you a drink. At this time, your friend also endured and brought you drinks, but if you a ...

Posted by dull1554 on Wed, 27 Apr 2022 18:46:25 +0300

Theme switching framework implementation

preface I have made a theme switching framework. I'll introduce myself here. Let's see if it's useful. Criticism and correction are welcome. Project address: https://github.com/l0neman/ThemeFramework The following is the readme of the project MD readme file. introduce Android instant theme switching framework The core is that based on ...

Posted by centipede on Wed, 27 Apr 2022 12:33:16 +0300

Design pattern: easy to learn 05 agent pattern

preface There are 23 design patterns mentioned in the book jointly published by GOF (Erich Gamma, Richard Helm, Ralph Johnson and John vlisides), which can be divided into three categories: creative patterns, Structural Patterns and Behavioral Patterns. Characteristics of agent model In this chapter, we mainly introduce the Proxy Pattern ...

Posted by leetcrew on Wed, 27 Apr 2022 11:17:33 +0300

From definition to AST and its traversal mode, this article will help you understand Antlr4

Abstract: This paper will first introduce the definition of Antlr4 grammer, how to generate the corresponding AST through Antlr4 grammer, and two AST traversal modes of Antlr4: Visitor mode and Listener mode. 1. Brief introduction to antlr4 Antlr4 (Another Tool for Language Recognition) is an open-source parser generation tool developed ba ...

Posted by shuka79 on Wed, 27 Apr 2022 02:44:02 +0300

After reading the series: one article to get Kotlin basic introduction to advanced enhanced actual combat

preface: Kotlin is an extremely flexible language, which is a double-edged sword. Compared with Java, we all write in vernacular. Regardless of the level, we can basically read each other's code very smoothly. However, after using kotlin, due to the different expression level and thinking habits of kotlin, we can create such a situation, " ...

Posted by jonathandg on Tue, 26 Apr 2022 23:31:09 +0300

Design pattern - simple factory

What is a simple factory? 1. Simple factory pattern: also known as static factory method pattern, it belongs to class creation pattern. In the simple factory pattern, an abstract product class can derive multiple specific product classes, all of which have a common parent class. Let's take another look at the UML diagram of the simple factory ...

Posted by juancuca on Tue, 26 Apr 2022 18:05:13 +0300

Design pattern: Proxy Pattern

Static proxy: An object uses multiple proxies. The class that implements the proxy is xxxProxy. Proxy also implements the interface of the proxy object, so nested proxy can be realized. The proxy class of static proxy is written in advance. The premise is that we know the proxy method of the proxy object by implementing the specified interface ...

Posted by bitt3n on Tue, 26 Apr 2022 07:59:29 +0300

Structural mode - bridging mode

Bridge is used to decouple abstraction from realization, so that they can change independently. This type of design pattern belongs to structural pattern, which realizes the decoupling of abstraction and realization by providing a bridge structure between them. This pattern involves an interface as a bridge, which makes the function of t ...

Posted by psd99 on Tue, 26 Apr 2022 02:16:15 +0300