没有合适的资源?快使用搜索试试~ 我知道了~
首页App Architecture iOS Application Design Patterns in Swift
资源详情
资源评论
资源推荐

By Chris Eidhof, Matt Gallagher, and Florian Kugler

Version 1.0 (May 2018)
© 2018 Kugler und Eidhof GbR
All Rights Reserved
For more books, articles, and videos visit us at https://www.objc.io
Email: mail@objc.io
Twitter: @objcio

About This Book 5
1 Introduction 13
Application Architecture 13
Model and View 13
Applications Are a Feedback Loop 15
Architectural Technologies 17
Application Tasks 17
2 Overview of Application Design Patterns 20
Model-View-Controller 21
Model-View-ViewModel+Coordinator 24
Model-View-Controller+ViewState 29
ModelAdapter-ViewBinder 32
The Elm Architecture 35
Networking 38
Patterns Not Covered 39
3 Model-View-Controller 42
Exploring the Implementation 43
Testing 57
Discussion 61
Improvements 63
Conclusion 76
4 Model-View-ViewModel+Coordinator 78
Exploring the Implementation 80
Testing 96
Discussion 100
MVVM with Less Reactive Programming 101
Lessons to Be Learned 107

5 Networking 111
Networking Challenges 112
Controller-Owned Networking 112
Model-Owned Networking 118
Discussion 123
6 Model-View-Controller+ViewState 126
View State as Part of the Model 126
Exploring the Implementation 130
Testing 143
Discussion 149
Lessons to Be Learned 151
7 ModelAdapter-ViewBinder 159
Exploring the Implementation 161
Testing 177
Discussion 183
Lessons to Be Learned 187
8 The Elm Architecture 195
Exploring the Implementation 196
The Elm Architecture Framework 209
Testing 216
Discussion 221
Lessons to Be Learned 223

About This Book
This book is about application architecture: the structures and tools used to bring
smaller components together to form an application. Architecture is an important topic
in app development since apps typically integrate a large number of diverse
components: user events, network services, file services, audio services, graphics and
windowing services, and more. Integrating these components while ensuring state and
state changes are reliably and correctly propagated between them requires a strong set
of rules about how the components should interoperate.
Application Design Patterns
Sets of repeatedly applied design rules are called design patterns, and in this book, we
will present an application that’s fully implemented in five major application design
patterns, which range from well established to experimental. These are:
→ Model-View-Controller (MVC)
→ Model-View-ViewModel+Coordinator (MVVM-C)
→ Model-View-Controller+ViewState (MVC+VS)
→ ModelAdapter-ViewBinder (MAVB)
→ The Elm Architecture (TEA)
The abstract block diagrams commonly used to describe application design patterns at
the highest level do little to describe how these patterns are applied to iOS applications.
To see what the patterns are like in practice, we’ll take a detailed look at typical program
flows in each of them.
We’ll also look at a range of different patterns to show that there is no single best
approach for writing programs. Any of the patterns could be the best choice depending
upon the goals, desires, and constraints of you, your program, and your team.
Application design patterns are not just a set of technical tools; they are also a set of
aesthetic and social tools that communicate your application to you and to other readers
of your code. As such, the best pattern is often the one that speaks most clearly to you.
剩余225页未读,继续阅读


















安全验证
文档复制为VIP权益,开通VIP直接复制

评论1