Giter Club home page Giter Club logo

design-patterns's Introduction

Design Patterns

These are design patterns in their simplest form. Currently the bold items are ones I have examples for.

More will come later on.

  • abstract_factory - Creates families of related objects.
  • adapter - Lets classes work together that don't have compatible interfaces.
  • builder - Separate construction of complex objects.
  • command - Add parameters to clients with different requets, and undoable operations.
  • composite - Composer objects in a tree structure and handle them individually.
  • decorator - Add more responsibility to objects dynamically.
  • dependency_injection - Easily share "services" across a platform. (DI, aka IoC/Inversion of Control)
  • facade - Makes subsystems easier to use.
  • factory - Creates a single subclass with that are similar.
  • front_controller - Most MVC's and web applications use this pattern.
  • iterator - Access elements of an aggregate object without knowing whats under the hood.
  • mediator - Decouples Objects and Coordinates them together with a middle man (Events, Notifications)
  • memento - No encapsulation, allows you to change an objects internal state
  • multi_inherit - Extend a base class and act as if we can extend other classes for added functionality
  • observer - (aka Publish/Subscribe) One to Many Dependency to notify that an object has changed.
  • prototype - Create new object by cloning from a skeleton of an object.
  • proxy - Placeholder for another object to acccess it.
  • singleton - Only allow one instance for an objects lifespan.
  • state - Alter an object when it changes state.
  • template method - Subclasses can redfine certain steps of without messing up the main structure.
  • visitor - New operations defined without change classes or elements it operates on.

About the Patterns

This is made to understand patterns as simple as possible. So here are a few things to know:

  • Notes are provided in the class.

  • I will not be using namespaces to keep it simple.

  • At the bottom of the class contain examples.

  • The name of the pattern is the name of the class.

  • Classes not requiring Abstract Classes and Interfaces are not included to keep it simple.

  • You would generally do this:

    • In most cases, change the name of the class(es).
    • Put your classes in separate files.

    --

    (c) 2016 Jesse Boyer | MIT License

design-patterns's People

Contributors

codezues avatar jream avatar oliveru 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.