Proxy mode for design mode

Basic Introduction Provides a surrogate for an object to control access to it. That is, to access the target object through a proxy object, the advantage is that on the basis of the target object, additional functional operations can be enhanced, that is, to extend the function of the target object.Proxied objects can be remote objects, expens ...

Posted on Mon, 06 Dec 2021 21:06:46 -0500 by zc1

[design mode from introduction to mastery] 09 - appearance mode

Note source: Shang Silicon Valley Java design pattern (illustration + framework source code analysis) Appearance mode 1. Cinema Management Project Set up a home theater: DVD player, projector, automatic screen, surround sound and popcorn machine are required to complete the function of using home theater. The process is as follows: Direct re ...

Posted on Sun, 05 Dec 2021 19:11:55 -0500 by sliilvia

[design mode from introduction to mastery] 09 - appearance mode

Note source: Shang Silicon Valley Java design pattern (illustration + framework source code analysis) Appearance mode 1. Cinema Management Project Set up a home theater: DVD player, projector, automatic screen, surround sound and popcorn machine are required to complete the function of using home theater. The process is as follows: D ...

Posted on Sun, 05 Dec 2021 07:34:36 -0500 by jmosterb

Advanced Android custom controls: Canvas operation

I originally wanted to put the canvas operation in the later part, but I found that many graphics rendering are inseparable from the canvas operation, so I'll explain the basic operation methods of the canvas first. 1, Quick reference table for common operation of Canvas Operation typeRelated APIremarksDraw colordrawColor, drawRGB, drawARGBFi ...

Posted on Fri, 03 Dec 2021 19:57:13 -0500 by valshooter

Example analysis of Flutter 2.0 routing at the 18th bend of mountain road

preface Last Flutter 2.0's routing confused me The routing of fluent 2.0 is introduced. After reading the introduction, it is basically in the clouds. After tossing around for a day, I finally got a complete example. In a word, it is summarized as: Eighteen turns of mountain road! Note that this article is long and time-consuming to read (it ...

Posted on Fri, 03 Dec 2021 09:06:10 -0500 by smclay

Decorator mode of design mode

What is decorator mode Official explanation: Decorator Pattern allows you to add new functions to an existing object without changing its structure. This type of design pattern belongs to structural pattern, which is a wrapper for existing classes. Usage scenario For example, a pancake fruit must first have a pancake, and then add scallion, ...

Posted on Fri, 03 Dec 2021 00:21:05 -0500 by ub_kh

Behavioral model

1, Introduction Behavioral pattern is used to describe the complex process control of a program at run time, that is, how multiple classes or objects cooperate with each other to complete tasks that can not be completed by a single object. It involves the allocation of responsibilities between algorithms and objects. Behavioral patterns are div ...

Posted on Thu, 02 Dec 2021 13:51:47 -0500 by mtwildcard

Design mode - decoration mode

        Structure diagram interpretation: Component can be either an interface or an abstract class. Its purpose is to specify Operation(), that is, what the specification is going to do. ConcreteComponent is a class that inherits or implements Component. It is the representative of decoration, such as rice and milk tea. Decorator class i ...

Posted on Wed, 01 Dec 2021 17:15:20 -0500 by Crogge

Six principles of design pattern - Dimitri's law

Six principles of design pattern - Dimitri's law Definition: Dimitri's law is also called the least knowledge principle. An object should have the least understanding of other objects. An English interpretation of Dimitri's law is: Only talk to your immediate friends. A class should know the least about the class it needs to couple or call. T ...

Posted on Wed, 01 Dec 2021 16:24:47 -0500 by kazer

Structural design mode -- enjoy element mode FlyWeight

gossip Today is the weekend. I wanted to be lazy. Let's think about a design pattern It's not well written. Welcome to discuss it together~ Basic points 1. Usage scenario: memory is a scarce resource. If there are many identical or similar objects, we can save memory through meta sharing mode 2. Core – support the reuse of a large num ...

Posted on Tue, 30 Nov 2021 16:22:24 -0500 by ZachMEdwards