java week 3, about object-oriented (object-oriented ideas and features, interface, three keywords, permission modifier, code block, internal class)

1: Object oriented thought 1. Characteristics of object-oriented thought 1)Conform to the habits of thought and behavior in the real world! 2)Let's turn the executor into the commander(The role has changed!) 3)Simplify complex things! 2. Object oriented design principles in Java You need to constantly create objects,Use object,Com ...

Posted by hemantraijain on Wed, 11 May 2022 16:50:24 +0300

Chain processing of requests in behavioral patterns - chain of responsibility pattern

complete solution In order to make the approval process of the purchase order more flexible and realize the chain transmission and processing of the purchase order, the developers of Sunny use the chain of responsibility model to realize the hierarchical approval of the purchase order. The basic structure is shown in the figure: In the figure ...

Posted by Catharsis on Wed, 11 May 2022 10:24:14 +0300

Observer pattern

Observer pattern Observer Pattern Observer Pattern is an object behavior pattern. When a one-to-many dependency relationship between objects is defined, whenever the state of an object changes, its related dependent objects are notified and automatically updated. Observe Provider mode is also known as Publish-Subscribe Publish-Subscribe mode, ...

Posted by MARIOPARTY53 on Wed, 11 May 2022 08:20:49 +0300

Visitor mode of design mode

Also known as: Visitor Design Pattern 🔥 Intention: Visitor pattern is a behavior design pattern that can isolate the algorithm from the object it works on. 1, Code example For example, consider a shopping cart in which we can add different types of items (elements). When we click the checkout button, it will calculate the total amount to be ...

Posted by Neoraven456 on Mon, 09 May 2022 04:02:27 +0300

Learn from Chunhui - strategy model

In Strategy Pattern, the behavior of a class or its algorithm can be changed at run time. This type of design pattern belongs to behavioral pattern. In the policy pattern, we create objects representing various policies and a context object whose behavior changes with the change of policy objects. The policy object changes the execution algorit ...

Posted by pyr02k1 on Sun, 08 May 2022 23:22:17 +0300

Pitfall Analysis of Ge Push SDK Push Process

I encountered some pits in the process of using a push, and shared it with friends in need. The core process is still based on the content of the official website. Getui official website basic introduction This function of push is still quite common. It is too complicated to make a set of services by yourself. It can usually be solved dire ...

Posted by epicalex on Sun, 08 May 2022 13:11:18 +0300

Structural adapter mode

Structural modeThese design patterns focus on the combination of classes and objects. The concept of inheritance is used to combine interfaces and define how composite objects get new functions. Adapter mode Adapter Pattern is a bridge between two incompatible interfaces. This type of design pattern belongs to structural pattern, which combines ...

Posted by pipe_girl on Sun, 08 May 2022 03:44:47 +0300

Fragment usage of Android

preface Xiaomeng is engaged in iOS development. She studied fluent two years ago, which is very good. Now Xiaomeng wants to connect iOS and android with fluent as the medium, and can call each other. She finds that iOS and Android have many similarities, so it is not difficult to learn. iOS is the most difficult for all front-end languages. Pr ...

Posted by lamia on Sun, 08 May 2022 03:02:02 +0300

"Make up lessons" in progress: design mode (11) -- strategy mode in the game

1. Summary of the foregoing "Make up" in progress: design pattern series 2. Strategy mode in the game I am a person who likes playing games very much. It's really fun to play games at home on weekends. Looking back on the past extraordinary years when I went to college, at that time, I was basically playing games by myself, surr ...

Posted by mpf on Sat, 07 May 2022 10:41:09 +0300

Explain the agent mode from simple to complex (handwritten JDK dynamic agent)

1. Brief summary Proxy mode: refers to providing a proxy for other objects to control access to this object. The agent mode has two main purposes: ① Protect the target object; ② Enhance the target object. Its class diagram is as follows: 2. Classification and detailed explanation 2.1 static agent Take chestnuts for example: ...

Posted by janet287 on Fri, 06 May 2022 23:45:22 +0300