For learning J2EE framework has a great help, code in the use of a variety of design patterns, event mechanism, Java8 syntax, the amount of code is also very small, Web services using Netty as a support, to HTTP/ network research must be your must-read. Currently writing a blade-in-action book.

I’ve also written a simple blog post about how to implement the IOC/MVC framework, which can be found in the Biezhi/Java-Bible repository.

I will also mention some of the better code I have seen, which will definitely improve Java capabilities

Subchen/Jetbrick-template-2x

Data structure and algorithm of the class and have a test code: buptdavid/datastructure | kdn251 / interviews

Java write high performance database: Jankotek/MapDB

Netty implementation of high-performance RPC, have written blog analysis: Tang -jie/NettyRPC

Java atomic component library, internal power is very deep: Mindwind/craft-Atom

Code4craft/WebMagic crawler framework by huang Yihua, a former Yelp star

A series of code examples for Java8, pure dry no nonsense: winterbe/java8-tutorial

Summary of Java design patterns with code and articles: Iluwatar/Java-design-Patterns

The most elegant web request library, a Java file: KevinSawicki/HTTP-Request

A community for Java programmers: jq.qq.com/?_wv=1027&k…

More than I’ve ever seen good quality code base, are not particularly high difficulty, but are of great help to enhance or programming, Internet resources so much when we need to calm down and quiet study and thinking rather than blindly pursue the information explosion, so I just choose the ability for code has the difficulty of the ascension is not particularly high share with everybody.

At the same time, I also recommend Ruan Yifeng’s “How to Become Thoughtful” book, which I remember reading three years ago has played a certain role in improving personal programming and life. If you think it is useful to you, you can also try it. The above are some of my personal opinions.

Author: Asens

Source: Zhihu

Write Java Web framework from scratch, written by Yong Huang, a kind of enlightenment, the author wrote a set of IOC and AOP framework and MVC request distribution framework.

How do Spring and SpringMVC work

Then I read the source code of Spring and SpringMVC twice, once following the process, and once understanding the architecture design based on the functions of interfaces and classes

The author of Tomcat explained the evolution of Tomcat from a weak HTTP server with dozens of lines to a servlet container. Follow the book and all kinds of source code to write the evolution of Tomcat again, the real source code has also been over, but too many branches

As a Java Web developer, I feel that I should understand the corresponding process from tomcat startup to Tomcat accepting HTTP requests to SpringMVC routing distribution requests, to business code processing, to template rendering, and to return the corresponding HTTP information. In this way, we can judge the corresponding position of many problems in the first time, so that some ‘magical’ problems are no longer magical

Then there is Netty. I took a look at the niO server implementation of the asynchronous event-driven Reactor model and took my understanding of asynchronous, multithreading, and NIO to a new level

Interspersed with read util package classes

Spring almost doesn’t need to be explained, and everything you use should be read, whether it’s design ideas, code specifications, design patterns, interface design, class loading, is very good source code

Tomcat is too big to be recommended, and the source code is not very reader-friendly, but how Tomcat Works is well worth reading

Netty itself is equally good, but more important is the idea of implementation

Anyway, what does it feel like to read the source code, as if it opens a door to a larger world, to see great code tricks, sound error exception mechanisms, and more importantly, the solution to existing problems, and the idea of solving problems, which are the best textbook for a programmer to grow up

JDK is the best Java source code, the author for performance is also a fight, which will consider the GC friendly, generated memory barrier instructions to as lightweight as possible, in order to deal with false share do fill, can use displacement displacement, not to say, I continue to look at the source code.

Recently I have been reading JDK source code comments, mainly for in-depth study of the basics and concurrent programming. Look at the source code with comments, get very much detail. Often you can see a line of code with thirty-four lines of comments, will be a method use example, need to pay attention to the problem, method implementation details and so on, all said very clearly. Such as the wait and notify methods for Object. The comment states that the wait method causes the current thread to be placed in a set associated with the current object’s monitor. So this is why the wait method needs to be called in the Syncronizied method to get the monitor of the object. Another is that the thread enters the wait, will give the current object lock, this is different from the thread sleep. It also illustrates the problem of thread false awakening, so it is recommended to put wait methods in a while loop. After reading the feeling is really full of dry goods, swept away a lot of basic knowledge blind spot, benefited a lot.