The wonderful use of JAVA8 Optional to solve the problem of judging Null
background
At the beginning of the article, let's talk about the NPE problem. The NPE problem is the NullPointerException we often encounter in development. Suppose we have two classes, and their UML class diagram is shown in the figure below. In this case, there is the following code
user.getAddress().getProvince();
In this way, when the u ...
Posted by EPCtech on Mon, 01 Nov 2021 18:38:27 -0700
Jacko teaches you about dynamic agents
As we know, dynamic proxy uses reflection. AOP in Spring uses dynamic proxy, so it is equivalent to using reflection mechanism. So, what is an agent? What is dynamic agent? How is reflection used in dynamic proxies? Today, I'll show you the true face of dynamic agents.
Agent mode overview
In short, the proxy mode is to use the proxy object to ...
Posted by erikhillis on Mon, 01 Nov 2021 17:20:06 -0700
java -- a collection of high concurrency programming of JUC, which is necessary for large factories
1 what is JUC
1.1 introduction to JUC
In Java, the thread part is a key point. The JUC mentioned in this article is also about threads. JUC is short for Java. Util. Concurrent toolkit. This is a toolkit for processing threads. JDK 1.5 began to appear.
1.2 processes and threads
Process is a running activity of a computer program on a data s ...
Posted by sockit2em on Mon, 01 Nov 2021 16:45:35 -0700
service of android's four components
catalogue
I. concept of service
II. Creation method of service
< 1> Specific steps for service creation
...
Posted by stevegg1965 on Mon, 01 Nov 2021 15:53:52 -0700
SpringBoot: introduction to the principle of automatic configuration -- 4
Boot load auto configuration
@SpringBootApplication analysis
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
excludeFilters = {@Filter(
type = FilterType.CUSTOM,
classes = {TypeExcludeFilter.class}
), @Filter(
type = FilterType.CUSTOM,
classes = {AutoConfigurationExcludeFilter.class}
)}
)
ssdss@Spr ...
Posted by Accurax on Mon, 01 Nov 2021 09:48:42 -0700
Bean life cycle
The life cycle of a Bean can be divided into four steps
Bean instantiationBean attribute assignmentBean initializationDestroy
In traditional Java applications, the life cycle of a Bean is very simple. Instantiate a Bean using the Java keyword new, and then the Bean can be used. Once the Bean is no longer used, Java automatically garbage colle ...
Posted by IsmAvatar on Mon, 01 Nov 2021 09:00:20 -0700
The application of responsibility chain model in the glory of the king, wonderful!
Source: https://blog.csdn.net/IT_charge1, Brief descriptionIn the king glory mall, players can participate in the treasure draw. There are two kinds of lucky draw, one is the integral lucky draw, the other is the diamond lucky draw; In ordinary times, the two winning lottery methods can draw once through 60 diamonds / points, or draw five times ...
Posted by mobtex on Mon, 01 Nov 2021 08:56:32 -0700
kafka cluster integration Kerberos
1, Introduction to KerberosKerberos can put the authenticated key on a reliable node before cluster deployment. When the cluster is running, the nodes in the cluster are authenticated with the key, and the nodes that pass the authentication can provide services. The node attempting to impersonate cannot communicate with the nodes in the cluster ...
Posted by toshog on Mon, 01 Nov 2021 06:53:40 -0700
Summary of several writing methods of retaining two decimal places in Java
I believe you may have such a business requirement when you are working on a project: the data displayed on the page or interface shall be kept to two decimal places. Then, this article will share with you several ways of using Java to retain two decimal places. The article gives a detailed example code, which is very helpful for your learning ...
Posted by webtuto on Mon, 01 Nov 2021 06:53:42 -0700
SpringCloud microservice practice -- building an enterprise level development framework: integrating OpenFeign for calls between microservices
as one of the subprojects of Spring Cloud, Spring Cloud OpenFeign provides a solution for calling between services under the microservice architecture by integrating OpenFeign into the Spring Boot application. Firstly, we use the declarative way of OpenFeign to define the Web service client; Secondly, it goes further by integrating Ribbo ...
Posted by artiemus on Mon, 01 Nov 2021 05:56:45 -0700