SWPatterns.com
Home
Patterns
Contribute
  • Liskov Substitution Principle

    principle

    The Liskov Substitution Principle has the following wording: Let $ \phi (x) $ be a property provable about objects $ x $ of type $ T $. Then $ \phi (y) $ should be true for objects $ y $ of type $ S $ where $ S $ is a subtype of $ T $. The principle stems from a base concept that is “An Interface is a …

    Read More
  • Decorator

    GOF structural

    The Decorator pattern enables us to change the behavior of an object by hiding the contained functions and adding new functionalities around it. It is also a common way to avoid the limits of single inheritance by multiple interface implementations (composition over inheritance). Usage This pattern finds its typical …

    Read More
  • Composite

    GOF structural

    The Composite Pattern enables us to collect objects into trees that can be easily explored. The Parent represents the access point to the tree, where it in fact will be a Container, usually. The container will be able to contain other Container objects or Leaf objects. Often the sublcasses or the leaves can be …

    Read More
  • Cargo Cult Programming

    anti_pattern

    Cargo Cult Programming gets its name from the Cargo Cults in Melanesia. The concept is simple: the hope that the same approach to a problem might solve an issue within our system without the understanding of both context and language or libraries. Examples Copy and paste from StackOverflow without understanding of the …

    Read More
  • Observer

    GOF behavioral

    Oberver Pattern enables the broadcast communication between an event subject, that emits changes to its state to all of its observers. Usage Modern day usage is biased by the existence of rx and the reactive libraries across most important languages. Most modern libraries rely on observables and observers to get the …

    Read More
  • Adapter

    GOF Structural

    The adapter aims to be a converter between two specific interfaces: one belonging to “our” side of the application, the other to the library or other tool we need to interact with. This is very important, because it enables us to delay decisions, as the choice of a spcific implementation of the adapter …

    Read More
  • Singleton

    GOF Creational

    Singleton design pattern enables us to guarantee unicity and a single entry point for services and accesses. Tipically it requires the standard contructor to be hidden in order to avoid direct instantiation, but modern frameworks use this pattern in conjunction with other creational patterns in order to ease the …

    Read More

Recent Posts

  • Liskov Substitution Principle
  • Decorator
  • Composite
  • Cargo Cult Programming
  • Observer
  • Adapter
  • Singleton

JAVA 1

GOF 5 STRUCTURAL 3 ANTI_PATTERN 1 BEHAVIORAL 1 CREATIONAL 1

SINGLETON 1
SWPatterns.com

Licenza Creative Commons - Made with ❤️ in Bologna - for info contact me on GitHub or Twitter