Object–relational impedance mismatchis a set of conceptual and technical difficulties that are often encountered when a RDBMS is being served by an application program (or multiple application programs) written in an object-oriented programming language or style, particularly because objects or class definitions must be mapped to database tables defined by a relational schema.
Object-oriented programming is based on objects to encapsulate data and behavior. It uses two main techniques for assembling and composing functionality into more complex ones, sub-typing and object composition. Object composition is about combining objects within compound objects, and at the same time, ensuring the encapsulation of each object by using their well-defined interface without visibility of their internals. In this regard, object composition differs from data structures, which do not enforce encapsulation.
In class-based and typed programming languages, types can be divided into composite and non-composite types, and composition can be regarded as a relationship between types: an object of a composite type (e.g. car) "has" objects of other types (e.g. wheel). When a composite object contains several sub-objects of the same type, they may be assigned to particular roles, often distinguished by names or numbers. For example, a Point object might contain 3 numbers, each representing distance along a different axis, such as 'x', 'y', and 'z'. The study of part-whole relationships in general, is mereology.
Composition must be distinguished from subtyping, which is the process of adding detail to a general data type to create a more specific data type. For instance, cars may be a specific type of vehicle: car is a vehicle. Subtyping doesn't describe a relationship between different objects, but instead, says that objects of a type are simultaneously objects of another type. The study of such relationships is ontology.
Object lifetimeis the time between an object's creation and its destruction.
Prototype-based programmingis a style of object-oriented programming in which behaviour reuse (known as inheritance) is performed via a process of reusing existing objects that serve as prototypes.
Class invariantan invariant used for constraining objects of a class.
Инвариант классаинвариант, используемый для ограничения объектов класса.
Mixinis a class that contains methods for use by other classes without having to be the parent class of those other classes.
Fragile base classis a fundamental architectural problem of object-oriented programming systems where base classes (superclasses) are considered "fragile" because seemingly safe modifications to a base class, when inherited by the derived classes, may cause the derived classes to malfunction.
Expression problemis a challenging problem in programming languages that concerns the extensibility and modularity of statically typed data abstractions.
Monkey patchis a technique used to dynamically update the behavior of a piece of code at run-time.
The basic idea is that you create a family of objects via an Abstract Factory. You can add new objects to the family by extending the factory as per usual, but the twist is you can also add new operations by overriding the factory methods to do other things, like evaluation or pretty printing.
Generalised factories for extensibilityAn exploration of extensibility with object algebras in TypeScript and its relation to visitors and typed tagless final interpreters in Haskell.
Object algebras are a simple technique that solves a long-standing problem of extensibility in programming languages, called the expression problem.
The concept of Object Algebras was invented by Bruno C. d. S. Oliveira of the University of Hong Kong and William R. Cook of the University of Texas at Austin.