Java参考学习资源 - bettermorn/ACMWDevHubPPT GitHub Wiki
Java Web应用开发
软件工艺
- 软件工艺宣言 中文版 https://manifesto.softwarecraftsmanship.org/#/zh-cn
- 软件工艺宣言 英文版 https://manifesto.softwarecraftsmanship.org/
学习书单
- Java学习书单:软硬技能皆有 https://bbs.csdn.net/topics/601213958
学习网站及参考
疑问解答
Java基础知识
- 参考书籍《Java编程思想》(中文版) https://github.com/apachecn/thinking-in-java-zh
- Effective Java 3rd edition https://github.com/echoJava/book/blob/master/Java/Effective%20Java%2C%20Third%20Edition.pdf https://githubhelp.com/mz157589766/Effective-Java-3rd-edition-Chinese-English-bilingual 电子版见refermaterials ebook
- Most Common Java Exceptions 参考https://rollbar.com/blog/most-common-java-exceptions/
- 9 Best Practices to Handle Exceptions in Java https://stackify.com/best-practices-exceptions-java/
- Why, When and How to Implement Custom Exceptions in Java https://stackify.com/java-custom-exceptions/
- Java SQL Injection Guide: Examples and Prevention https://www.stackhawk.com/blog/java-sql-injection-guide-examples-and-prevention/
- Top Java Software Errors: 50 Common Java Errors and How to Avoid Them https://stackify.com/top-java-software-errors/
- 静态变量和实例变量的定义和区别 https://learning.oreilly.com/library/view/essential-actionscript-3-0/0596526946/ch04.html#static_variables
- 如何减少NullPointException 的发生 https://www.geeksforgeeks.org/null-pointer-exception-in-java/ https://github.com/melan0228/studyNote/wiki/Basics,-how-to-reduce-the-occurrence-of-NullPointException
- JavaEE 基础知识 https://docs.oracle.com/javaee/5/tutorial/doc/docinfo.html
- JavaEE Servlet:https://docs.oracle.com/javaee/5/tutorial/doc/bnafd.html
代码规范参考知识
- Google Java Style Guide https://google.github.io/styleguide/javaguide.html
- Code Conventions for the Java TM Programming Language https://www.oracle.com/technetwork/java/codeconvtoc-136057.html
- Google Java Programming Practices https://google.github.io/styleguide/javaguide.html#s6-programming-practices
- 阿里巴巴Java开发手册及插件 (https://github.com/alibaba/p3c)
质量监测指标
指标体系
MOOD Metrics for Object-Oriented Design
- 介绍 https://www.aivosto.com/project/help/pm-oo-mood.html
- 参考 https://www.javatpoint.com/mood-factors-to-assess-a-java-program
- 指标
- Method Hiding Factor (MHF)
- Attribute Hiding Factor (AHF)
- Method Inheritance Factor (MIF)
- Attribute Inheritance Factor (AIF)
- Coupling Factor (COF)
- Polymorphism Factor (POF)
cognitive-complexity
Nested conditional and iterations Iterations Conditionals with more than one different logical operators
- Refactoring Code to Pass Sonar Qube’s Cognitive Complexity Checks: https://levelup.gitconnected.com/refactoring-code-to-pass-sonar-qubes-cognitive-complexity-checks-8433433d83a1
- What is Cognitive Complexity in sonar report?:https://stackoverflow.com/questions/52741725/what-is-cognitive-complexity-in-sonar-report
- Cognitive Complexity Lab :https://hs.umt.edu/politicalcognition/labs/cognitive-complexity.php
cyclomatic complexity
程序的圈复杂度()是对各个独立的逻辑路径的测量。同样,它也确定了以确保每个程序的语句至少执行一次所需的测试用例数量(当然,采用巧妙的测试数据,在用例数量较少的情况下也可以实现同样的覆盖度)。直观地说,我们可以推出只包含一个语句序列的程序的圈复杂度为1。每个能影响程序流程的逻辑成分(理论上被称为谓词),例如if、while和for的参数,都会给该值加1。
参考面试题:
面试题包括面向对象、Spring相关知识、数据类型、异常以及try catch、线程、Java虚拟机原理、IO操作
- https://www.guru99.com/java-interview-questions-answers.html
- https://www.softwaretestinghelp.com/java-coding-interview-programs/
- https://www.interviewbit.com/java-interview-questions/
- https://tests4geeks.com/java-online-test
- https://www.edureka.co/blog/interview-questions/java-interview-questions/
面向对象
CS0150 is one of the introductory Computer Science courses offered at Brown University. https://cs.brown.edu/courses/cs015/
Java工具类信息
IDE
- Java 之父 James Gosling:你需要的软件可靠性越高,静态类型语言的帮助就越大 https://www.infoq.cn/article/fhzjlty6uoscxvpltbmq
- 从 Eclipse到IDEA,就像从金字塔到太空堡垒! https://cloud.tencent.com/developer/news/319900
- 和 Eclipse 并肩十年后,我终于XX IDEA 了https://www.daimajiaoliu.com/daima/60f00c30a498400
单元测试工具
- 单元测试:2021年软件测试工具总结——单元测试工具 https://mp.weixin.qq.com/s/VKRy8cxqsfLUkTBmegHctQ
- 在IDEA里使用JUNIT,https://www.jetbrains.com/help/idea/junit.html
混淆工具
- JavaScript混淆工具:JavaScript Obfuscator Tool https://obfuscator.io/
JVM 工具
- 参考Java Monitoring Tools: https://sematext.com/guides/java-monitoring/
- IDEA Ultimate Profiling tools: https://www.jetbrains.com/help/idea/cpu-profiler.html
- Java VisualVM : https://visualvm.github.io/
- jdk-mission-control: https://www.oracle.com/java/technologies/jdk-mission-control.html
Apache Tomcat 服务器
单元测试
基础知识
好的单元测试的标准
- 单元测试应该在最基本的功能/参数上验证程序的正确性
- 单元测试必须由最熟悉代码的人(程序的作者)来写
- 单元测试过后,机器状态保持不变
- 单元测试要快
- 单元测试应该产生可重复、一致的结果
- 独立性:单元测试的运行通过或者失败不依赖于其他测试,可以人为构造数据
- 单元测试应该覆盖所有代码路径:方法或者函数、语句、分支、条件
- 单元测试应该集成到自动测试的框架中
- 单元测试必须和产品代码一起保存和维护
参考代码
- 如何写测试用例 https://junit.org/junit5/docs/current/user-guide/#writing-tests
- 简单参考代码:https://github.com/junit-team/junit5-samples/tree/r5.8.2/junit5-jupiter-starter-maven/src/test/java/com/example/project
- 常见参考代码 spring mvc showcase中的test目录 https://github.com/spring-projects/spring-mvc-showcase
- 参考代码Unit Testing a Spring Boot REST Controller: https://howtodoinjava.com/spring-boot2/testing/rest-controller-unit-test-example/
- 参考spring网站文档 Testing the Web Layer: https://spring.io/guides/gs/testing-web/ 代码库https://github.com/spring-guides/gs-testing-web
- 参考代码 Testing MVC Web Controllers with Spring Boot and @WebMvcTest :https://reflectoring.io/spring-boot-web-controller-test/
软件项目管理工具
重构
- 参考网站:https://www.refactoring.com/
- 参考网站:https://refactoring.guru/refactoring
- 参考代码:
设计模式
- 书籍: headfirst design pattern 链接: https://pan.baidu.com/s/1XIV5c_6f6PpSVXuGTNTvQw 提取码: w9lu
- 参考网站:https://refactoring.guru/design-patterns
- 代码: https://github.com/bettermorn/SoftwareDevCamps/blob/main/code/HeadFirstDesignPatterns_code102507.zip
- 代码: Code for Head First Design Patterns 2nd Released December 2020 https://github.com/bethrobson/Head-First-Design-Patterns
- 设计模式 代码 https://github.com/kiat/OOP-Design-Patterns
- 思考:用哪些设计模式可以完成规则设计以及策略配置?
Spring Security中的设计模式
- https://www.fatalerrors.org/a/review-of-eight-classic-design-patterns-in-spring-security-framework.html
- 中文参考 https://segmentfault.com/a/1190000023429634
- Template method 模板方法 用户信息认证:AbstractUserDetailsAuthenticationProvider 从数据库中加载用户,默认检验登录凭证:DaoAuthenticationProvider 可参考:https://www.geeksforgeeks.org/template-method-design-pattern/ 和 https://refactoring.guru/design-patterns/template-method
- Strategy 策略 定义登录用户信息存储的方法:SecurityContextHolder session并发管理:AbstractAuthenticationProcessingFilter#doFilter
- Proxy 代理模式 Spring Security 过滤器链接入 Web Filter时,使用了DelegatingFilterProxy
- Adapter 适配器 WebSecurity 和 HttpSecurity一起工作 WebSecurityConfigurerAdapter
- Builder 构建者 构建AuthenticationManager对象,AuthenticationManagerBuilder
- Observer 观察者:用于实现 ApplicationContext 的事件处理功能,如登录成功事件发布,session 销毁事件。Spring 提供了 ApplicationEvent 类和 ApplicationListener 接口启用事件处理。Spring 应用程序中的任何 Bean 实现 ApplicationListener 接口,都会接收到 ApplicationEvent 作为事件发布者推送的消息。事件发布者是主题(Subject) 和实现 ApplicationListener 的 Bean 的观察者(Observer)。例如AbstractAuthenticationProcessingFilter#successfulAuthentication 方法
- Responsibility chain 责任链 过滤器链中的过滤器逐个进行处理请求,过滤器链中的过滤器每个都具有不同的职能并且互不相扰,还可通过 HttpSecurity 动态配置过滤器链中的过滤器(即添加/删除过滤器链中的过滤器)FilterChainProxy$VirtualFilterChain 设计模式参考代码:https://refactoring.guru/design-patterns/chain-of-responsibility/java/example
- Decoration 装饰者 一个请求在通过过滤器链的时候变化调整功能,生产请求的多种类别 HeaderWriterRequest、FirewalledRequest、StrictHttpFirewall和SaveToSessionRequestWrapper
- 所属模块
org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider
org.springframework.security.authentication.dao.DaoAuthenticationProvider
org.springframework.security.core.context.SecurityContextHolder
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
org.springframework.web.filter.DelegatingFilterProxy
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
org.springframework.security.web.FilterChainProxy;
org.springframework.security.web.header.HeaderWriterFilter.HeaderWriterRequest;
org.springframework.security.web.firewall.FirewalledRequest;
org.springframework.security.web.firewall.StrictHttpFirewall;
org.springframework.security.web.context.SaveToSessionRequestWrapper
数据库规范
- SQL 规范:https://dev.mysql.com/doc/internals/en/coding-style.html
- SQL style:https://www.sqlstyle.guide/
- 数据库命名规范:https://github.com/RootSoft/Database-Naming-Convention
- MYSQL Naming Conventions:https://medium.com/@centizennationwide/mysql-naming-conventions-e3a6f6219efe
- 其他说明:http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html
开源代码
- Spring 框架文档 https://docs.spring.io/spring-framework/docs/current/reference/html/
- Open RASP
- Spring Security
- 正式网站:https://spring.io/projects/spring-security
- 代码仓库:https://github.com/spring-projects/spring-security
- 正式文档:https://docs.spring.io/spring-security/reference/
- 快速开始:https://docs.spring.io/spring-security/reference/servlet/getting-started.html
- 学习路线:https://spring.io/projects/spring-security#learn
工具
协作工具
代码版本控制:https://gitee.com/progit/ 以及https://git-scm.com/book/zh/v2
代码规范和IDE插件 Alibaba Java Coding Guidelines pmd implements and IDE plugin
https://github.com/alibaba/p3c
泳道图
泳道图是一种流程图,它划分了流程中谁做什么。 泳道图以游泳池中的泳道为比喻,通过将流程步骤置于特定员工、工作小组或部门的水平或垂直 "泳道 "中,提供了清晰和问责。它显示了这些泳道之间的联系、沟通和交接,它可以用来突出流程中的浪费、冗余和低效。 工具链接:https://www.lucidchart.com/pages/tutorial/swimlane-diagram