Java language supports multithreading. In order to solve the problem of thread concurrency, synchronization block and volatile keyword mechanism are introduced. Volatile has the "visibility" of synchronized keyword. For each use of volatile variable, the thread can get the latest value of current volatile variab ...
Posted by hhisc383 on Sat, 23 May 2020 20:51:30 -0700
A set of code does the following:
Packaging different applicationId s can be installed on the same phone at the same time
Different logo, app name,
Different third-party SDK access configurations (e.g. WeChat sharing appid, laser push appkey)
Ability to distinguish debug from release configurations
Functions used: productFlavor and buildTypes ...
Posted by WindChill on Sat, 23 May 2020 10:26:31 -0700
Internal state, external state, enjoyment pool
Role & UML
Demo: Editor Picture Reuse - Java
Flyweight Pattern is a shared way to reuse a large number of fine-grained objects to reduce memory usage (to avoid creating and destroying objects in large amounts repeatedly).
The Flyweight in the name is one ...
Posted by idevlin on Sat, 23 May 2020 09:56:32 -0700
In java programs, we use logs to locate and discover potential problems in our projects.In modern java projects, we use logging frameworks such as log4j or slf4j, Logback, and so on to handle logging issues.
JVM is the basis of running java programs. Events in JVM such as GC, class loading, JPMS, heap, threads and so on can a ...
Posted by littlejones on Fri, 22 May 2020 16:54:30 -0700
1. The concept of responsibility chain model
The responsibility chain model is an object's behavior model.In the responsibility chain model, many objects are linked together to form a chain by each object's reference to its subordinates.Requests are passed along this chain until an object in the chain decides to process the request.The clie ...
Posted by Cardale on Fri, 22 May 2020 10:08:54 -0700
Weird database exception:
There are mainly two abnormal sections as follows
1. Connection reset
The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.Na ...
Posted by TFD3 on Fri, 22 May 2020 08:03:25 -0700
Source code: GitHub point here || GitEE point here
1, The concept of idempotent
1. An introduction to idempotent
The characteristic of an idempotent operation in programming is that the influence of any multiple execution is the same as that of one execution. That is to say, one or more requests for a resource have the same effect.
2. HTTP req ...
Posted by careym1989 on Fri, 22 May 2020 06:59:12 -0700
This paper introduces the simple application of spring boot integrating spring data JPA
What is spring data jpa? We can't help thinking about it. In fact, spring data jpa uses hibernate by default and spring data jpa technology, which implements the template Dao layer. It only needs to inherit an interface in Dao to easily complete "add, d ...
Posted by k4pil on Fri, 22 May 2020 02:53:32 -0700
>File upload and download is a common function in Web application. In this tutorial, I will implement a Restful style file upload and download APIs based on Spring 2.2.6.
>Based on the Spring Boot 2.0 actual combat series source code, it has been pushed to Github warehouse: https://github.com/ramostear/springboot2.0-action . Welcom ...
Posted by mattd123 on Fri, 22 May 2020 00:06:33 -0700
Before that Interface test code coverage (jacoco) scheme When I missed something, this article will make up for it. In the process of using jacoco to do interface code coverage test, there is a problem: there is too much information in the test report, which is very messy and not targeted. Many of them are config, bean and adapter classes, and ...
Posted by phpBuddy on Thu, 21 May 2020 20:22:57 -0700