Skip to content
Projetos

forax/design-pattern-reloaded

Ver no GitHub

Sobre

Implementation of GoF design patterns using Java 21

Aprendizado e educação

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
0
em 7 dias
0
em 15 dias
0
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

Design Patterns Reloaded

Implementation of some design patterns in Java 21, some of them are from the GoF, others are the one you usually see in programs.

Like most of the GoF patterns, the implementations use delegation instead of inheritance, but also emphasis immutability when necessary.

  • abstract factory abstracts access to several factories
  • adapter to see an object from one interface as one from another interface
  • builder constructs objects by name instead of by position
  • chain of responsibility constructs a pipeline of objects that handle a request
  • command, objects that are actions
  • decorator dynamically adds behavior to an existing object
  • factory abstracts the creation of objects
  • memoizer caches the result of a computation to avoid multiple re-computations of the same value
  • monad wraps multiple disjoint states under a common API
  • observer de-couples codes by pushing the values from an object to another one
  • proxy see decorator
  • singleton see abstract-factory
  • railwayswitch abstracts a cascade of if ... else
  • state delegates API implementation to an internal state object
  • template_method define a behavior with a generic part and a specific part
  • typing, 3 kinds of relations between a static type and a runtime class
  • visitor / pattern matching, specify operations on a hierarchy of types outside that hierarchy

Old materials

I've done a presentation in English at Devoxx 2015

Corresponding slides used for my presentation at ParisJUG in June 2015.

NB: A port exists in Scala

Explore projetos relacionados

Carregando…