Performance comparison between shallow and deep copies

Preface In daily development, object conversion is frequently used, which can be roughly divided into shallow copy and deep copy. If subdivided, deep copy can be subdivided into several types. This paper makes a series of tests based on several mainstream deep copy methods, and explores the principles and scenarios. Readers are welcome to d ...

Posted by wilorichie on Wed, 08 Sep 2021 10:36:46 -0700

[vernacular design pattern, uncover secrets

problem Suppose you are developing a logistics management application. The original version could only handle truck transportation, so most of the code was in a class called truck. After a while, this app became extremely popular. You can receive more than ten requests from shipping companies every day, hoping that the application can su ...

Posted by Xyphon on Mon, 06 Sep 2021 19:16:29 -0700

[source code analysis and design mode 2, heavy message

Like the factory method mode, the abstract factory mode is also composed of four elements: abstract factory, concrete factory, abstract product and concrete product. However, the number of methods in the abstract factory is different, so is the number of abstract products. The main roles of the abstract factory pattern are as follows: 1. Abst ...

Posted by tecdesign on Mon, 06 Sep 2021 17:44:24 -0700

[source code analysis and design pattern] 102021 is a significant year

The Adapter pattern converts the interface of a class into another interface that the customer wants. So that those classes that could not work together due to interface incompatibility can work together. The adapter pattern has two different forms: class adapter and object adapter. 2, Structure of adapter mode 1. Target Define a specific ...

Posted by andre_c on Mon, 06 Sep 2021 13:10:21 -0700

Spring MVC framework technology summary, Java learning route guide

@Controller public class UserController { @RequestMapping(value = "/users",method = RequestMethod.POST) public String insertUsers(@RequestBody List<User> users){ System.out.println("insertUsers"); System.out.println(users); return "/success.jsp"; } } 3.2.4 summary 🔥 If there are curly braces outsid ...

Posted by al3x8730 on Sun, 05 Sep 2021 20:24:36 -0700

Spring MVC reviews the old and knows the new – from scratch, the mind map + core + architecture allows you to reach your goal in one step

1: The user initiates a request, which will be intercepted by the front-end controller (dispatcher servlet) 2: The front-end controller (dispatcher servlet) requests the Handler mapping to find the Handler 3: The Handler mapping finds the corresponding Handler (which can be more annotated or XML configured) according to the configuration. It ...

Posted by kmussel on Sun, 05 Sep 2021 19:01:16 -0700

â‘  , jQuery, massive algorithm, high-frequency interview question compilation and analysis

Create a new jquery.min.js file in vs (any name here, as long as it is a JS file) Import in html file <script src = "jquery.min.js"></script> 1.2. jQuery entry function 🔥 // The first method is recommended $(function(){ ... // This is the entrance to the completion of page DOM loading }) // The second ...

Posted by bryan52803 on Sun, 05 Sep 2021 13:06:53 -0700

[summary of Java Web basics about encapsulation

This bad smell results when implementation changes are not encapsulated in abstractions and hierarchies. The forms are usually as follows: The client program is closely coupled with the service variants it needs. Whenever it needs to support new variants or modify existing variants, it will affect the client program. Whenever new variants n ...

Posted by ta2 on Sun, 05 Sep 2021 09:40:12 -0700

C language memory layout understanding

Edit: is to create and modify the source code of C program - the program we write is called source code.Compilation: is to convert the source code into machine language. The output of the compiler becomes the object code, and the file in which they are stored is called the object file. The extension is. o or. obj. (this partial compilation refe ...

Posted by pingu on Sat, 04 Sep 2021 22:29:49 -0700

[Redis 1] overview of Redis basic knowledge, mars Java tutorial, baidu online disk

(1) Is business data commonly used? What is the utilization rate? If utilization is low, there is no need to write to the cache. (2) Does the business have many read operations or write operations? If there are many write operations and the database needs to be written frequently, there is no need to use cache. (3) What is the size of bu ...

Posted by infini on Fri, 03 Sep 2021 23:35:06 -0700