Giter Club home page Giter Club logo

strategydemo's Introduction

StrategyDemo

策略模式  (结合印象笔记中来看)

定义: 策略模式定义了一系列的算法,并将每一个算法封装起来,而且它们还可以相互替换。让算法独立于使用它的客户而独立变化。

主要用来分类算法,在相同的行为抽象下有不同的具体实现策略,这个模式很好的展示了开闭原则,也就是定义抽象,注入不同的实现,从而达到很好的可扩展性。

优点: 结构清晰明了、使用简单直观 耦合度相对较低,扩展方便 操作封装也更为彻底,数据更为安全

缺点: 随着策略的增加,子类也会变得繁多

strategydemo's People

Contributors

carrys17 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.