Why do you always use bad design patterns?

I often see some articles on design patterns, write a lot of content, and give some "vivid" examples. But it may have the same problem as the Head First design pattern: after reading it, I will, but it doesn't seem to be useful? Or hard cover design pattern. ​ Take a few extreme examples I've seen: Two fields, and a Builder3 if ...

Posted by Jimmy79 on Mon, 20 Dec 2021 17:54:22 +0100

Iterator pattern of design pattern

The iterator pattern is defined by providing a way to sequentially access the elements in an aggregate object without exposing the internal representation in the aggregate object. The iterator pattern is designed for the "access" of aggregate objects (arrays, collections, linked lists). Aggregate objects are traversed by defining diff ...

Posted by nextman on Mon, 20 Dec 2021 17:47:15 +0100

Detailed explanation of single case mode

What is singleton mode? introduce The design pattern of singleton pattern is a creation pattern, which provides the best way to create objects. This pattern involves a single class that is responsible for creating its own objects while ensuring that only a single object is created. This class provides a way to access its unique object, which ...

Posted by Senate on Mon, 20 Dec 2021 11:42:55 +0100

Examples and implementation of static agent and dynamic agent

preface    proxy mode. We will explain it here in combination with JAVA static proxy and dynamic proxy. It is similar to Spring AOP aspect oriented programming: enhanced message is also a proxy mode.    what are the differences between our static proxy and dynamic proxy and (service) interface and (serviceImpl) interface i ...

Posted by damienmcd on Mon, 20 Dec 2021 03:25:44 +0100

Design mode - factory mode

Factory mode explain Factory Pattern is one of the most commonly used design patterns in Java. This type of design pattern belongs to creation pattern, which provides the best way to create objects. effect Decoupling; For example, when we buy a computer, we don't need the factory model. We need a new computer, which is equivalent to buildin ...

Posted by Infinitus 8 on Mon, 20 Dec 2021 00:56:55 +0100

[design mode] Chapter 3 single example mode

Chapter 3 single example mode 1, Introduction Singleton Pattern is a creation mode, which provides the best way to create objects. This mode involves a single class, which is responsible for creating its own objects and ensuring that only a single object is created. This class provides a way to access its unique object, which can be acces ...

Posted by chinto09 on Sun, 19 Dec 2021 23:40:07 +0100

Design pattern ------------ static / dynamic agent pattern (structural design pattern)

1. Proxy mode definition Provides a proxy for other objects to control access to this object. (you go to rent a house, not directly to the landlord. Instead, you provide you with the landlord's information through the intermediary, and then you go to the corresponding landlord) 2. Application scenario Rental intermediaryMarriage introduc ...

Posted by undecided name 01 on Sun, 19 Dec 2021 11:12:56 +0100

Design mode 2-20 status mode

1, Definition The status mode is defined as follows: Allow an object to alter its behavior when its internal state changes. the object will appear to change its class. (when an object's internal state changes, it is allowed to change its behavior, and the object looks like it has changed its class) The general class diagram of the st ...

Posted by whizzkid-000 on Sun, 19 Dec 2021 07:24:00 +0100

Mobile terminal development

1px solution Why is 1px written in the css of the mobile terminal, which actually looks thicker than 1px In fact, the reason is easy to understand: the meaning of these two 'PX' is different There is always a sentence in the html header of the mobile terminal <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-sca ...

Posted by sublevel4 on Sun, 19 Dec 2021 05:28:18 +0100

Android developers reread design mode: write an upload decoupling library to practice

Last week, I finally finished reading the beauty of design patterns. I always wanted to write something to practice. It happened that I wanted to reconstruct the company's upload library recently, so I had this article. (it's just for learning and practicing. If you have any suggestions, the architecture boss can spray it gently) 0x1. Miscella ...

Posted by csatucd on Sun, 19 Dec 2021 04:25:17 +0100