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 MoreThe 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 MoreThe 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 MoreCargo 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 MoreOberver 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 MoreThe 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 MoreSingleton 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