Observer mode means that the state of an object changes, and the corresponding object will act accordingly
The main roles of the algorithm are: client, subject and observer; A list of observers is maintained in the topic. The client maintains the observers into the topic. When the data of the topic changes, all observers a ...
Added by kcgame on Thu, 10 Mar 2022 17:16:12 +0200
Factory Pattern provides the best way to create objects. We don't have to care about the creation details of objects, we just need to obtain different products according to different situations
1. Factory simple mode
In the simple factory pattern, the method used to create instances is usually static, also known as static factory pattern. It ...
Added by wompas.dub on Thu, 10 Mar 2022 14:34:34 +0200
DrawerLayout is a sliding menu. DrawerLayout is a layout that allows you to put in two direct sub controls. The first sub control is what is displayed on the main screen and the second sub control is what is displayed in the sliding menu.
① So we can in the xml file of MainActivity
<?xml version="1.0" encoding="utf-8"?>
Added by eightonesix on Wed, 09 Mar 2022 13:15:11 +0200
Author: sloth is not lazy
If you have been exposed to Java background development, you must have heard the concept of AOP. What is it and what is its use for our Android development? This blog explores the familiar and unfamiliar concept of AOP from the perspective of Android Engineers:
What is AOP
AOP is the acronym of Aspect Oriented P ...
Added by SerpentSword on Wed, 09 Mar 2022 08:20:54 +0200
1. Design mode Preface
A solution to a problem in a certain environment, including three basic elements – (problem, solution, environment). That is: under certain circumstances, use a fixed routine to solve problems.
1.2. Design pattern
It is a summary of code design experience that is repeatedly used, known by most ...
Added by ecaandrew on Tue, 08 Mar 2022 21:24:18 +0200
I Introduction to status mode
Here is the reference
The behavior in the state mode is determined by the state, and there are different behaviors in different states. The structure of state mode and strategy mode is almost the same, but their purpose and essence are completely different. The behavior of state mode is parallel and irreplace ...
Added by cresler on Tue, 08 Mar 2022 21:14:17 +0200
Proxy pattern is a structural design pattern that allows you to provide alternatives to objects or placeholders for them. The agent controls access to the original object and allows some processing before and after the request is submitted to the object.
Agent mode structure
The service interface declares the functions provid ...
Added by nivek9991 on Tue, 08 Mar 2022 08:03:53 +0200
Adapter pattern of Java design pattern
Basic introduction (1) Adapter pattern converts the interface of a class into another interface representation expected by the client. The main purpose is compatibility, so that two classes that cannot work together due to interface mismatch can work together. Its alias is wrapper (2) The adapter mode is ...
Added by Thumper on Tue, 08 Mar 2022 07:18:39 +0200
Structural design patterns involve how to assemble classes and objects to achieve a larger structure.Structured class pattern uses inheritance mechanism to combine interfaces or implementations.
1. Agent mode
Proxy Pattern uses one class to represent the functions of another class, and objects with existing objects to provi ...
Added by kevinritt on Tue, 08 Mar 2022 06:39:47 +0200