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

Don't you know the usage scenario of the responsibility chain model?

summary In the code, we often have if... else... Judgment. If one condition is not met, we will make the next judgment. This is similar to the responsibility chain mode, but the responsibility chain mode is filtered through objects. scene In the Internet of things industry, a device will push data to the server at a certain frequency to facilit ...

Posted by revraz on Sat, 23 Apr 2022 09:42:13 +0300

Design pattern of python

Design mode Design pattern is a set of code design experience that is repeatedly used, known by most people, classified and catalogued. The purpose of using design patterns is to reuse the code, make the code easier to be understood by others and ensure the reliability of the code. 0. Interface Definition: a special class that declares s ...

Posted by NNTB on Thu, 21 Apr 2022 09:08:35 +0300

Design mode - on observer mode

Introduction to observer mode Observer pattern is the most commonly used design pattern in design patterns. It is often used in one to many software design scenarios. A popular example is the relationship between a newspaper and its subscribers. Anyone who needs a newspaper only needs to subscribe to the newspaper, and the newspaper office wil ...

Posted by ashrust on Thu, 21 Apr 2022 01:12:48 +0300

Design mode --- structural mode

Loose coupling is realized from the program structure, which can expand the overall class structure (1) Adapter mode realization: So that classes with incompatible interfaces can work together For example, the usb interface is incompatible with the network cable interface. One usb transfer interface can be used to make the two work together ...

Posted by metalblend on Wed, 20 Apr 2022 14:08:53 +0300

[design pattern learning notes] detailed explanation of cases of appearance mode and element sharing mode (C + + implementation)

catalogue 1, Appearance mode 1. What is appearance mode 2. Appearance mode cases 2, Sharing mode 1. What is the sharing mode 2. Cases of sharing mode 1, Appearance mode 1. What is appearance mode Facade Pattern is one of the appearance patterns and structural design patterns. The appearance mode provides a consistent and simple interf ...

Posted by gilgimech on Wed, 20 Apr 2022 07:07:28 +0300

Detailed explanation of Java proxy mode

Guidance 1, Proxy pattern The principle of AOP is dynamic agent Dynamic proxy solves the tight coupling between methods, and additional operations can be carried out dynamically in the middle of method calls IOC solves the tight coupling between classes! 1. Core roles and application scenarios Core role: Abstract object Public e ...

Posted by ranman on Wed, 20 Apr 2022 03:20:33 +0300