Cglib, Javassist, JDK dynamic proxy

1. Introduction Java's dynamic proxy is really important, especially when you want to understand the principles of some frameworks. If you are not familiar with Java dynamic proxy or even know Java dynamic proxy, you can basically just say "I'm too hard". For example, to know why MyBatis doesn't need an implementation, you only need a ...

Posted by mharju on Sun, 10 Nov 2019 17:04:46 -0800

Retake design mode - agent mode

Introduction: The agent mode belongs to the structural mode. Its function is to provide a kind of agent for other objects to control the access to this object. Common implementation methods include static agent and dynamic agent. AOP in Spring is based on the proxy pattern. The specific implementation and test are as ...

Posted by mcclellanfsu on Sun, 10 Nov 2019 08:07:37 -0800

New features of JDK 1.8 -- Collector interface and Collector tool class

Absrtact: This article mainly studied the Collector interface and Collector utility classes newly added in Java 1.8, and the improvement and optimization of using them in collection processing. Some of the content comes from the following Blogs: https://www.jianshu.com/p/7eaa0969b424 Streaming processing The new streaming processing in JDK ...

Posted by MikeDXUNL on Sat, 09 Nov 2019 10:11:14 -0800

The second reading of Mybatis source code

From the previous series I, we know that SqlSession is new SqlSessionTemplate(sqlSessionFactory). We start from SqlSessionTemplate analysis.     List-1 public class SqlSessionTemplate implements SqlSession, DisposableBean { private final SqlSessionFactory sqlSessionFactory; private final ExecutorType executorType; private final ...

Posted by elacdude on Sat, 09 Nov 2019 08:15:59 -0800

JDK source code: ConcurrentLinkedQueue

The implementation of blocking queue has been explained before. Today, we will continue to understand the implementation of non blocking queue in the source code. Next, let's see how the non blocking queue of concurrent linked queue completes the operation Preface JDK version No.: 1.8.0« ConcurrentLinkedQueue is an unbounded thread safe F ...

Posted by blackhawk08 on Sat, 09 Nov 2019 04:11:35 -0800

Java IO programming - file copy

There is a copy command in the operating system. The main function of this command is to realize the file copy processing. Now it is required to simulate this command and realize the file copy processing by inputting the copy source file path and the copy target path through initialization parameters. Demand analysis: If you need to copy file ...

Posted by fiddler80 on Sat, 09 Nov 2019 02:41:22 -0800

HashMap performs well?Asked me if EnumMap did not

1 Introduction We know that Map is just an interface and has many implementations. HashMap is the most common one in Java.This article is about another implementation: EnumMap.It is an enumerated Map, requiring its Key values to be enumerated. 2 Create your EnumMap Now that it's a Map about the enumeration type, let's first create an enumeratio ...

Posted by alen on Thu, 07 Nov 2019 06:17:37 -0800

How much is Math.round(-1.5)?

Operation result: - 1 java.lang.Math class in JDK round(): returns rounding, and negative. 5 decimal returns a larger integer, such as - 1.5 returns - 1. ceil(): returns the larger value between two integers where the decimal is located, for example, - 1.5 returns - 1. tail(): returns the smaller value between two integers where the deci ...

Posted by madhavanrakesh on Wed, 06 Nov 2019 14:44:08 -0800

Elastic search source code analysis - source code construction

This article introduces how to build Elasticsearch from source code. Building Elasticsearch source code is the basis of learning and studying Elasticsearch source code, which helps to better understand Elasticsearch. Environmental preparation Environment / software Edition Remarks OS Ubuntu 14.04 LTS Gradl ...

Posted by Magicman0022 on Tue, 05 Nov 2019 11:51:35 -0800

Java structural pattern sharing element pattern

Alibaba cloud double 11 campaign in 2019: https://www.aliyun.com/1111/2019/group-buying-share I. overview Sharing mode: "sharing" is the meaning of sharing, which means that one thing is shared by all, and this is the ultimate purpose of the mode. Sharing element mode is similar to singleton mode in that only one object is generated t ...

Posted by phpete2 on Mon, 04 Nov 2019 00:31:40 -0800