A scene groups a few closely related actions into a focused narrative unit. It unfolds in a specific context and leads to one distinct outcome, keeping one dominant plot in view. section 2.3.4
Shape a scene by balancing three practical concerns:
- Split a method when its length makes the sequence difficult to follow, but do not shorten code mechanically when a longer form reduces cognitive load. section 2.3.5
- Keep the scene’s responsibility coherent; move narrower mechanics into action-level methods and broader coordinated goals into chapters. section 2.3.4 section 2.3.5
- Extract cognitively heavy conditions or deep nesting into clearly named methods when the sequence becomes hard to scan. section 2.3.5
Email validation as one scene
A scene-level method can express one meaningful moment while delegating its mechanics: validateEmail first validates that the address is present, then checks its uniqueness. The caller reads the intent without absorbing each low-level operation. section 2.3.4
Figure 2.2 Hierarchical structure of a story
Use the hierarchy to navigate from individual actions to scenes, chapters, and the table of contents, choosing the level that keeps the narrative legible. section 2.3.4
