Skip to content

在个人自学阶段的23种设计模式代码的全部实现,全部使用Java编写,其中还包括各个设计模式在源码中的使用,每种设计模式都举了一个简单的小例子来进行实现,并加以注释。

Notifications You must be signed in to change notification settings

IronmanJay/DesignPattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DesignPattern

在个人自学阶段的23种设计模式代码的全部实现,全部使用Java编写,其中还包括各个设计模式在源码中的使用,每种设计模式都举了一个简单的小例子来进行实现,并加以注释

包名解释

一、DesignPattern

1.1 创建型模式

  1. Singleton-------->单例模式
  2. Factory-------->工厂方法模式、抽象工厂模式
  3. Builder-------->建造者模式
  4. Prototype-------->原型模式

1.2 结构型模式

  1. Adapter-------->适配器模式
  2. Bridge-------->桥接模式
  3. Composite-------->组合模式
  4. Decorator-------->装饰模式
  5. Facade-------->外观模式
  6. FlyWeight-------->享元模式
  7. Proxy-------->代理模式

1.3 行为型模式

  1. Visitor-------->访问者模式
  2. Template-------->模板模式
  3. Strategy-------->策略模式
  4. State-------->状态模式
  5. Observer-------->观察者模式
  6. Memento-------->备忘录模式
  7. Mediator-------->中介者模式
  8. Iterator-------->迭代器模式
  9. Iterpreter-------->解释器模式
  10. Command-------->命令模式
  11. ResponsibilityChain-------->责任链模式

1.4 设计模式原则(Principle)

  1. demeter-------->迪米特法则
  2. Inversion-------->依赖倒转原则
  3. Liskov-------->里氏替换原则
  4. Ocp-------->开闭原则
  5. segregation-------->接口隔离原则
  6. singleresponsibility-------->单一职责原则

二、JDKSrc

  1. Builder-------->建造者模式在StringBuilder中的使用
  2. Composite-------->组合模式在HashMap中的使用
  3. Decorator-------->装饰者模式在IO流中的使用
  4. Factory-------->工厂模式在Calendar中的使用
  5. FlyWeight-------->享元模式在Integer中的使用
  6. Iterator-------->迭代器模式在Iterator中的使用
  7. Observer-------->观察者模式在Observable中的使用
  8. Singleton-------->单例模式在Runtime中的使用
  9. Strategy-------->策略模式在Comparator中的使用
  10. MyBatis-------->MyBatis中设计模式的使用
  11. Spring-------->Spring中设计模式的使用

About

在个人自学阶段的23种设计模式代码的全部实现,全部使用Java编写,其中还包括各个设计模式在源码中的使用,每种设计模式都举了一个简单的小例子来进行实现,并加以注释。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published