Giter VIP home page Giter VIP logo

designpatterns's Introduction

DesignPatterns

Intro 简介

Design patterns from 《大话设计模式》 and implemented by C# language.

《大话设计模式》 中设计模式总结/C#代码实现,示例代码是以 C# + .NetCore2.0 写的,如果要自己编译请下载安装 .NetCore Sdk

设计模式设计原则

  • 单一职责原则

    对于一个类而言,应该仅有一个引起它变化的原因

    如果一个类承担的职责过多,就等于把这些职责耦合再一起,一个职责的变化可能会削弱或者抑制这个类完全其他职责的能力。这种耦合会导致脆弱的设计,当发生变化时,设计会遭受到意想不到的破坏。

  • 开放-封闭原则

    开放-封闭原则是说软件实体(类、模块、函数等等)应该可以扩展,但是不可修改。

    对于扩展开放,对于更改封闭

  • 依赖倒转原则

    • 高层模块不应该依赖低层模式,两个都应该依赖抽象。
    • 抽象不应该依赖细节,细节应该依赖于抽象。基于接口编程。
  • 里氏代换原则

    子类型必须能够替换掉它们的父类型

  • 迪米特法则

    如果两个类不必彼此通信,那么这两个类就不应当发生直接的相互作用。如果其中一个类需要调用另一个类的某一个方法,可以通过第三者转发这个调用。

    类的结构设计上,每一个类都应当尽量降低成员的访问权限

    类之间的耦合越弱,越有利于复用,一个处在弱耦合的类别修改,不会对有关系的类造成波及

Overview 概览

设计模式大体上可分为三类:

Contact

Contact me: [email protected]

designpatterns's People

Contributors

weihanli avatar

Watchers

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