JAVA复习大纲

1.lambda表达式的合理运用

2.常用设计模式的灵活运用

3.数据库连接池

4.多线程,线程池(乐观锁,悲观锁,事务,事务隔离级别)

5.应用安全:过滤器过滤非法参数,幂等性

6.常用组件特性:redis  mongodb  rabbitmq ,nginx

7.常用开发工具:ecilpse, ide,webstorm,maven  git   svn  jenkins  xshell  xftp tomcat 

8.jvm结构,jvm原理

9.mysql 存储引擎,索引类型,索引创建原则,索引如何保存,索引结构,  

10.数据库设计 三范式,数据库字段预留, 版本号字段的设计,物理删除,逻辑删除的合理运用       注意:逻辑删除与唯一索引的冲突

11.巧妙定时器按天统计:  往redis存放当前日期,统计时查询是否存在该key

12.通用接口的设计(反射的运用,减少if else 使用)

1.定义类路径

    static {
        componentMap.put("lecturer", "com.jst.base.common.service.impl.statistic.LecturerRankComponent");
        componentMap.put("employee", "com.jst.base.common.service.impl.statistic.EmployeeRankComponent");
        componentMap.put("enterprise", "com.jst.base.common.service.impl.statistic.EnterpriseRankComponent");
        componentMap.put("field", "com.jst.base.common.service.impl.statistic.FieldRankComponent");

 }
 

2.参数控制调用的类

    @RequestMapping("/getRankStatistic")
    public String rankStatistic(RankStatisticRequestVO record, HttpServletRequest request) {

        UserInfoDO userInfo = RedisUtil.getUserInfo(redisService, request);

        if (userInfo == null) {
            return Results.jiami(Results.error(CodeMsg.USER_NOT_LOGIN));
        }
        Object obj=new Object();
        try {
            Class<?> clazz = Class.forName(componentMap.get(record.getRoleType()));
            Object proxyObject = applicationContext.getBean(clazz);
            Method method = getMethod(proxyObject.getClass(), "rankStatistic");
            obj=method.invoke(proxyObject, userInfo,record, request);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return obj.toString();

    }


    private Method getMethod(Class proxyObject, String methodStr) {
        Method[] methods = proxyObject.getMethods();
 
        for(Method method : methods) {
            if(method.getName().equalsIgnoreCase(methodStr)) {
                return method;
            }
        }
 
        return null;
    }

3. 实现组件写法

 

13.监听的方式解耦(日志,短信等独立功能)

14.项目优化流程:

1.应用部署环境层面(虚拟机参数,服务器参数,网络带宽等),

2.代码层面 限制单位时间接口访问次数, 多层for循环优化, 统计类做缓存及队列优化,  上传等接口同步异步处理, 单接口对数据库的循环访问改为批量操作.

3.接口设计,通用性,巧妙运用 设计模式以及反射

 4.数据库优化(sql层面优化, 索引的合理添加,执行计划的使用,慢查询日志的开启)

15.高并发的项目设计,前后端分离,分布式部署,数据库主从以及分库分表,队列,缓存组件的使用

16.mybatisPlus 使用注意   查询 or的写法:

                wrapper.and(wr -> wr.eq("enterpriseId", trainingInfo.getEnterpriseId()).or().eq("authorId",record.getLecturerId()));

             //  select * from t where . 'sex'=0 and ('enterpriseId'=1 or  'authorId'=2)

                wrapper.eq("enterpriseId", trainingInfo.getEnterpriseId()).or().eq("authorId",record.getLecturerId()); 

          // select * from t where . 'sex'=0 and  'enterpriseId'=1 or  'authorId'=2

17.aba问题 (数据库增加版本号)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值