1 Overview
Adapter mode: convert the interface of a class into another interface desired by the requirements, so that those classes that cannot work together due to interface incompatibility can work together
classification
The class adapter pattern class has a high degree of couplingObject Adapter Pattern
2 Structure
The Adapter patt ...
Posted by MG-WebDesigns on Mon, 16 May 2022 22:58:25 +0300
definition:
Separate the abstract part from its implementation part so that they can change independently. It is an object structure mode, also known as handle and body mode or interface mode.
The bridge mode is similar to the multiple inheritance scheme, but the multiple inheritance scheme often violates the principle of single responsibilit ...
Design mode - single case mode - eight different implementations [JAVA] and single case problem sorting - necessary for interview - super detailed
Introduction to singleton mode
the singleton pattern is a software design pattern that restricts the instantiation of a class to one "single" instance. It can be simply understood as: a class ca ...
Posted by SalokinX on Mon, 16 May 2022 21:13:29 +0300
Data study organized from: Station B is still Silicon Valley
I wrote a set of code to understand by myself, which has been uploaded Code cloud Since the design pattern is a big topic with a lot of content, my plan is to learn some commonly used ones first, and then gradually make them comprehensive.
Design Patterns
Design Pattern
...
Posted by wenxi on Mon, 16 May 2022 17:10:42 +0300
Design mode (II) 23 design modes
Rookie tutorial design mode
Design mode interview questions Express Edition
All references in this article are from the design pattern GoF
Component collaboration mode
Strategy mode
Have the concept of "timeline"
motivation
Support often changesChange the algorithm transparently to decoupl ...
Posted by zampu on Sun, 15 May 2022 21:36:33 +0300
Abstract factory pattern (detailed version)
The production of a kind of products is considered in the factory method mode, such as only raising animals in the livestock ranch, only producing televisions in the TV factory, and only cultivating students majoring in computer software in the school of computer software.
The same kind is called the ...
Factory pattern - understand Spring's Bean factory
Connect the scene of "Lao Zhang drives to the northeast" in object-oriented. Link name
Encapsulate the vehicle in "Lao Zhang drives to the northeast", encapsulate the vehicle Car
Only one car is given to the driver (single case, multiple cases)
By the way, explain the single ...
Posted by fuzz01 on Sun, 15 May 2022 07:34:12 +0300
preface
Singleton mode is the simplest of Java design modes. You only need one class to implement singleton mode. However, you can't underestimate singleton mode. Although it is relatively simple in design, you will encounter many pits in implementation. Therefore, fasten your safety belt and get on the bus.
Definition of singleton mode
Sing ...
Posted by RestlessThoughts on Sat, 14 May 2022 16:23:00 +0300
This week's Android learning summary
activity life cycle
test: Write the following code in MainActivity.java
public class MainActivity extends AppCompatActivity {
private static final String TAG = "life_cycle";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
s ...
Posted by gamerzfuse on Sat, 14 May 2022 09:20:05 +0300
After learning object-oriented programming, learn to create objects using keywords"new" To create objects, but creating objects in this way is a bit redundant and too coupled when a complex and multiple objects need to be created, and it is not easy to be understood. Factory pattern is used to create objects
First, the simple factory mode.
T ...
Posted by mr_badger on Fri, 13 May 2022 19:56:49 +0300