First of all, let’s talk about the situation of most beginners: just clicking on the Java project in front of the video, I can still solve the bugs encountered, but every time I finish clicking on a project, I feel very empty. I feel that I understand the knowledge points in the project, but I don’t seem to understand them. How can I master the knowledge points used in a project?
Let’s start by sharing the experience of a good friend, Ding Wei, author of Inside RocketMQ Technology. He had no experience with messaging middleware before trying to learn RocketMQ, but he refined his learning methods and eventually became a great evangelist for the RocketMQ community. This gave him a very bright label and greatly improved his competitiveness in the workplace.
He concluded with four points:
- Understand the usage scenarios of the project and the responsibilities of the architectural design.
- Look for official documentation to get an overview of the project’s design philosophy.
- Set up their own development and debugging environment, run the official Demo example, to lay a foundation for further research.
- First main flow and then branch flow, pay attention to cutting, break one by one.
I think it makes perfect sense. I remember that at the beginning of my work, AFTER I got the project arranged by the leader, I was so confused that I didn’t know how to start or what TO do. To ask the leadership, the leadership said no time, I want to study first, research what?
I didn’t have a clue at first, but then I figured it out a little bit carefully.
Start with the requirements document for the project and get a general idea of what the project is about. Then put the source code of this project in the local run, “run”, said simple, really do it is still very difficult, I remember I ran the first project almost took more than a week, because my development environment and project requirements are a little different, it led to a lot of problems.
I was very impressed by two problems, the first one is garbled, similar to the picture below.
The second is a compilation error, simply because the JDK version is different.
These are two simple problems, but they are so common, really, that almost all novices encounter them. At the beginning of the encounter is very panic, because the source will not have a problem, there is certainly a problem is their own development environment.
After more than a week, the project is finally running.
I put myself in a testing role, where I clicked on all the buttons that worked to see which projects were developed and which weren’t. It didn’t take long for me to detect two or three new bugs, which were basically caused by some unconventional operations. Although I failed to solve them, after reporting to the leadership, the leadership was still very surprised. He looked at me with small eyes, somewhat looking at Wu Xia Ameng’s feeling, “Boy, you have made progress!”
Then, instead of rushing to develop the tasks assigned to me by my boss, I looked at the code my colleague had already done, with the question, why did he write it that way? What’s the advantage of writing this? How would I do that if I were you? Is the difference my own thoughtlessness?
Of course, I will not see too detailed, because some of the content beyond my technical scope, I do not understand, can only be a “cursory look”, roughly understand what is the meaning of “muddle along”.
One thing to remind everyone here is, don’t get bogged down in technical details, especially at the beginning of a project, because you don’t know the business, plus the technical level may not be up to, it’s easy to get killed studying technical details.
Another point is that the basic skills must be solid, do not even understand the overall code context, that is very difficult. I have here a GitHub star mark 115K + Java tutorial, which covers all the Knowledge of Java, including Java syntax, Java Collections framework, Java IO, Java concurrent programming and Java virtual machine, the content is not much, just focus on the main points.
GitHub star standard 115K + Java tutorials, super hardcore!
Try to take some time to build a foundation and not be too passive. Meet oneself unfamiliar knowledge point, take the initiative to check.
Look at the source code, add some log ah, add some breakpoints ah, to run. Sometimes, do not add a breakpoint, just go to the source code is likely to ignore some of the key technical details, because Java is a polymorphic, some places to see the source code can only see the level of the relationship between class and class, but can’t see how to rewrite the superclass method, a subclass is how to implement the interface or implementation class, through debugging can see understand.
There are also some branch statements ah, if you just look at the source code may not understand the conditions into the branch is what. There are some more key technical details ah, only look at the source may be ignorant, follow the breakpoint step by step in-depth may understand all.
For example, take the Append () method of StringBuilder. The internals of StringBuilder are implemented through character arrays (Java 8), and if a new string is added that exceeds the length of the array, it is expanded. After the breakpoint is added, you can see how the JDK works in case of expansion, as shown below.
Generally speaking, the project is relatively large, the code will be more, then the best only focus on a module, is through the requirements document, or read the source code to understand most of the modules, try to give the overall logic of this module is to understand that if this module is to arrange you to do the leadership of the business code, you began difficulty is greatly reduced.
To sum up:
- Once you get the project, don’t rush into it. Read the documentation, especially the requirements documentation.
- Run the project’s source code locally.
- Do some tests and see if you can detect any boundary bugs.
- Focus on a module and explore the source code, but don’t get too bogged down in technical details.
I’d like to recommend two excellent Java open source projects that you can practice on if you’re not already working on them.
- SpringBoot complete e-commerce system Mall: including the front Mall system and background management system, based on SpringBoot+MyBatis implementation.
- VHR: Micro hr is a human resource management system with the separation of front and back ends. The project adopts SpringBoot+Vue development.
One of my previous e-commerce projects also used mall as the basic structure! Mall’s tutorial is very comprehensive, the author directly made an online website, basically with the technology are particularly clear!
VHR currently has 20.8K star on GitHub, which is a very strong one.
Back-end technology stack
- Spring Boot
- Spring Security
- MyBatis
- MySQL
- Redis
- RabbitMQ
- Spring Cache
- WebSocket
.
Front-end technology stack
- Vue
- ElementUI
- axios
- vue-router
- Vuex
- WebSocket
- vue-cli4
.
Basically all the mainstream front and back end technologies are used. The author specially recorded the project deployment video tutorial for beginners, very thoughtful ~
It’s very well documented, so LET me just list it.
- Permission database design
- Setting up the server environment
- Dynamic handling of roles and resource relationships
- The password is encrypted and salted
- Unified handling of server exceptions
- Axios request encapsulation, unified processing of request exceptions
- Attach the request method to the Vue
- Save login status
- Dynamically load components after successful login
- Role resource relationship management
- User role relationship management
Basically every knowledge point has a corresponding document, the document is complete, to understand the project is an excellent help.
Well, last but not least, when you’re doing your practice project, make sure you write notes. I see a point in many places that says, “Please stop commenting, because only bad code needs comments.” This is a very clever point of view, which reminds me of mencius’ saying, “Yang is for me, no prince is also; Universal love is fatherless. Fatherless and kingless, they are animals.”
Java source code authors are some of the best programmers in the world, and even they write comments. Those who say “please stop writing comments” are going to slap their faces until they’re all puffed up.
Take String, for example. To understand this class, it’s enough to look directly at the class’s comments, which are very detailed.
A good Java project should also be like this, annotations must be in place, otherwise others will not be able to understand. Can only say that the author of Java source code, YYDS (Yin and Yang master, HHH).
I’m the second brother. How about a thumbs up?