Recently, some netizens asked me how to learn Java backend by myself, and some wanted to switch to other directions, but they did not know exactly what Java backend needs to learn, where to learn, which are the mainstream Java backend technologies, etc., so they wanted to learn, but they were confused and did not know where to start. I write in this blog with the experience of those who have come, not necessarily right, but I have summed up according to their own experience, for your reference.

Java based

Java is a pure object-oriented programming language, so in addition to the basic syntax, you must understand its OOP features: encapsulation, inheritance, polymorphism. In addition, there are generics, reflection characteristics, many framework technology rely on it, such as Spring core Ioc and AOP, are using reflection, and Java itself is the use of reflection to achieve dynamic proxy, here I specially wrote a Java dynamic proxy principle analysis. In addition, there are some Java standard libraries are also very common, such as collections, I/O, concurrency, almost everywhere in Web development, is often asked about the interview, so before self-learning Java backend, might as well lay a good foundation, in addition to some new features of Java8, also should focus on, Lambda expressions, Stream operations for collections, the new Date API, etc. I’ve also written a few blog posts about these new features, so please find them for yourself.

About the book recommendation, I is not recommended for beginners start with “Java programming thought” chew, because at the beginning I was that on the afternoon of the decision self-study Java, night, holding the book bite people, to be honest, I really don’t understand it at that time what, because I don’t have a little the basics of the object-oriented programming language, and the book and write too extensive and profound, For me at the time, it was a complete mystery, but I think it’s still the Bible of The Java world, and I learn something every time I read it. I recommend that you start with “Java Core Technologies”, which is easy to read and easy to understand for beginners.

As for the video recommendation, I was listening to the Java basic course taught by Mr. Bi Xiangdong of a certain guest. Mr. Bi’s speech was so vivid and interesting that I was unable to extricate myself from the Java pit unconsciously. Sometimes I would laugh out loud when LISTENING to his video, which was probably the most interesting moment in my self-study period.

The database

About SQL: SQL tutorial, MySQL tutorial

After I understood some basic grammar, I directly followed the video teacher to do some actual table operation practice, such as single table query, multi-table query and so on. I recommend that you practice SQL, not just understand it, because it is very important to write concise SQL at work. Here I say that I have been adhering to the SQL statement in the project is to avoid multiple table query to avoid multiple table query, can separate multiple statements to separate multiple statements, because here involves the performance of multiple table query and database expansion.

About JDBC: JDBC tutorial, JDBC access connection object source code analysis

You need to understand the JDBC API, which is just a set of canonical interfaces. As long as any database driver implements JDBC, we can call the corresponding driver through the standard API without knowing how the driver is implemented. This is the benefit of interface oriented programming. And FOR JDBC, I directly watched the video to understand, followed the video to make a small tool with transactional based on Apache Dbutils tool, I specially summarized with mind map:

The Web based

Hongshu, the founder of Open Source China, once wrote an article “Learning Java Web development for the first time, please stay away from various frameworks and start from Servlet development”. I think he is absolutely right. In Java development nowadays, many developers only know how to use frameworks, but they don’t know some knowledge points about Web at all. But it is basically a routine, so before you learn any framework, please lay a good Web foundation, the Web foundation laid, see the framework is really like a duck to water.

About Http protocol, this article is written very clearly: Http protocol

As for the data recommendation of Web foundation, I was reading “Detailed Explanation of Tomcat and Java Web Development Technology”, which explained the whole Technical knowledge point of Java Web development in great detail. But now, I think some of the technologies mentioned in it are really a little old. But it’s also good to know the history of Java Web development. So in the Web foundation this aspect I all is to see a guest cui teacher to speak of “super comprehensive Java Web video tutorial”, speak very detailed very vivid, there is actual combat project!

As far as JSP is concerned, all you need to know is that it is really a Servlet, and some of its tag usage is something I think you can just ignore because almost no company on the Internet uses JSP anymore, except for some old projects. In the era of back-end separation, single-page applications, and apis on the back end, time is at a premium, so focus on the Servlet specification.

As for Tomcat, it is a Web container to which all back-end projects we write need to be deployed to run. It is actually an Http compliant server that interacts with clients through Socket communication: Tomcat structure and request processing

Mainstream Web Frameworks

