Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M1355

Ravioli Code

Ravioli Code
BusinessHigh supportManagement
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

Opposed to 'spaghetti code' (chaotic and tangled)

Definition

Opposed to 'spaghetti code' (chaotic and tangled). Refers to a structure composed of many small, loosely coupled, self-contained objects (like individual dumplings). This is often the ideal state for microservices architecture. Scaffold use: pursue high cohesion and low coupling. Each module (dumpling) has rich filling inside (cohesion), and the outside is not sticky (low coupling). You can eat one at a time, and if one is bad, it doesn't affect the whole plate.

How to use

Pursue high cohesion and low coupling. Each module (dumpling) has rich filling inside (cohesion), and the outside is not sticky (low coupling). You can eat one at a time, and if one is bad, it doesn't affect the whole plate.

Mechanism

Ravioli code refers to a system composed of a large number of small, well-encapsulated independent modules, but due to excessive fragmentation, it is difficult to grasp the overall context. It is the opposite of spaghetti code and is another extreme.

Practice

In progress 0/1

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Microservices split too finely, the call chain is winding and hard to trace. Utility function libraries where each function is as fragmented as a single line.

Common pitfalls

  • Infinite fragmentation for decoupling increases cognitive load. Mistaking fragmentation for high cohesion.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    en.wikipedia.orghttps://en.wikipedia.org/wiki/Spaghetti_codeZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS