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

18
Software architecture. Letting go of MVC DD, the way to better software by Ursu Dan Session 4/6 17:00 - 18:00 #Codeway Dan Ursu, iOS Developer Yopeso

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

Page 1: 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

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

MVC is a delivery mechanism. Not an application architecture

Models are NOT business objects

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

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

for an app architecture?

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

What is architecture?

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

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”

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

Architecture screams it’s intention at you

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

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

A: A good architecture is based on Use Cases.

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

The use case is agnostic of the delivery mechanism

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

So many objects?

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

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?

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

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.

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

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.

Page 13: Software architecture. Letting go of MVC | Dan Ursu | CodeWay 2015
Page 14: Software architecture. Letting go of MVC | Dan Ursu | CodeWay 2015

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

for it’s response.

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

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.

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

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

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

Demo

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

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