Persistiendo que es gerundio
(My Storing story)
Jorge Juan Barroso Carmona
jorge@karumi.com
@flipper83
+JorgeJBarroso
Andro...
Basho. Poet
Karumi is the beauty of ordinary things spoken of in a
simple way.
Offline first
Adam Tornhill
“Offline is not an error, Offline is a fact of
mobile life.”
Alex Feyerke
Adam Tornhill
“Once out of bed, internet and apps are
used almost constantly, peakin during the
daily commute with 70 perc...
Mem Cache
Mem CacheBe careful with OutOfMemories.
Mem Cache
cache2k
DANGER!!!!!
Mem Cache
“There are only two hard things in
Computer Science: cache invalidation and
naming things.”
Phil Karlton
Shared Preferences
Mem CacheA Key value xml file.
Mem Cachecommit vs apply.
Mem CacheAre not thread save.
Mem Cache
Shared preferences has cache.
Be careful with StringSets.
Databases
Mem CacheDon’t Use a sledgehammer to crack a nut.
Mem Cache
Serialize JSON to disk can be an option if
you don’t need queries.
Mem Cache
ORMs as ORMLite is a good solution.
I like ORMLite over GreenDAO and
SugarORM.
Mem Cache
Realm is not an ORM. Not SQL. Fast. Good
choice. Be careful sharing info between
threads.
Network
Mem CacheNetwork is other kind of persistence.
Mem CacheUse Retrofit only if your api is REST.
Content Providers
Mem Cache
The way to share information between
apps and processes.
Mem Cache
It’s not mandatory use a database behind
the content provider. You can use a
MatrixCursor.
Repository pattern
Mem CachePersistence and network invasion.
Mem CacheMinimize duplicate query logic.
Mem Cache
“Use a repository to separate the logic
that retrieves the data and maps it to the
entity model from the busines...
Client
Business
Logic
Data
Mapper
Data
Source
Query
Object
Business
Entity
Persist
Query
Business
Entity Data
Source
Data
...
Data
Mapper
UsersRealmSt
orage
IQuery
UserApiModel
Persist
Query
User
UsersApi
Data
Mapper
Repository
User
findById(id)
Bibliography
They’re the cracks!
Offline first. Alex Feyerke. May 2014. Webdirections
Patterns of Enterprise Application Arc...
Find meI am very social!
jorge@karumi.com
@flipper83
+JorgeJBarroso
Questions?
Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)
of 35

Presistiendo que es gerundio (My storing story)

Exist some ways to persist information on Android, in this talk we show some ways with this pros and cons.
Published on: Mar 4, 2016
Published in: Internet      
Source: www.slideshare.net


Transcripts - Presistiendo que es gerundio (My storing story)

  • 1. Persistiendo que es gerundio (My Storing story) Jorge Juan Barroso Carmona jorge@karumi.com @flipper83 +JorgeJBarroso Android expert
  • 2. Basho. Poet Karumi is the beauty of ordinary things spoken of in a simple way.
  • 3. Offline first
  • 4. Adam Tornhill “Offline is not an error, Offline is a fact of mobile life.” Alex Feyerke
  • 5. Adam Tornhill “Once out of bed, internet and apps are used almost constantly, peakin during the daily commute with 70 percent usage.” Ericsson. Traffic and Market Report, june 2012
  • 6. Mem Cache
  • 7. Mem CacheBe careful with OutOfMemories.
  • 8. Mem Cache cache2k DANGER!!!!!
  • 9. Mem Cache “There are only two hard things in Computer Science: cache invalidation and naming things.” Phil Karlton
  • 10. Shared Preferences
  • 11. Mem CacheA Key value xml file.
  • 12. Mem Cachecommit vs apply.
  • 13. Mem CacheAre not thread save.
  • 14. Mem Cache Shared preferences has cache. Be careful with StringSets.
  • 15. Databases
  • 16. Mem CacheDon’t Use a sledgehammer to crack a nut.
  • 17. Mem Cache Serialize JSON to disk can be an option if you don’t need queries.
  • 18. Mem Cache ORMs as ORMLite is a good solution. I like ORMLite over GreenDAO and SugarORM.
  • 19. Mem Cache Realm is not an ORM. Not SQL. Fast. Good choice. Be careful sharing info between threads.
  • 20. Network
  • 21. Mem CacheNetwork is other kind of persistence.
  • 22. Mem CacheUse Retrofit only if your api is REST.
  • 23. Content Providers
  • 24. Mem Cache The way to share information between apps and processes.
  • 25. Mem Cache It’s not mandatory use a database behind the content provider. You can use a MatrixCursor.
  • 26. Repository pattern
  • 27. Mem CachePersistence and network invasion.
  • 28. Mem CacheMinimize duplicate query logic.
  • 29. Mem Cache “Use a repository to separate the logic that retrieves the data and maps it to the entity model from the business logic that acts on the model. The business logic should be agnostic to the type of data that comprises the data source layer. For example, the data source layer can be a database, a SharePoint list, or a Web service.” Msdn.
  • 30. Client Business Logic Data Mapper Data Source Query Object Business Entity Persist Query Business Entity Data Source Data Mapper Repository
  • 31. Data Mapper UsersRealmSt orage IQuery UserApiModel Persist Query User UsersApi Data Mapper Repository User findById(id)
  • 32. Bibliography They’re the cracks! Offline first. Alex Feyerke. May 2014. Webdirections Patterns of Enterprise Application Architecture. Martin Fowler Domain driven design. Eric J. Evans The Repository Pattern. Msdn Software design patterns. Pedro Vicente Gomez. Droidcon Spain 2013
  • 33. Find meI am very social! jorge@karumi.com @flipper83 +JorgeJBarroso Questions?

Related Documents