"Most writing about app architecture tries to sell you on a specific solution. We believe almost any architecture can work well, if applied correctly." — Chris Eidhof
Today, we're pleased to announce early access to our new book:
📗 App Architecture, by Chris Eidhof, Matt Gallagher, and Florian Kugler.
Born from a "hallway track" conversation with Matt Gallagher, at a conference in early 2017, the book started life with the working title "A Hundred Different Ways to Write an iOS App". Most discussions of app architecture begin with an attempt to sell you on a specific pattern, but we agreed with Matt that any architecture can work well, if applied correctly. What's more, "correctly" is a relative term: it depends on your team, your code base, your experience, and your preferences.
Between Melbourne and Berlin, we set to work.
Instead of advocating for particular patterns, this book lays out the problems all architectures are trying to address: constructing the app's components, communicating between the view and the model, and handling non-model state.
Using a single example app, we implement the same specification in six different architectural patterns, including three commonly used and three experimental patterns (full source code included). We show high-level solutions to these problems, breaking each pattern down to understand how it is implemented at the level of code.
Our three common architectures are Model-View-Controller (MVC), Online-Only MVC, and Model-View-ViewModel + Coordinator (MVVM-C). Common architectures have commonly encountered problems, and we discuss techniques and solutions specific to each pattern.
On the experimental side, we explain View-State-Driven MVC, ModelAdaptor-ViewBinder, and the Elm architecture. By examining these experimental patterns, we extract valuable lessons that can be applied to other patterns, and to existing code bases.
After reading about new architectures, it's tempting to start over, to build with a clean slate. This isn't necessary. Many lessons from our book can be applied to existing applications, in both Swift and Objective-C. You can improve the handling of view-state, use reducers to simplify code, refactor large view controllers, achieve unidirectional data flow in MVC, and much more with the code you already have.
Our book helps you make well-informed decisions about all of these options by showing how different architectures function, and how you can combine different elements to build applications that suit the context of your work.
By the end, you should have a thorough understanding of the commonalities, differences, and trade-offs between architectures, and how you can best implement them to fit your specific needs.
Watch us discuss the book in our introduction video.
We are releasing the book in chapters. The first chapter is available now, with updates and new content added weekly until publication is complete.
Early access also includes:
A private GitHub repository with markdown and PDF versions
Complete source code for all six architectures
The opportunity to file issues and ask questions
An exclusive weekly video Q&A
And our gratitude for your support 🙇
New this year, readers have the option to purchase the book with video, which includes over 8 hours of in-depth discussion covering all six architectural patterns, and additional live-coding of new features. The videos are exclusive to the Ebook + Video edition, and will remain separate from our Swift Talk series.
Early access is digital only, with videos and complete book released in April 2018. A separate paperback edition will follow shortly after.
How to Get Access
Readers can purchase early access directly from our website. Sales and checkout are managed by Gumroad, if you need assistance their help team is on Twitter.
We look forward to hearing your questions!
Best from Berlin, and Melbourne. 🐨
Chris, Matt, and Florian.