Giter VIP home page Giter VIP logo

designpatterns's Introduction

DesignPatterns

##OO基础

  • 抽象
  • 封装
  • 多态
  • 继承

##面向对象的六大原则

  • 单一职责原则:一个类中应该是一组相关性很高的函数、数据的封装。
  • 开闭原则 : 软件中的对象(类、模块、函数等)应该对扩展开放,对修改关闭。
  • 里氏替换原则 : 所有引用基类的地方必须能透明地使用其子类对象
  • 依赖倒置原则 : 模块间的依赖通过抽象产生,实现类之间不发生直接的依赖关系,其依赖关系是通过接口或抽象类产生的。
  • 接口隔离原则 : 客户端不应该依赖它不需要的接口,类之间的依赖关系应建立在最小的接口上。
  • 最少知识原则 : 一个对象应该对其他对象有最少的了解。

上述原则是一种理想化的情况,实际开发中应朝着这个方向去做。以上原则会在接下来的模式中实践

##具体模式

行为型模式

designpatterns's People

Contributors

silencedut avatar

Watchers

James Cloos avatar  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.