JAVA proxy mode
Java agents are divided into static agents and dynamic agents. Dynamic agent is divided into JDK dynamic agent and cglib dynamic agent. In terms of various performance tests, JDK is better than cglib. It is strongly recommended to master the agent mode, interview high-frequency questions, and use the concept of aspect oriented programming (A ...
Added by Begbie on Mon, 03 Jan 2022 08:31:03 +0200
Design pattern - builder pattern
Introduction and example of builder mode
Builder pattern is one of the creative patterns, which is very commonly used in object-oriented programming
The key of the builder pattern is to separate the construction process of complex objects from its own representation, so that the same construction process can create different representations. ...
Added by JakeTheSnake3.0 on Mon, 03 Jan 2022 07:19:08 +0200
Design Patterns - Single Case Design Patterns
1. Hungry Han Style (Static Constant)
The steps are as follows:
Privatization of constructors (prevent new)Create objects inside classesExpose a static public method to the outside world. getInstancecode implementation
public class SingletonTest01 {
public static void main(String[] args) {
//test
Singleton instance = Singleton.getI ...
Added by Jose Arce on Mon, 03 Jan 2022 05:17:33 +0200
Android beginner animation
Reference resources: Android animation summary
1. Frame animation
That is, play a series of pictures in order to achieve the animation effect.
design sketch: Implementation method:
Create three bitmaps in the drawable directory, which are three pictures to play
a_0.xml
<vector xmlns:android="http://schemas.android.com/apk/res/and ...
Added by silent on Mon, 03 Jan 2022 02:25:42 +0200
Self taught HarmonyOS application development (54) - correct positioning deviation
The previous article has introduced the method of obtaining the current location, which has a problem: there is a deviation of about 500 meters from the actual location.
Cause investigation
After some investigation, it is concluded that the gps signal uses WGS-84 coordinate system, while Gaode map uses GCJ-02 Mars coordinate system. Only af ...
Added by 1josh13 on Sun, 02 Jan 2022 20:27:41 +0200
Iterator pattern of design pattern
In real life and programming, it is often necessary to access various elements in an aggregate object, such as the linked list traversal in the "data structure". The usual practice is to put the creation and traversal of the linked list in the same class, but this method is not conducive to the expansion of the program. If you want to ...
Added by nita on Sun, 02 Jan 2022 20:00:31 +0200
Decoration pattern & prototype pattern of design pattern
1, Decoration mode:
1. Basic theory: Decoration pattern: dynamically add some additional responsibilities to an object. In terms of adding functions, decoration pattern is more flexible than generating subclasses
Decoration mode summary: A way to dynamically add more functions to existing functions. When the system needs new functionality, ...
Added by tyler on Sat, 01 Jan 2022 15:34:51 +0200
Business practice training of design mode
Business practice training of design mode
This paper summarizes how to combine the business and implement it in the whole business project by putting the commonly used design patterns into practice. Some come from real business scenarios, some from large factories, and some from classic cases in the open source framework. It's just fo ...
Added by mojodojo on Sat, 01 Jan 2022 01:45:39 +0200
Agent model of structured model
summary
For some reason, an object needs to be provided with a proxy to control access to the object. At this time, the access object is not suitable or can not directly reference the target object. The proxy object acts as an intermediary between the access object and the target object.
Agents in Java can be divided into static agents and dy ...
Added by tariel on Sat, 01 Jan 2022 01:37:10 +0200
Behavioral model - intermediary model
Catalogue of series articles
Design pattern - design principle
Create mode - singleton mode (I) Creation mode - factory mode (II) Creation mode - prototype mode (III) Creative mode - builder mode (4)
Structural mode - adapter mode (I) Structural mode - bridge mode (II) Structural mode - decorator mode (III) Structural mode - combined mode ...
Added by empnorton on Fri, 31 Dec 2021 15:45:37 +0200