Giter VIP home page Giter VIP logo

design-patterns-in-php's Introduction

Software Design Principles

Solid Principle

  • Single Responsibility Principle:

    Don’t put all your worker eggs in a single basket. A class should have one reason to change.

  • Open/Closed Principle:

    Don’t change the same class over and over. If you find this happening, abstract out what is changing.

  • Listov Substitution Principle:

    Return the same type in an overridden subclass method as a parent class method. The same applies for a method’s parameters. Be consistent.

  • Interface Segregation Principle:

    Don’t create interfaces with many (more than five) methods. This is a sign that you’re doing too much in one place.

  • Dependency Inversion Principle:

    Rely on interfaces and abstract classes more than concrete classes. This will be more flexible.

Encapsulate What Varies:

Only abstract away things that vary in your application. For example, if a Mailer class will never change, don’t get hung up on writing a lot of abstraction around that: focus on what will change.

Design Patterns:

Creational Behavior Structural
Singleton Strategy Adapter
Factory Method Chains of Responsibility

design-patterns-in-php's People

Contributors

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