There are so many Java Web frameworks, you can write a Web framework when you have some experience. Many people on the Internet say that Spring, Struts2 and Hibernate are the three carriages of Java. I just want to say that it is a long time ago. I seriously do not recommend Struts2, Hibernate, believe me, at the beginning just need to use Spring, SpringMVC, Mybatis, especially the Spring framework, in fact, the Spring family of frameworks are very good.

But a reminder is, do not indulge in a variety of frames can not extricate themselves, will be a variety of usage and complacent, resulting in knowledge and do not know why.

The core ideas of Spring are IOC and AOP:

Talk about your understanding of Spring IOC

Spring is faceted programming

The idea of SpringMVC is to use a Servlet to forward and control all requests. This Servlet is called DispatcherServlet:

SpringMVC initialization process

SpringMVC handles the request process

Mybatis implements dynamic SQL assembly, avoiding almost all JDBC code and manual parameter setting and result set fetching:

Mybatis tutorial

Mybatis simple series

Web framework advanced

After using the SSM framework, you may feel that frameworks are no more than that, but if you have a general understanding of Spring, you may also want to write a “copycat” version of Spring, a lightweight Web framework with the following features:

  1. User – defined configuration files can be read and used to initialize the framework;
  2. A Bean container that manages the object life cycle of the project’s classes;
  3. With dependency injection, reduce the coupling between classes;
  4. Have AOP function, so that the project can be horizontal programming, without changing the original code to increase the business logic;
  5. Have MVC framework pattern.

In fact, in addition to SSM, there are hundreds of Web frameworks, among which the Spring family is the most dazzling. Here I highly recommend two Spring family frameworks: SpringBoot and SpringCloud.

SpringBoot makes up for the shortcomings of Spring configuration and no longer needs to struggle with complicated XML. It is a disrupter of Java backend development. Recommended book: Java EE Disrupter: SpringBoot In Action

SpringBoot builds web projects

SpringBoot automatic configuration source code analysis

Customize the SpringBoot Starter

spring-boot-starter-tutorial

SpringCloud is a microservices architecture that enables projects to be divided into microservices by business, each of which can be independently deployed and coordinated with each other. As a project becomes larger and larger, it becomes more and more difficult to maintain. In this case, splitting the project into several micro-services, maintaining and deploying them separately can also reduce the coupling degree between different services of the project. Recommended book “Spring Cloud and Docker Micro-service Architecture Combat”, this book Docker and micro-service together perfectly, can be called perfect!

Spring Cloud Chinese official website

The simplest Spring Cloud tutorial ever

I blog about Spring Cloud:

Service registration and discovery for the SpringCloud microservices architecture

Service consumers of the SpringCloud microservices architecture

Circuit breakers for the SpringCloud microservices architecture

A service gateway for the SpringCloud microservices architecture

Other technologies

Redis: a high performance key-value database. When there is a high concurrency request, the data is cached in Redis, which improves the response performance of the server and greatly reduces the pressure on the database.

Redis Chinese official website

Redis tutorial

Git: The most advanced distributed version control system in the world, it is recommended that all beginners start using Git from the command line! Follow stormzhang public account “Googdev”, reply “github”, you can get a free github tutorial ebook, I think it is very good.

Git website

Git tutorial

Git commands

Maven: A tool for building projects that neatly organize inter-project dependencies together through XML, and can be compiled into bytecode files by compiling plug-ins. Gradle is also a good choice.

Maven pom. XML file

Linux: At least the usual commands can be used and the project can be deployed in a Linux environment.

Linux Commands

The most complete SSH connection remote terminal tutorial

Docker: It is a magic tool for project deployment, too late to explain, see my Docker series blog, start the Docker journey! Recommended book “Docker technology introduction and actual combat”, China’s first Docker works!

Docker Combat (1)

Docker Combat (2)

Docker Combat (3)

docker-deploy-tutorial

The development tools

To do a good job, you must first sharpen your tools. Here are some of the tools I recommend:

Intellij IDEA: The best IDE for Java development, this is universally acknowledged, I started with Eclipse, then used Intellij IDEA, only to find Eclipse is a piece of shit, so I advise you not to use Eclipse, directly Intellij IDEA!

IntelliJ IDEA tutorial

Iterm2: The best terminal for macOS!

Iterm2 Usage guide

Chrome: Life is short, use Chrome, there’s no time to explain, get in the car!

Postman: a very useful interface debugging tool.

The Postman’s official website