/design-patterns-in-ruby

Examples of Design Patterns in Ruby

Primary LanguageRuby

Design Patterns in Ruby

Design Patterns

GoF Patterns

  • Adapter: helps two incompatible interfaces to work together
  • Builder: create complex objects that are hard to configure
  • Command: performs some specific task without having any information about the receiver of the request
  • Composite: builds a hierarchy of tree objects and interacts with all them the same way
  • Decorator: vary the responsibilities of an object adding some features
  • Factory: create objects without having to specify the exact class of the object that will be created
  • Interpreter: provides a specialized language to solve a well defined problem of know domain
  • Iterator: provides a way to access a collection of sub-objects without exposing the underlaying representation
  • Observer: helps building a highly integrated system, maintainable and avoids coupling between classes
  • Proxy: allows us having more control over how and when we access to a certain object
  • Singleton: have a single instance of certain class across the application
  • Strategy: varies part of an algorithm at runtime
  • Template: redefines certain steps of an algorithm without changing the algorithm's structure

Object-oriented design concepts

Patterns For Ruby