Java参考学习资源 - bettermorn/ACMWDevHubPPT GitHub Wiki

Java Web应用开发

https://github.com/bettermorn/ACMWDevHubPPT/wiki/%E5%9F%BA%E4%BA%8EJava%E7%9A%84Web%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97

软件工艺

学习书单

学习网站及参考

疑问解答

Java基础知识

代码规范参考知识

质量监测指标

指标体系

MOOD Metrics for Object-Oriented Design

  • 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

cyclomatic complexity

程序的圈复杂度()是对各个独立的逻辑路径的测量。同样,它也确定了以确保每个程序的语句至少执行一次所需的测试用例数量(当然,采用巧妙的测试数据,在用例数量较少的情况下也可以实现同样的覆盖度)。直观地说,我们可以推出只包含一个语句序列的程序的圈复杂度为1。每个能影响程序流程的逻辑成分(理论上被称为谓词),例如if、while和for的参数,都会给该值加1。

参考面试题:

面试题包括面向对象、Spring相关知识、数据类型、异常以及try catch、线程、Java虚拟机原理、IO操作

面向对象

CS0150 is one of the introductory Computer Science courses offered at Brown University. https://cs.brown.edu/courses/cs015/

Java工具类信息

IDE

单元测试工具

混淆工具

JVM 工具

Apache Tomcat 服务器

单元测试

基础知识

好的单元测试的标准

  • 单元测试应该在最基本的功能/参数上验证程序的正确性
  • 单元测试必须由最熟悉代码的人(程序的作者)来写
  • 单元测试过后,机器状态保持不变
  • 单元测试要快
  • 单元测试应该产生可重复、一致的结果
  • 独立性:单元测试的运行通过或者失败不依赖于其他测试,可以人为构造数据
  • 单元测试应该覆盖所有代码路径:方法或者函数、语句、分支、条件
  • 单元测试应该集成到自动测试的框架中
  • 单元测试必须和产品代码一起保存和维护

参考代码

软件项目管理工具

重构

设计模式

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


数据库规范

开源代码

  1. Spring 框架文档 https://docs.spring.io/spring-framework/docs/current/reference/html/
  2. Open RASP
  1. Spring Security

工具

协作工具

代码版本控制: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

UML