Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Data processing components architecture in mobile applications

1,003 views

Published on

Prepared by Vitalii MalaKhovskyi, iOS Engineer at Stanfy for speaking at Mobile Dev Day 2015 in Lviv, Ukraine.

These slides will briefly tell you about 2 most used data access layer designs in mobile applications.

Published in: Mobile
  • Be the first to comment

Data processing components architecture in mobile applications

  1. 1. Data processing components architecture in mobile applications Malakhovskyi Vitalii iOS Developer @
  2. 2. Why?
  3. 3. Can we talk about architecture? OИ
  4. 4. Benefits: - you know what to do - code review - it saves your time - better code
  5. 5. The type of application you are building: Business Logic CRUD Active Record Data Mapper
  6. 6. Active Record
  7. 7. id name surname 1 Vasya Bananoshvili 2 Evgen Lypan
  8. 8. Active Record Instance - create - save - delete - findBy - validate - work - firstName - lastName
  9. 9. Domain Data Presentation View Model
  10. 10. Advantages: - easy to use - easy to implement
  11. 11. Disadvantages: - violates SRP - hard to unit test
  12. 12. Data Mapper
  13. 13. Business Object - firstName - lastName - middleName
  14. 14. Antenna Antenna Adapter Cloud Adapter Magic Adapter Application How it works? Cloud Magic
  15. 15. Data Access Object or Data Mapper Data Mapper Instance Data Source Parser Application < CRUD > JSON Serializer JSON Object JSON Object Object
  16. 16. Database Mapper Network Mapper Mapper with strategy ? Strategy
  17. 17. Magic Mapper Mapper Repository Parser / Serializer Cloud Mapper Antenna Mapper Parser / Serializer Parser / Serializer
  18. 18. Advantages: - separation of concerns - allows easy unit testing
  19. 19. Disadvantages: - adds another layer of abstraction
  20. 20. Conclusion Data mapper better Active Record Active Record better Data mapper
  21. 21. “Architecture is about intent, not frameworks” - Robert C. Martin
  22. 22. Thank you!
  23. 23. Contact me: purpleshirted crimsongf Vitaliy Malakhovskiy
  24. 24. 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?

×