Design pattern - builder pattern and its application

In system development, there is often the need to create a complex object. This complex object is composed of several sub parts. For example, we now need to assemble a computer, which is composed of CPU, motherboard, hard disk, memory, display, mouse, keyboard... And choose computers with different configurations according to our real use scena ...

Posted by srikanth03565 on Fri, 01 Apr 2022 06:07:45 +0300

Hongmeng open source third-party component -- VideoCache video cache component

catalog: 1. Component rendering display 2. Sample parsing 3. Library parsing 4. Collection of articles on Hongmeng open source third party components preface Video cache component based on Android platform( https://github.com/danikula/Android VideoCache ), the migration and reconstruction of hongmenghua has been realized, and the code has ...

Posted by louisA2A on Thu, 31 Mar 2022 03:17:01 +0300

Adapter mode

1, Adapter mode Adapter patterns are divided into class structured patterns and object structured patterns. The former has a higher degree of coupling between classes than the latter, and requires programmers to understand the internal structure of relevant components in the existing component library, so there are relatively few applicati ...

Posted by nwoeddie23 on Wed, 30 Mar 2022 21:18:44 +0300

Design pattern abstract factory pattern

Abstract factory pattern The two design modes we saw before have their own defects. In the simple factory mode, a factory produces multiple products and creates corresponding product instances according to the product names provided by customers; In the factory method design mode, many factory classes are created in the factory in the simple f ...

Posted by oskom on Wed, 30 Mar 2022 19:25:05 +0300

[23 Java design modes] Command (14)

command Encapsulate a request as an object, so that you can parameterize customers with different requests, queue or log requests, and support revocable operations. Command mode refers to encapsulating a request into a command and then executing the command. The commander sends the order to the soldiers, and the soldiers do it. The good ...

Posted by asgerhallas on Wed, 30 Mar 2022 02:09:59 +0300

Using the BeanCopier of cglib, copy the object with prototype mode and shared meta mode

In fact, there are many tools for object copying, such as Apache beautils, apache PropertyUtils and spring beautils. In some business code, spring bean utils is often used to copy objects. In most cases, it's enough, but in terms of performance, the above tools are completed by using the principle of reflection. The performance is slightly wors ...

Posted by Toggles on Wed, 30 Mar 2022 01:35:40 +0300

Prototype mode of 23 design modes

Today, we will continue to explore the prototype mode of GOF's 23 design modes, which is also a kind of creative mode Generally speaking, prototype mode is the process of object replication, that is, through a prototype object, I can get a clone of the object. Let's look at the first way to write the prototype pattern -- JDK native public in ...

Posted by bubblocity on Mon, 28 Mar 2022 00:52:06 +0300

Object oriented programming internal mental skill series 14 (talk about template mode)

1. Introduction In the previous article, we shared the observer pattern in the behavioral design pattern. In this article, we will talk about the template design pattern. The full name of the template design pattern is called the template method design pattern. Template design pattern is a widely used design pattern in practical application. ...

Posted by deansatch on Sun, 27 Mar 2022 19:37:58 +0300

Design mode - decorator mode

WX search: personal cultivation of programmers see moreDecorator modeRuntime extensions are far more powerful than compile time inheritance. We will discuss how to use object composition to decorate classes at run time.The behavior of subclasses designed by inheritance is statically determined at compile time, and all subclasses will inherit th ...

Posted by ryza_ on Sat, 26 Mar 2022 12:24:46 +0300