Software architecture. Letting go of MVC | Dan Ursu | CodeWay 2015

Post on 15-Feb-2017

506 views 1 download

Transcript of Software architecture. Letting go of MVC | Dan Ursu | CodeWay 2015

Software architecture. Letting go of MVCDD, the way to better software by Ursu Dan

Session 4/6 17:00 - 18:00

#Codeway

Dan Ursu, iOS Developer Yopeso

MVC is a delivery mechanism. Not an application architecture

Models are NOT business objects

But everyone said MVC* MVC for delivery. But what do we use

for an app architecture?

What is architecture?

Architectural decisions: - Spring - My SQL - Web System - Python - TomCat web server - Eclipse with it’s plugins

“Architecture is a set of irrevocable decisions which make the foundation of that project”

Architecture screams it’s intention at you

Q: So then, how should a scalable Architecture look like?

A: A good architecture is based on Use Cases.

The use case is agnostic of the delivery mechanism

So many objects?

Wait, isn’t architecture the Database and the frameworks?A: If i show you a system which has a database in it’s center, what will that architecture tell you? What does the system do?

Ok, ok reasonable. But systems do have databases. Where in your Use Case architecture do you put the database?

A: The Database is a detail, an annoying but present detail. The database is abstracted and used by Use Cases.

Ok, i’m lost. How does this all look when combined?Use Cases(Interactors) are at the center. They do the real work using the

network, the database and entities. Everything else is a detail.

Aha! You forgot about MVC. No, not really. MVC jut asks the Interactor to do the heavy work and waits

for it’s response.

Sir, it’s Wednesday and you didn’t say a word about iOS.

Ok. So here is an iOS app architecture for you. Based on Uncle Bob’s architecture. Meet VIPER. Completely TDDoable.

*Sigh* Like I didn’t see enough diagrams already…

Demo

More Information

Original Use Case Architecture presentationhttps://cleancoders.com/episode/clean-code-episode-7/show

Code sample for Viper Architecture http://www.objc.io/issue-13/viper.html https://github.com/mutualmobile/VIPER-TODO