Better Programming

Advice for programmers.

Follow publication

Member-only story

Understand Temporal Coupling in Code

Chunting Wu
Better Programming
Published in
6 min readFeb 14, 2022

--

Photo by Florian Olivo on Unsplash

Generally, there are three types of component coupling.

  1. Afferent coupling: The task of the A component must depend on the implementation of B, C, and D.

2. Efferent coupling: After the task of the A component is completed, B, C, D must be executed.

3. Temporal coupling: After the task of the A component is completed, B and C must be executed. In addition, B is earlier than C.

The components mentioned here can be source code level, module level or even service level based on the granularity.

In this article we will dive into the temporal coupling in particular, because this is the most common and most overlooked pitfall. First we describe in Node.js as follows:

--

--

Chunting Wu
Chunting Wu

Written by Chunting Wu

Architect at SHOPLINE. Experienced in system design, backend development, and data engineering.

Write a response