Discussion on design mode decorator

The last part of the book is about the structural mode - decorator design mode Decorator design mode Definition: dynamically attach functions to objects without changing the original objects. Extension: different from inheritance, it enhances the function of the original object through the decorative object, which belongs to dynamic combinat ...

Posted by voyde on Sat, 16 Apr 2022 08:09:38 +0300

Static / dynamic proxy mode

Agent mode: Why learn the agent mode? Because the underlying mechanism of AOP is dynamic agent! Agent mode: Static proxy Dynamic agent Before learning aop, we should first understand the agent mode! Static proxy Static agent role analysis Abstract role: it is generally implemented using interfaces or abstract classes Real role: the r ...

Posted by Jeroen Oosterlaar on Fri, 15 Apr 2022 13:50:09 +0300

[design pattern learning notes] detailed explanation of single case mode (lazy type meets multithreading problem analysis based on C + +)

catalogue 1, What is singleton mode 1. Design mode 2. Singleton mode 2, Implementation of singleton mode 1. Lazy singleton mode 1.1 how to ensure that there is only one instance object 1.2 defects of lazy singleton mode 2. Lazy singleton mode and multithreading 2.1 multithreaded construction object 2.2 starving Han style single instan ...

Posted by dkode on Fri, 15 Apr 2022 04:34:51 +0300

Design mode - builder mode

What is the builder model Builder pattern, also known as generator pattern definition, separates the construction of a complex object from its representation, so that the same construction process can create different representations (dependency inversion) Four roles of builder model 1)Product role: a specific product object. 2)Builder (Abst ...

Posted by DylanBlitz on Thu, 14 Apr 2022 16:32:42 +0300

Java design pattern part2

Chapter 6 abstract factory class When it is necessary to add gender to people, there will be six combinations of race and gender. Therefore, when opening factories, two factories can be opened according to the difference between men and women. The current class diagram includes 1. Person (Interface) 2. Black and white yellow man (abstract ma ...

Posted by mwd2005 on Thu, 14 Apr 2022 04:56:10 +0300

Responsibility chain model

Responsibility chain model As the name suggests, the Chain of Responsibility Pattern creates a chain of receiver objects for requests. This mode gives the type of request and decouples the sender and receiver of the request. This type of design pattern belongs to behavioral pattern. In this pattern, each recipient usually contains a reference ...

Posted by oakld on Wed, 13 Apr 2022 19:38:24 +0300

Design pattern customizing Spring framework

4. Customize Spring framework 4.1 spring usage review Before customizing the spring framework, first review the use of the spring framework, so as to analyze the core of spring and simulate the core functions. Data access layer. Define UserDao interface and its subclasses public interface UserDao { public void add(); } public class ...

Posted by hmvartak on Wed, 13 Apr 2022 13:48:55 +0300

Application scenario of policy mode

Application scenario of policy mode The main purpose of the policy pattern is to separate the behavior from the specific algorithm or implementation. All roads lead to Rome. Taking different routes or travel modes, although there will be different algorithms or implementations, the final behavior is to go to Rome. Its basic implementation ...

Posted by cahamilton on Wed, 13 Apr 2022 03:54:04 +0300

People who often visit Github know the open source framework

preface Software development can be said to be a very cumbersome process. Open source framework is essentially an entry framework created by many companies to reduce the time required for development. Open source framework is a software development template designed by the social network composed of project software developers. This framewor ...

Posted by Drace on Wed, 13 Apr 2022 02:57:40 +0300

Design pattern - single example

characteristic There is only one instance object in the system;The construction method of singleton class is private, and it holds its own instance object;Open access to instance objects; classification The single case mode can be divided into hungry Chinese type, full Chinese type, enumeration type, internal type and container type; The tes ...

Posted by bb_sarkar on Mon, 11 Apr 2022 12:08:47 +0300