023-《宝淘》项目拆解,细化到每一个步骤

  1. 数据库配置
    1. public static Connection getConnection(){}
  2. xml文件
    1. Spring头文件
    2. Component-scan
  3. Dao层
    1. 实现IAdd接口,AddImpl
    2. 实现IDelete接口,DeleteImpl
    3. 实现IUpdate接口,UpdateImpl
    4. 实现IResult接口,ResultImpl
  4. Service层
    1. new 一个 Dao,然后写四个方法,分别是增删改除
    2. 让刚new出的实例对象去调用这些方法
  5. Classes
    1. Commodity
      1. Milk
      2. Meat
      3. Fruit
      4. Vegetable
  6. Interfaces
    1. IAdd
      1. void add()
    2. IDelete
      1. void delete()
    3. IUpdate 
      1. void update()
    4. IResult
      1. void result()
  7. Test
    1. new一个ClassPathXmlComplation
    2. 获得bean,前提是bean已经通过注解的方式注入,然后强制类型转换为Service的类型
    3. 可以操作

猜你喜欢

转载自blog.csdn.net/qq_31698195/article/details/89840719