Android architecture design - MVC

objective The purpose of architecture design is to modularize the program through design, so as to achieve high aggregation within the module and low coupling between modules. Improve development efficiency and facilitate subsequent testing and problem location. However, for apps with different orders of magnitude and different requirements, t ...

Added by luv2sd on Fri, 31 Dec 2021 15:15:39 +0200

Design mode - sharing mode

Sharing element mode Object oriented technology can solve some flexibility and scalability problems, but in many cases, it is necessary to increase the number of classes and objects in the system. When there are too many objects, the running cost will be too high, resulting in performance degradation and other problems. Xiangyuan mode was offi ...

Added by saeed42 on Fri, 31 Dec 2021 04:58:19 +0200

Design pattern - template method pattern

Related links: [design mode] column: [design mode] column Relevant examples can be downloaded: Examples of common Java design patterns Template method pattern Template Method Pattern defines the algorithm skeleton in an operation, and delays some steps of the algorithm to subclasses, so that subclasses can redefine some specific steps of ...

Added by Fed51 on Thu, 30 Dec 2021 10:27:58 +0200

Principle of data binding for Android

During the inflate layout, the Activity generates the Binding through DataBindingUtil. From the code point of View, it traverses the contentView to get the View array object, and then generates the corresponding Binding class through the data Binding library, including Views, variables, listeners, etc. The generated classes are located in build ...

Added by bubblocity on Wed, 29 Dec 2021 06:03:21 +0200

Observer mode

1, Definition One to many dependencies are defined between objects. In this way, when an object changes state, the objects that depend on it will receive notification and update automatically. Generally speaking, it is the publish and subscribe mode. The publisher publishes information, the subscriber obtains information, and can receive infor ...

Added by dynodins on Tue, 28 Dec 2021 19:23:01 +0200

Behavioral mode - iterator mode

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 ghgarcia on Mon, 27 Dec 2021 22:09:56 +0200

Glide source code is difficult to understand? Use this angle to get twice the result with half the effort!

preface A powerful framework requires a variety of packages. When we dive into it, it is easy to be confused by all kinds of jumps, design patterns, packaging, etc. in the source code; In this case, we can only understand the general process, but it is easy to forget. Why? Because we haven't really understood it! We don't turn it into our k ...

Added by sri_hai1986 on Mon, 27 Dec 2021 19:43:34 +0200

Adapter mode

1, Overview First, we need to introduce what the adapter mode does Convert the interface of a class into another interface that the customer wants. In short, the adapter mode is to enable us to interact with incompatible classes through certain processing, and the processing process or processing class is what we call the adapter, and the ...

Added by dugindog on Mon, 27 Dec 2021 14:10:24 +0200

Order and combination mode

order Orders are very common in our daily life. Sometimes an order contains other orders, as follows: The order contains two sub orders and a bottle of milk, and the two sub orders have their own contents. In this way, an order tree is formed. The specific goods are leaf nodes and orders are non leaf nodes. As follows: So what should we ...

Added by erisande on Mon, 27 Dec 2021 13:59:09 +0200

Design pattern (C + +)

Design mode (I) 1. Singleton mode definition The singleton pattern is that a class can only be instantiated once, more precisely, a class with only one instantiated object. This class can only have one instance (only create a new object when the pointer is null, otherwise return the original object);It must create the instance itself (the c ...

Added by Crysma on Mon, 27 Dec 2021 12:31:54 +0200