JD.com buy Dangdang buy
All codes in the column are developed based on Java 8 + Spring Boot 2.2.1.RELEASE + Spring Cloud Greenwich.SR4 + Spring Data Moore-SR4, and dependency management is based on Maven.
Each case is an independent SpringBoot or Java command line application that can be started independently to avoid mutual interference, but they share a Maven POM.
After downloading the source code, first run the docker-compose up command in the root directory to run related MySQL, Redis, ES, RabbitMQ and other systems through Docker, and then start the application.
Most of the column only relies on one component, MySQL. If you have difficulty starting docker-compose, you can first comment on the relevant components in docker-compose.yml, such as commenting on ES and RabbitMQ, and then start it when you need to use it later in the design chapter, and You need to delete the relevant SpringBoot Starter module in pom.xml at the same time.
There is a readme.md Markdown file in the source code root directory. There is a directory listing the source code location corresponding to each article. At the same time, there is a readme.md file below each source code package, which lists each article. The source code package name of each section in this article.
Most cases in the source code will use wrong and right naming methods to represent wrong implementation and correct implementation. You can compare the implementation with the content of the book to understand.
Some cases (such as the SQL index article) will generate test data based on the current time, so it is not guaranteed that the test results in the article can be reproduced locally, and you need to adjust the test cases yourself.
Click the link to enter the code folder for each section
There is also a readme.md file in each folder, which lists the source code folders of each section in each section.
[Thinking] represents the code involved in thinking and discussion
[Extended] represents the code involved in extended reading
[Supplement] Represents more other codes that do not appear in the book.
1.0: java8
2.1 Using a concurrent tool library does not mean that there are no thread safety issues: concurrenttool
2.2 Code locking: Don’t let “locking” become a worry: lock
2.3 Thread pool: The most commonly used and most error-prone component in business code: threadpool
2.4 Connection pool: Don’t let the connection pool hurt you: connectionpool
2.5 HTTP calls: Have you considered timeouts, retries, and concurrency: httpinvoke
2.6 20% of Spring declarative transactions in business code may not be handled correctly: transaction
2.7 Database index: Index is not a panacea: sqlindex
2.8 The issue of equality: How to determine that you are you in the program: equals
2.9 Numerical calculations: Pay attention to precision, rounding and overflow issues: numericalcalculations
2.10 Collection class: List operation full of pitfalls: collection
2.11 Null value processing: unclear null and annoying null pointer: nullvalue
2.12 Exception handling: Don’t let yourself become blind when something goes wrong: exception
2.13 Logging: Logging is not as simple as you think: logging
2.14 File IO: It is not easy to achieve efficient and correct file reading and writing: io
2.15 Serialization: Over and over again, are you still the same person? serialization
2.16 Make good use of Java 8’s date and time classes and avoid some of the “third old” pitfalls: datetime
2.17 Don’t think that OOM is impossible with “automatic transmission”: oom
2.18 What pitfalls will there be when reflection, annotations and generics encounter OOP: advancedfeatures
2.19 Spring Framework: IoC and AOP are the core of extensions: springpart1
2.20 Spring Framework: It has done a lot of work for us and also brought complexity: springpart2
3.1 Code duplication: three tricks to solve code duplication: redundantcode
3.2 Interface design: The language of dialogue between systems must be unified: apidesign
3.3 Cache design: Caching can be the icing on the cake or adding insult to injury: cachedesign
3.4 When the business code is written, does it mean that it is ready for production: productionready
3.5 Asynchronous processing is easy to use, but it is very easy to use it incorrectly: asyncprocess
3.6 Data storage: How do NoSQL and RDBMS complement each other and complement each other? :nosqluse
4.1 Data source: Nothing on the client side can be trusted: clientdata
4.2 Security: When it comes to money, you must consider anti-swipe, limited and heavy protection: securitylastdefense
4.3 Data and code: data is data, code is code: dataandcode
4.4 How to correctly save and transmit sensitive data: sensitivedata
5.1 Troubleshooting routines for locating Java application problems: N/A
5.2 To analyze and locate Java problems, you must make good use of these tools: troubleshootingtools
5.3 Some pitfalls in migrating Java programs from virtual machines to Kubernetes: N/A
If you think the source code is helpful to you, welcome to Star