Design mode - responsibility chain mode

1, Introduction to responsibility chain model The Chain of Responsibility Pattern is also called the responsibility chain pattern In order to avoid coupling the request sender with multiple request processors, all request processors are connected into a chain by remembering the reference of the next object through the previous object; W ...

Posted by mu-ziq on Mon, 04 Apr 2022 01:58:17 +0300

Singleton pattern of JAVA design pattern

1, Introduction to singleton mode 1 mode description Implement one class, only one instantiated object, and provide a global access point 2 role (problem solved) Ensure that there is only one object in a class to reduce the coupling between objects 3 working principle In Java, we operate these classes by using objects (after class ins ...

Posted by yuppicide on Mon, 04 Apr 2022 00:57:50 +0300

Design pattern learning note combination pattern and its application in tree structure

Composite mode, also known as tree mode, is mainly used to process tree structure data. Is to organize a group of objects into a tree structure to represent a "part whole" hierarchy. The client can unify the processing logic of single object and combined object. 1, Introduction to combination mode The combination mode represents &quo ...

Posted by pinxue on Sun, 03 Apr 2022 10:43:13 +0300

Interpreter mode

definition Interpreter Pattern refers to a given language, defining a representation of its grammar, and defining an interpreter that uses the representation to interpret sentences in the language. Interpreter mode is a mode of parsing according to the specified grammar, which belongs to behavioral design mode. Application scenario Some recu ...

Posted by Cleanselol on Sun, 03 Apr 2022 09:58:20 +0300

Builder pattern of design pattern

I significance Separate the construction of a complex object from its representation, so that the same construction process can create different representations. Note: for the construction of complex objects, for example, if an object has dozens of member attributes, it will be very troublesome when we create this object and assign values to th ...

Posted by mgason on Sat, 02 Apr 2022 22:07:59 +0300

Design pattern learning note sharing meta model and its application

Flyweight mode: as the name suggests, it is a shared unit. The intention is to reuse objects, save memory and improve the access efficiency of the system. For example, the background flowers, grass, trees and other objects in the red and white Adventure Island game can actually be reused and shared by different scenes for many times, which is w ...

Posted by jfourman on Sat, 02 Apr 2022 18:53:48 +0300

This article explains the past and present life of Android lightweight storage scheme in detail

Storage scheme is a very important module in Android development. Here is a big man's past and present life of Android lightweight storage scheme. I hope it will be helpful to your study and work. Original address: https://juejin.cn/post/6934494768185475079 background For Android lightweight storage solutions, there are shared preferences ...

Posted by maGGot_H on Sat, 02 Apr 2022 00:12:26 +0300

Design mode-05-prototype mode

1, Prototype mode Prototype Pattern is used to create duplicate objects while ensuring performance. This type of design pattern is a creation pattern, which provides the best way to create objects. (simply put: use an instance that has been created as a prototype, and create a new object that is the same as the prototype object by copying the ...

Posted by kbc1 on Fri, 01 Apr 2022 19:49:14 +0300

Design mode - 8 single case modes

Mengxin design mode - 8 single case modes reference material: https://www.bilibili.com/video/BV1G4411c7N4?p=1 Shang Silicon Valley Han Shunping's design model If most of the teachers have mistakes, please pick up your own notes Reference: there are many repeated chapters on the Internet. I forgot to refer to the articles of several bloggers ...

Posted by Nicoza on Fri, 01 Apr 2022 16:39:46 +0300

Decorator mode

Decorator mode Decorator Pattern allows you to add new functionality to an existing object without changing its structure. This type of design pattern belongs to structural pattern, which is a wrapper for existing classes. This pattern creates a decoration class to wrap the original class, and provides additional functions on the premise of m ...

Posted by lettheflamesbegin on Fri, 01 Apr 2022 08:05:02 +0300