More often than not the initial database design works fine at the beginning, however as time goes on, changes are made and the data grows. Bottlenecks appear, you pick up a bunch of slow queries or you run out of storage.
A lambda function is an anonymous PHP function that can be stored in a variable and passed as an argument to other functions or methods. A closure is a lambda function that is aware of its surrounding context.
To build a chain of objects to handle a call in sequential order. If one object cannot handle a call, it delegates the call to the next in the chain and so forth.
For a given language, it defines the representation of its grammar as "No Terminal Expression" and "Terminal Expression", as well as an interpreter for the sentences of that language.
This pattern provides an easy way to decouple many components working together. It is a good alternative to Observer IF you have a "central intelligence", like a controller (but not in the sense of the MVC).
It provides the ability to restore an object to it's previous state (undo via rollback) or to gain access to state of the object, without revealing it's implementation (i.e., the object is not required to have a function to return the current state).
Usage of this pattern allows class functionality to be dynamically extended in runtime, helping to prevent code rot and ensuring functionality is decoupled.
Encapsulate varying behaviour for the same routine based on an object's state. This can be a cleaner way for an object to change its behaviour at runtime without resorting to large monolithic conditional statements.
To separate strategies and to enable fast switching between them. Also this pattern is a good alternative to inheritance (instead of having an abstract class that is extended).
The Visitor Pattern lets you outsource operations on objects to other objects. The main reason to do this is to keep a separation of concerns. But classes have to define a contract to allow visitors.
The object pool pattern is a software creational design pattern that uses a set of initialised objects kept ready to use – a "pool" – rather than allocating and destroying them on demand
To translate one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces by providing its interface to clients while using the original interface.
A Data Access Layer that performs bidirectional transfer of data between a persistent data store (often a relational database) and an in memory data representation (the domain layer).
To minimise memory usage, a Flyweight shares as much as possible memory with similar objects. It is needed when a large amount of objects is used that don't differ much in state.
To implement a central storage for objects often used throughout the application, is typically implemented using an abstract class with only static methods (or using the Singleton pattern).
Also known as the Ports and Adapters architecture. This architecture clearly separates core logic from the input and output infrastructure, dividing the system into loosely-coupled interchangeable components. Throughout the years, it grew in popularity to become one of the most widely recognised types of software architecture.