Design patterns are very useful for maintaining code and improving readability, and in this tutorial you'll learn some of the design patterns found in Swift....
Define an interface for creating objects (including factory methods) and let subclasses decide which class to instantiate. It is mainly used to encapsulate new creation,...
Through a exterior class, the interface of the whole system only has a unified high-level interface, so that the internal and external communication of the...
As a brick remover, we must be all too familiar with nullPointerexceptions. Don't tell me you rarely nullPointerExceptions unless you like them. But for many...
The Tao of Design Patterns likes the way some gurus categorize knowledge into "tao magic devices" (also derived from Taoist thinking). The so-called "Tao", AS...
Abstract classes improve the cohesion of classes and classes and reduce the amount of code. Refactoring: To improve the quality and performance of software by...
Appearance mode: also called "appearance mode" belongs to the structural design mode, which is relatively simple, common and widely used one of the design modes....
The Interpreter Pattern is a representation of a given language's grammar that defines it and an Interpreter that uses that representation to interpret sentences in...
Define a mediation object that encapsulates the interactions between a set of objects, loosens the coupling between the original objects, and can change their interactions...
This article introduces design patterns, including the simple factory pattern, the factory method pattern, and the Abstract factory pattern, and when to use the factory...
Interpreter pattern The interpreter pattern is a behavioral pattern that provides a way to interpret the syntax and expressions of a language by defining an...
Describes the use of template patterns and policy patterns, and the differences between the two, based on Java. There are detailed examples, and the differences...
Encapsulate operations that operate on object elements in a stable object structure without changing the object structure. For example, an object structure consists of many...
This article is a Java implementation of the "prototype pattern". The clone in prototype mode is divided into shallow clone and deep clone. The Object...
The Observer pattern is a behavioral pattern. Intent: Define a one-to-many dependency between objects so that when an object's state changes, all dependent objects are...