Upload
lviv-startup-club
View
182
Download
3
Embed Size (px)
Citation preview
Data processing components architecture
in mobile applications
Malakhovskyi Vitalii iOS Developer @
Why?
Can we talk about architecture?
OИ
Benefits:- you know what to do - code review - it saves your time - better code
The type of application you are building:
Business Logic
CRUD
Active Record Data Mapper
Active Record
id name surname1 Vasya Bananoshvili2 Evgen Lypan
Active Record Instance
- create - save - delete
- findBy - validate - work
- firstName - lastName
Domain
Data
Presentation
View Model
Advantages:- easy to use - easy to implement
Disadvantages:- violates SRP - hard to unit test
Data Mapper
Business Object
- firstName - lastName - middleName
Antenna
Antenna Adapter
Cloud Adapter
Magic Adapter
Application
How it works?
Cloud
Magic
Data Access Object or Data Mapper
Data Mapper Instance
Data Source
Parser
Application
< CRUD >
JSON
Serializer
JSO
N
Obj
ect
JSO
N
Obj
ect
Object
Database Mapper Network Mapper
Mapper with strategy
?
Strategy
Magic Mapper
Mapper
Repository
Parser / SerializerCloud Mapper Antenna Mapper
Parser / Serializer Parser / Serializer
Advantages:- separation of concerns - allows easy unit testing
Disadvantages:- adds another layer of abstraction
Conclusion
Data mapper better Active Record
Active Record better Data mapper
“Architecture is about intent, not frameworks”
- Robert C. Martin
Thank you!
Contact me:
purpleshirted crimsongf Vitaliy Malakhovskiy
1. Martin Fowler - Presentation Domain Data Layering http://martinfowler.com/bliki/PresentationDomainDataLayering.html
2. Active Record vs. Data Mapper http://culttt.com/2014/06/18/whats-difference-active-record-data-mapper/
3. The Clean Architecture http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
What to read?