Get Down with ALA, a Zero-Coupled Architecture

Applying John Spray's Abstraction Layered Architecture to Elixir web apps, and more.

My motivation is to dabble with ALA myself and to express it in a compact form for functional programming (later OO) and provide tooling and templates, to help others to try and evaluate it as a distinct architectural choice. I'm not saying it's a good or the best way, just a way that intrigues me, and is compatible with some other software principles I find useful or appealing.

Exploring ALA yourself — a web app, a design, a tool, an analysis, or just thoughts? Add it to Awesome ALA, a community list where anyone can share links to their own explorations.

This is a single-topic site. It explores code architecture ideas from John Spray's Abstraction Layered Architecture (ALA), an online book (with C# code examples in his GitHub), as applied to real programming languages and applications, mixed with some of my own preferences and directions of curiosity. It starts with the Elixir programming language and Phoenix LiveView web apps.

Spray's argument, briefly: software degrades into a big ball of mud because of coupling, where modules come to depend on their peers and on things more specific than themselves, and no amount of layering-by-containment removes it. ALA's target is specifically design-time coupling, the dependencies written into the source, where one module's code names and relies on another. It drives those to zero between peers, permitting a dependency only downward, from a concrete piece to a more abstract, more stable one, so in that sense the code is strictly zero-coupled. What it does not forbid is run-time coupling: while the program runs, abstractions still exchange data and events, but only through wires connected in a higher layer, so two peers interact without either one's source knowing the other exists. Zero-coupled at design time, fully connected at run time. Spray claims this buys what object-oriented, layered, hexagonal, and clean-architecture approaches aim at but reach less completely: abstractions that are reusable, replaceable, and testable in isolation; code you can understand a piece at a time; changes that stay local; and a top layer that reads like the requirements. Those claims are his. Testing how far they hold in Elixir is the point of this site.

Introduction to ALA

Building from Scratch with ALA

Some ALA Reference Web App Designs