objcio / app-architecture

Sample Code of the App Architecture Book
https://www.objc.io/books/app-architecture
2.06k stars 306 forks source link

Violating basic principles in the "One-App-Eight-Architectures" code #1

Closed tomassliz closed 6 years ago

tomassliz commented 6 years ago

In "One-App-Eight-Architectures" project you have created a model directly in a view controller. I understand that for simplification you have chosen this path. But for example in MVVM the view should not know about model. I think that this can be confusing for some people. I know - it's simple example app. But from the whole point of view - this is a book about app architectures so why to violate their basic principles and dependencies and bend them over when you try to teach them?

chriseidhof commented 6 years ago

Thanks for reporting this. There are many things that could be different in that very app (IOU's, type-safety, etc.). The focus is not at all on how the model is created, but how it is used. We decided to take that shortcut for the sake of simplicity!