Skip to main content
Handbook/Read/Chapter 43 · Connections

How the Pieces Connect

Share

Share this page

Pass it to someone who needs it.

Key takeaway: Loose connections keep your app changeable

The files in your project are not islands. One file calls another, which calls a third, and the whole app runs on those connections. How tightly the files lean on each other decides everything about change: whether fixing one means touching five, or just one. This chapter shows you how the pieces connect, and why loose connections are what keep an app you can actually change.

4.5.1Files use each other through imports

A file uses another file's code by importing it, pulling in a function or value by name:

import { sendEmail } from "./email" sendEmail("[email protected]")

That one line creates a dependency: this file now needs email to work. Follow the imports across the project and you have mapped how the whole thing hangs together.

Each file imports the next, forming a chain of dependencies.

4.5.2Loose coupling keeps the app changeable

How tightly two files lean on each other is their coupling. Loosely coupled files know as little as possible about each other, so you can change one without the other noticing. Tightly coupled files reach deep into each other, so one change drags the rest along.

Loose is what you want, for one plain reason: at AI speed you change code constantly, and loose connections keep a change local instead of rippling across the app. The Architect part designs for this deliberately; here, the goal is just to see it when you read.

Loose coupling lets you swap a piece; tight coupling reaches into its internals.

4.5.3This is why patterns exist

Keeping connections loose is a solved problem, and the solutions have names. A thin wrapper called an adapter, for instance, sits between your app and an outside service so you can swap that service without the rest of the app noticing. Those named shapes are the next chapter.

Ready prompt
Act as a senior engineer auditing how my code hangs together. Read the project below and map which files import which, so I can see the dependencies at a glance. Then flag the three most tightly coupled spots: files that reach deep into each other, where one change would force changes in several others. For each, name the smallest step that would loosen it. My project:

Do this now: paste the prompt over your project and have the agent map the dependencies and flag the tightest couplings, so you know which parts resist change before you try to change one.

Mahmoud Zalt

Mahmoud Zalt

Software engineer, 16+ yrs · built Sistava.com in 3 months, idea to production, using these methods

Resources
Contribute
Donate

Support my work

A small tip keeps the free work coming.

© 2026 Mahmoud Zalt. Free to read, not to republish.
Copyright & license