Factory method pattern of design pattern in Java 23

I. what is the factory method mode FACTORY METHOD is a commonly used class creation design pattern. The core spirit of this pattern is to encapsulate the changing part of the class, and extract the personalized and changeable part as an independent class to achieve the purpose of decoupling, reuse and convenient later maintena ...

Posted on Wed, 13 Nov 2019 13:20:13 -0500 by jrinco11

Multi level cache architecture development VI (test development framework)

0. Import pom file Add pom file of parent module <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>${spri ...

Posted on Mon, 11 Nov 2019 17:15:57 -0500 by zahadum

Secret behind Spring ResponseBody

I. Introduction In the stage of more and more advocating out of the box use, many details are hidden behind us, especially after we start to use spring boot, more automatic configuration makes us convenient, but also makes us think more deeply. In this article, we will learn more about the problems related to the response body process. II. Core ...

Posted on Wed, 06 Nov 2019 19:56:42 -0500 by VapiD

Four Exchange modes of rabbitMQ are easy to use (direct fanout topic header instance)

Keyword Exchange: switch Routing key: routing key Four Exchange modes direct: producers and consumers need to bind the same Exchange and routing key s. fanout: broadcast mode requires producers and consumers to bind the same Exchange. topic: the broadcast mode supporting fuzzy matching is sepa ...

Posted on Sat, 02 Nov 2019 17:08:26 -0400 by phpcoding2

Junit introduction to mastery-15-JUnit advanced-themes

This learning annotation @ Theory and @ DataPoint belong to the data-driven category, just like Parameters.   1.Theory @DataPoint is also a static method with data sources. If @ DataPoint represents a data and @ DataPoints represents a group of data, it is usually @ DataPoints.   2.demo practi ...

Posted on Sat, 02 Nov 2019 13:10:32 -0400 by toivo

Solution to null pointer in manual new object

java.lang.NullPointerException at com.example.new_oa.identity.service.impl.IdentityServiceImpl.getAllDepts(IdentityServiceImpl.java:51) at com.example.new_oa.NewOaApplicationTests.initDb(NewOaApplicationTests.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(N ...

Posted on Fri, 01 Nov 2019 20:57:57 -0400 by ravira

Operation es through TransportClient

Get ready Add dependency <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-elasticsearch</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-s ...

Posted on Thu, 31 Oct 2019 18:07:16 -0400 by ldtiw

Mavenmaven common build commands

Four build commands have been contacted in Maven (2), and there are still clean and install, with the emphasis on install. MVN - V view maven version MVN compile MVN test MVN package MVN clean delete target MVN install install jar package to local warehouse I. create classes and test classes package com.maven02.util; import c ...

Posted on Thu, 31 Oct 2019 10:33:29 -0400 by Genux

Simple code of reader writer problem in java

1. Reader writer questions If a data object is shared by multiple processes, some threads only need to read the data, while others need to modify the data. This is known as the reader writer problem. The conditions are as follows Allow multiple threads to read at the same time Only one write thread is allowed to wr ...

Posted on Thu, 31 Oct 2019 03:38:44 -0400 by lee_umney

Spring ---- factory mode

IOC and DI of Spring core technology Inversion of Control Dependency Injection Factory role -- > beanfactory Abstract product role -- > USB Specific product role -- > usbmoveddisk Example: USB interface, USB disk, hard disk device, USB factory UsbDevice interface: package com.dao; //Abstract products, USB equipment ...

Posted on Tue, 29 Oct 2019 12:17:36 -0400 by ijug.net