Giter Site home page Giter Site logo

javadesignpatterns's Introduction

JavaDesignPatterns

Java 设计模式个人代码示例。

面向对象软件设计原则

  1. 单一职责原则(SRP):一个类只负责一项职责。
  2. 开闭原则(OCP):对扩展开放,对修改关闭。
  3. 里氏替换原则(LSP):子类不能重写父类非抽象方法。
  4. 依赖倒置原则(DIP):高层不在直接调用底层模块,而是都依赖于各自的接口。
  5. 接口隔离原则(ISP):不依赖不需要的接口。
  6. 合成复用原则(CARP):不继承而是当做参数输入来实现复用。
  7. 迪米特法则(最少知识原则):参数精确化再输入。

设计模式

创建型设计模式(如何创建对象)

  1. 单例模式 ⭐️
  2. 建造者模式 ⭐️
  3. 简单工厂模式
  4. 工厂方法模式 ⭐️
  5. 抽象工厂模式
  6. 原型模式

结构型设计模式(如何组合对象)

  1. 适配器模式 ⭐️
  2. 代理模式 ⭐️
  3. 装饰器模式 ⭐️
  4. 组合模式
  5. 享元模式
  6. 外观模式
  7. 桥接模式

行为型模式(如何交互对象)

  1. 迭代器模式 ⭐️
  2. 模板方法模式 ⭐️
  3. 策略模式 ⭐️
  4. 责任链模式 ⭐️
  5. 观察者模式 ⭐️
  6. 命令模式
  7. 状态模式
  8. 备忘录模式
  9. 访问者模式
  10. 解释器模式
  11. 中介者模式

javadesignpatterns's People

Contributors

otavia28 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.