Sequential coupling

Last updated

In object-oriented programming, sequential coupling (also known as temporal coupling) is a form of coupling where a class requires its methods to be called in a particular sequence. This may be an anti-pattern, depending on context.

Methods whose name starts with Init, Begin, Start, etc. may indicate the existence of sequential coupling.

Using a car as an analogy, if the user steps on the gas without first starting the engine, the car does not crash, fail, or throw an exception - it simply fails to accelerate.

Sequential coupling can be refactored with the template method pattern to overcome the problems posed by the usage of this anti-pattern. [1]

Related Research Articles

<i>Design Patterns</i> 1994 software engineering book

Design Patterns: Elements of Reusable Object-Oriented Software (1994) is a software engineering book describing software design patterns. The book was written by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, with a foreword by Grady Booch. The book is divided into two parts, with the first two chapters exploring the capabilities and pitfalls of object-oriented programming, and the remaining chapters describing 23 classic software design patterns. The book includes examples in C++ and Smalltalk.

<span class="mw-page-title-main">Singleton pattern</span> Design pattern in object-oriented software development

In software engineering, the singleton pattern is a software design pattern that restricts the instantiation of a class to a singular instance. One of the well-known "Gang of Four" design patterns, which describe how to solve recurring problems in object-oriented software, the pattern is useful when exactly one object is needed to coordinate actions across a system.

In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a factory method—either specified in an interface and implemented by child classes, or implemented in a base class and optionally overridden by derived classes—rather than by calling a constructor.

In object-oriented programming, the template method is one of the behavioral design patterns identified by Gamma et al. in the book Design Patterns. The template method is a method in a superclass, usually an abstract superclass, and defines the skeleton of an operation in terms of a number of high-level steps. These steps are themselves implemented by additional helper methods in the same class as the template method.

Biometrics are body measurements and calculations related to human characteristics. Biometric authentication is used in computer science as a form of identification and access control. It is also used to identify individuals in groups that are under surveillance.

<span class="mw-page-title-main">IBM Information Management System</span>

The IBM Information Management System (IMS) is a joint hierarchical database and information management system that supports transaction processing.

Duck typing in computer programming is an application of the duck test—"If it walks like a duck and it quacks like a duck, then it must be a duck"—to determine whether an object can be used for a particular purpose. With nominative typing, an object is of a given type if it is declared to be. In duck typing, an object is of a given type if it has all methods and properties required by that type. Duck typing can be viewed as a usage-based structural equivalence between a given object and the requirements of a type. See structural typing for a further explanation of structural type equivalence.

In computer programming, cohesion refers to the degree to which the elements inside a module belong together. In one sense, it is a measure of the strength of relationship between the methods and data of a class and some unifying purpose or concept served by that class. In another sense, it is a measure of the strength of relationship between the class's methods and data themselves.

<span class="mw-page-title-main">Manual transmission</span> Motor vehicle manual gearbox; stick shift

A manual transmission (MT), also known as manual gearbox, standard transmission, or stick shift, is a multi-speed motor vehicle transmission system, where gear changes require the driver to manually select the gears by operating a gear stick and clutch.

In software engineering, behavioral design patterns are design patterns that identify common communication patterns among objects. By doing so, these patterns increase flexibility in carrying out communication.

A semi-automatic transmission is a "theoretical" multiple-speed transmission where part of its operation is automated, but the driver's input would be required to launch the vehicle from a standstill and to manually change gears. Semi-automatic transmissions were exclusively used in motorcycles and are based on conventional manual transmissions or sequential manual transmissions, but use an automatic clutch system. But some semi-automatic transmissions have also been based on standard hydraulic automatic transmissions with torque converters and planetary gearsets.

<span class="mw-page-title-main">Dependency injection</span> Software programming technique

In software engineering, dependency injection is a design pattern in which an object or function receives other objects or functions that it depends on. A form of inversion of control, dependency injection aims to separate the concerns of constructing objects and using them, leading to loosely coupled programs. The pattern ensures that an object or function which wants to use a given service should not have to know how to construct those services. Instead, the receiving 'client' is provided with its dependencies by external code, which it is not aware of. Dependency injection helps by making implicit dependencies explicit and helps solve the following problems:

<span class="mw-page-title-main">Django (web framework)</span> Python web framework

Django is a free and open-source, Python-based web framework that follows the model–template–views (MTV) architectural pattern. It is maintained by the Django Software Foundation (DSF), an independent organization established in the US as a 501(c)(3) non-profit.

Sequential pattern mining is a topic of data mining concerned with finding statistically relevant patterns between data examples where the values are delivered in a sequence. It is usually presumed that the values are discrete, and thus time series mining is closely related, but usually considered a different activity. Sequential pattern mining is a special case of structured data mining.

Victaulic is a developer and manufacturer of mechanical pipe joining systems, and the originator of the grooved pipe couplings joining system. The firm is a global company with 15 major manufacturing facilities, 28 branches, and over 3600 employees worldwide. Currently, its headquarters is located in Easton, Pennsylvania. Director level leadership is helmed by the Bancroft family; Standard Oil heirs and former owners of The Wall Street Journal and Dow Jones & Company. The latter half of Victaulic was controlled by Prince Pierre D'Arenberg of France, known for active involvement in several youth charities along with ties to Ghislaine Maxwell and Jeffrey Epstein.

<span class="mw-page-title-main">Sequential manual transmission</span> Motor transmission

A sequential manual transmission, also known as a sequential gearbox, or a sequential transmission, is a type of non-synchronous manual transmission used mostly for motorcycles and racing cars. It produces faster shift times than traditional synchronized manual transmissions, and restricts the driver to selecting either the next or previous gear, in a successive order.

Template may refer to:

Triple resonance experiments are a set of multi-dimensional nuclear magnetic resonance spectroscopy (NMR) experiments that link three types of atomic nuclei, most typically consisting of 1H, 15N and 13C. These experiments are often used to assign specific resonance signals to specific atoms in an isotopically-enriched protein. The technique was first described in papers by Ad Bax, Mitsuhiko Ikura and Lewis Kay in 1990, and further experiments were then added to the suite of experiments. Many of these experiments have since become the standard set of experiments used for sequential assignment of NMR resonances in the determination of protein structure by NMR. They are now an integral part of solution NMR study of proteins, and they may also be used in solid-state NMR.

In computing, a memory access pattern or IO access pattern is the pattern with which a system or program reads and writes memory on secondary storage. These patterns differ in the level of locality of reference and drastically affect cache performance, and also have implications for the approach to parallelism and distribution of workload in shared memory systems. Further, cache coherency issues can affect multiprocessor performance, which means that certain memory access patterns place a ceiling on parallelism.

References

  1. Andriy, Buday (15 April 2010). "Refactor: Sequential Coupling => Template Method". The Code Project. Retrieved 23 April 2011.