Lasagna Code
Updated 2026-07-31
INTRODUCTION
English translation pending.
CORE DEFINITION
Lasagna code is an architecture with too many layers and boundaries drawn too strictly, so that changing one small feature requires traversing controller, service, manager, and data-access layers in sequence. Each layer is internally clean and the separation looks principled, yet the vertical cost of any end-to-end change grows with the number of layers. The same pattern appears in organizations with many reporting levels, where information degrades and decisions slow as they travel upward. Decoupling in one direction creates a new coupling in another.
SCAFFOLDING EFFECT
Reduce cognitive load
- Count the crossings: measure how many layers a typical end-to-end change must pass. - Slice vertically: group code by business capability rather than by technical layer. - Flatten the static parts: merge or skip middle layers that rarely change.
Anchor fast decisions
Strict layering decouples components horizontally while creating a vertical dependency chain. Every change must be threaded through all layers, so coordination cost grows with depth and each hop adds translation, delay, and information loss. Clear structure and maintainable structure are therefore not the same property.
MINIMUM ACTION
In progress 0/1Practice this model in one real situation:
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more
Source support: Explicit
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Spaghetti_codeverified
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