MΓ³dulo 15 Β· Modularize with SPM β LecciΓ³n 4 de 4 Β· ~8 min
The composition root
The app target shrinks to a shell
After PawWalkKit, DesignSystem, Bookings, and Live are all packages, what's left in the actual Xcode app target? Almost nothing β a thin shell whose only job is to wire the packages together. It doesn't define models, doesn't define views, doesn't contain business logic. It imports every package it needs and assembles them into a running app.
That shell has a name: the composition root β the one place, at the top of the app, where concrete types get chosen and dependencies get injected into whatever needs them. Everywhere else in the app talks to protocols (WalkRepository from Module 14, not LiveWalkRepository directly); the composition root is the one place that says "here's the real implementation, use this one."