liveBook · Manning

Direct coupling

As explained in High Performance Unity Game Development

An explicit dependency in which one software component directly refers to and relies on another component.

A game board needs to report game over, while one game loop decides what runs next. Direct coupling lets the board call Game explicitly rather than routing that relationship through an interface or event. Game can likewise control when the board is shown, hidden, or ticked. section 5.1.1

if (gameOver)
    Game.Instance.GameOver();

The game-over call makes Board’s dependency on Game visible at the call site. section 5.1.1

This is a deliberate trade-off, not a rule for every component. Direct dependencies can make objects harder to reuse or change independently, but hiding a real orchestration relationship can make data flow harder to follow. Keep the boundary firm: Unity-facing Game, Board, and menus may communicate directly; gameplay Logic must use only its supplied GameData, Balance, and input values, without a singleton or other hidden state. section 5.1.1

How High Performance Unity Game Development covers it

How deep it goes
Explains the reuse trade-off and draws a firm boundary between orchestration code and data-transforming Logic.
Examples
Shows Board calling GameOver through a Game singleton and Game controlling Board and menus.
What you can do after
Evaluate/understand when to couple Unity-facing components directly while keeping gameplay Logic independent of hidden state.
How it connects
Connects direct coupling to game loops, singletons, dependency injection, and deterministic gameplay logic.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of High Performance Unity Game Development. The section links point to the parts of the book it draws on.