Coder Social home page Coder Social logo

solid's Introduction

SOLID - Principles that Apply

This page is designated to collect some good resources (IMHO) in order to give an overview over good priciples that should be applied to software design.

  • Intro to SOLID
    • S: Single Responsibility Principle.
    • O: Open/Close Principle.
    • L: Liskov Substitution Principle.
      • link
      • Stack Overflow
      • Circle-Ellipse Problem
      • Moral of the story: model your classes based on behaviours not on properties; model your data based on properties and not on behaviours. If it behaves like a duck, it's certainly a bird.
      • This strongly suggests that inheritance should never be used when the sub-class restricts the freedom implicit in the base class, but should only be used when the sub-class adds extra detail to the concept represented by the base class as in 'Monkey' is-an 'Animal'.
    • I: Interface Segregation Principle
    • D: Dependency Inversion Principle

Running the Code

All the submodules are managed in the same way, which means you can run the code using the same syntax. For example, if you want to see the result of the sample code for Open/Close principle, just run:

python -m python_code.bad.open_close   # See the result of bad implementation
python -m python_code.good.open_close  # See the result of good implementation

Or, you can run python -m python_code --list or python -m python_code -l to see all the available submodules.

However, it is recommanded to see the source code and get an understanding of what the issue is and possible way to solve it.

Enjoy coding!

Other Interesting Articles

solid's People

Contributors

dboyliao avatar mkrump avatar neochar 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.