Ravioli Code
Updated 2026-07-30
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.
Introduction
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/1Practice this model in one real situation:
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.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Spaghetti_codeverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS