Giter Club home page Giter Club logo

design-patterns's Introduction

Design Patterns

Visitor pattern

  • The operation that gets performed on each element of an object structure is always delegated to the Visitor object.

State pattern

  • An object delegates the request to a State object that represents its current state.

Strategy pattern:

  • An object delegates a specific request to an object tha represents a strategy for carrying out the request.

Mediator pattern:

  • Introduces an object to mediate communication between other objects.

Notes

Composing behavior in object-oriented system can be achieved by:

  • class inheritance: allows providing default implementations for operations and lets subclasses override them
  • object composition: change the behaviour composed at run-time
  • parameterized types (generics or templates): change the types that a class can use

Suggestions based on what you are building:

  • if you are building an application program such as a document editor or spreadsheet, the internal reuse, maintainability and extension come as high priorities.

General information

Toolkit vs Framework:

  • Toolkit: A set of related and reusable classes designed to provide useful, general-purpose functionality. Ex.: A set of collection for lists, stacks or other data structures. They do not impose a particular design on your application, just provide functionality that can help your app do its job.

  • Framework: A set of cooperating classes that make up a reusable design for a specific class of software. Eg.: Building financial modeling applications or music composition or mechanical CAD. The framework dictates the architecture of your application by defining the overall structure, its partitioning into classes and objects, the key responsibilities thereof, how classes and objects collaborate, and the thread of control. Frameworks emphasize design reuse over code reuse.

    • Frameworks often pose a steep learning curve that must be overcome before they're useful.

design-patterns's People

Contributors

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