Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Limpiando espero
la arquitectura
que yo quiero
Clean Architecture for Android
José Manuel Pereira García (JMPergar)
ANDROI...
José Manuel Pereira García
(JMPergar)
ANDROID TECH LEAD
www.jmpergar.com
@JMPergar
jm.pereira.g@gmail.com
+JoseMPereira
We are hiring!
https://www.jobandtalent.com/es/careers
Objetivos
y premisas
Evitar el efecto L’Oréal
(No elegir una arquitectura “porque yo lo valgo”)
Soporte a correctivos
Soporte a correctivos
Soporte a evolutivos
Soporte a correctivos
Soporte a evolutivos
Extensible
Soporte a correctivos
Soporte a evolutivos
Extensible
Testable
The best approach when you apply “Clean
Architecture” is to use common sense
by Rafael Aguilar (@Rais38)
The best approach when you apply “Clean
Architecture” is to use common sense
by Rafael Aguilar (@Rais38)
Todas las arquite...
single responsibility principle
All you need is SRP
Separando
problemas
Matando la God Activity
VIEW
Activity
Fragment
Widget
...
View
Interface
Todo lo
demás
Matando la God Activity
Render Methods,
View Lifecycle and
View Configuration
Todo lo
demás
View
Interface
Lógica de vista y Navegación
VIEW
PRESENTER
View Logic
Navigation
ROUTER
View
Interface
Navigation LAUNCHER
Implementation...
Lógica de vista y Navegación
VIEW
PRESENTER
View Logic
Navigation
ROUTER
View
Interface
Navigation LAUNCHER
Implementation...
Lógica de vista y Navegación
VIEW
Procesar eventos de vista
Solicitar datos
Controlar la vista
Guardar estado de la vista
...
View Presenter Domain
Flujo de llamadas
Click : Refresh Button
Active Loading Request Data
Response Error
Render Empty Sta...
Para solucionar el problema de los giros de pantalla
mantener en la vista la referencia al Presenter
entre cambios de conf...
Para solucionar el problema de los giros de pantalla
mantener en la vista la referencia al Presenter
entre cambios de conf...
abstract public class PresenterFragment<K extends PresenterFragment, T>
extends Fragment implements Presenter<T> {
@Overri...
Lógica de negocio
PRESENTER
ROUTER
InterfaceInterface
UseCasesInterface
INTERACTOR
INTERACTOR
INTERACTOR
Interface
Todo lo...
Lógica de negocio
PRESENTER
ROUTER
InterfaceInterface
Validación de datos
Obtención de datos
Procesamiento de datos
Interf...
Lógica de negocio
InterfaceInterface
Interface
Todo lo
demás
Foreground Tasks (Synchronous Interactors)
Interactor >> Runn...
Lógica y proveedores de datos
Repository
Interface
REPOSITORY
INTERACTOR
INTERACTOR
INTERACTOR
DataSource
Interface
DataSo...
Lógica y proveedores de datos
Políticas de cacheo
Lógica de origen de datos
INTERACTOR
INTERACTOR
INTERACTOR
DataSource
In...
¿Juntar Interactors y Repositories?
Clean
Architecture
Activity
Fragment
Widget
...
View Logic
(Presenter)
PAGES
ViewInterface
UseCases
Repository
Interface
INTERACTOR
INTERACTO...
ENTIDADES
UI
PRESENTERS
INTERACTORS
REPOSITORIES
DATASOURCES
ENTIDADES
UI
PRESENTERS
INTERACTORS
REPOSITORIES
DATASOURCES
AbstraccionesConcreciones Concreciones
ENTIDADES
UI
PRESENTERS
INTERACTORS
REPOSITORIES
DATASOURCES
AbstraccionesConcreciones Concreciones
JAVAANDROID ANDROID
ENTIDADES
UI
PRESENTERS
INTERACTORS
REPOSITORIES
DATASOURCES
AbstraccionesConcreciones Concreciones
JAVAANDROID ANDROID
Re...
ENTIDADES
UI
PRESENTERS
INTERACTORS
REPOSITORIES
DATASOURCES
AbstraccionesConcreciones Concreciones
JAVAANDROID ANDROID
Re...
¿Que hemos conseguido?
● Arquitectura independiente del framework, UI y proveedores de
datos.
● Una arquitectura modular h...
EN RESUMEN
Aplica el sentido común
No dejes de ser autocrítico y crítico
Divide y vencerás
Show me the code!
https://github.com/android10/Android-CleanArchitecture
https://github.com/PaNaVTEC/Clean-Contacts
Gente con aura de tochez
que sabe de arquitectura
@pedro_g_s @PaNaVTEC@sefford
@Akelael @fernando_cejas @flipper83
Saúl Dí...
Referencias
Fernando Cejas - Architecting Android…The clean way?
http://fernandocejas.com/2014/09/03/architecting-android-...
Preguntas
José Manuel Pereira García
(JMPergar)
ANDROID TECH LEAD
www.jmpergar.com
@JMPergar
jm.pereira.g@gmail.com
+JoseM...
GRACIAS
Prochain SlideShare
Chargement dans…5
×

Limpiando espero la arquitectura que yo quiero

5 485 vues

Publié le

Paso a paso explico como estructurar nuestros proyectos para ir solucionando y separando problemas para ver finalmente como la foto general de lo que hemos montado coincide con los principios de Clean Architecture y como esto nos ayuda a construir un software más solido, extensible y refactorizable.

Publié dans : Logiciels
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy &amp; Proven Way to Build Good Habits &amp; Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici

Limpiando espero la arquitectura que yo quiero

  1. 1. Limpiando espero la arquitectura que yo quiero Clean Architecture for Android José Manuel Pereira García (JMPergar) ANDROID TECH LEAD
  2. 2. José Manuel Pereira García (JMPergar) ANDROID TECH LEAD www.jmpergar.com @JMPergar jm.pereira.g@gmail.com +JoseMPereira
  3. 3. We are hiring! https://www.jobandtalent.com/es/careers
  4. 4. Objetivos y premisas
  5. 5. Evitar el efecto L’Oréal (No elegir una arquitectura “porque yo lo valgo”)
  6. 6. Soporte a correctivos
  7. 7. Soporte a correctivos Soporte a evolutivos
  8. 8. Soporte a correctivos Soporte a evolutivos Extensible
  9. 9. Soporte a correctivos Soporte a evolutivos Extensible Testable
  10. 10. The best approach when you apply “Clean Architecture” is to use common sense by Rafael Aguilar (@Rais38)
  11. 11. The best approach when you apply “Clean Architecture” is to use common sense by Rafael Aguilar (@Rais38) Todas las arquitecturas caducan Martin Fowler - SacrificialArchitecture http://martinfowler.com/bliki/SacrificialArchitecture.html
  12. 12. single responsibility principle All you need is SRP
  13. 13. Separando problemas
  14. 14. Matando la God Activity VIEW Activity Fragment Widget ... View Interface Todo lo demás
  15. 15. Matando la God Activity Render Methods, View Lifecycle and View Configuration Todo lo demás View Interface
  16. 16. Lógica de vista y Navegación VIEW PRESENTER View Logic Navigation ROUTER View Interface Navigation LAUNCHER Implementation Navigation Launcher Interface Interface Todo lo demás Opcional
  17. 17. Lógica de vista y Navegación VIEW PRESENTER View Logic Navigation ROUTER View Interface Navigation LAUNCHER Implementation Navigation Launcher Interface Interface Todo lo demás Opcional
  18. 18. Lógica de vista y Navegación VIEW Procesar eventos de vista Solicitar datos Controlar la vista Guardar estado de la vista goTo goToNext back View Interface startActivity fragment transactions Interface Todo lo demás Opcional PAGE
  19. 19. View Presenter Domain Flujo de llamadas Click : Refresh Button Active Loading Request Data Response Error Render Empty State Error Click : Retry Active Empty State Loading Request Data Response DataDisable Loading Disable Loading Render Data
  20. 20. Para solucionar el problema de los giros de pantalla mantener en la vista la referencia al Presenter entre cambios de configuración gracias a: onRetainCustomNonConfigurationInstance getLastCustomNonConfigurationInstance Sólo en la Activity
  21. 21. Para solucionar el problema de los giros de pantalla mantener en la vista la referencia al Presenter entre cambios de configuración gracias a: onRetainCustomNonConfigurationInstance getLastCustomNonConfigurationInstance Sólo en la Activity
  22. 22. abstract public class PresenterFragment<K extends PresenterFragment, T> extends Fragment implements Presenter<T> { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); } abstract public void init(K presenter); } private void initializePresenter() { FragmentManager fm = getFragmentManager(); MyPresenter retainedMyPresenter = (MyPresenter) fm.findFragmentByTag(MyPresenter.class.getName()); if (retainedMyPresenter == null) { fm.beginTransaction().add( mMyPresenter, MyPresenter.class.getName()).commit(); } else { retainedMyPresenter.init(mMyPresenter); mMyPresenter = retainedMyPresenter; } }
  23. 23. Lógica de negocio PRESENTER ROUTER InterfaceInterface UseCasesInterface INTERACTOR INTERACTOR INTERACTOR Interface Todo lo demás
  24. 24. Lógica de negocio PRESENTER ROUTER InterfaceInterface Validación de datos Obtención de datos Procesamiento de datos Interface Todo lo demás UseCasesInterface
  25. 25. Lógica de negocio InterfaceInterface Interface Todo lo demás Foreground Tasks (Synchronous Interactors) Interactor >> Runnable ThreadExecutor >> ThreadPoolExecutor PostExecutionThread >> MainThread Handler UseCasesInterface INTERACTOR INTERACTOR INTERACTOR PRESENTER ROUTER Background Tasks (Asynchronous Interactors)
  26. 26. Lógica y proveedores de datos Repository Interface REPOSITORY INTERACTOR INTERACTOR INTERACTOR DataSource Interface DataSource Interface API DataSource CACHE DataSource
  27. 27. Lógica y proveedores de datos Políticas de cacheo Lógica de origen de datos INTERACTOR INTERACTOR INTERACTOR DataSource Interface DataSource Interface Integración con los proveedores de datos Integración con los proveedores de datos Repository Interface
  28. 28. ¿Juntar Interactors y Repositories?
  29. 29. Clean Architecture
  30. 30. Activity Fragment Widget ... View Logic (Presenter) PAGES ViewInterface UseCases Repository Interface INTERACTOR INTERACTOR INTERACTOR DataSource Interface DataSource Interface API DataSource CACHE DataSource REPOSITORY Page Implementation
  31. 31. ENTIDADES UI PRESENTERS INTERACTORS REPOSITORIES DATASOURCES
  32. 32. ENTIDADES UI PRESENTERS INTERACTORS REPOSITORIES DATASOURCES AbstraccionesConcreciones Concreciones
  33. 33. ENTIDADES UI PRESENTERS INTERACTORS REPOSITORIES DATASOURCES AbstraccionesConcreciones Concreciones JAVAANDROID ANDROID
  34. 34. ENTIDADES UI PRESENTERS INTERACTORS REPOSITORIES DATASOURCES AbstraccionesConcreciones Concreciones JAVAANDROID ANDROID Regla de la dependenciaRegla de la dependencia
  35. 35. ENTIDADES UI PRESENTERS INTERACTORS REPOSITORIES DATASOURCES AbstraccionesConcreciones Concreciones JAVAANDROID ANDROID Regla de la dependenciaRegla de la dependencia Domain Objects (Modelos ricos) Model View Objects Data Objects
  36. 36. ¿Que hemos conseguido? ● Arquitectura independiente del framework, UI y proveedores de datos. ● Una arquitectura modular horizontal y verticalmente. ● Separar problemas y mejorar la legibilidad del código. ● Solucionar el problema de los cambios de configuración. ● Simplificar el problema de ejecución en segundo plano. ● Declarar el objetivo de tu software gracias a los interactors.
  37. 37. EN RESUMEN Aplica el sentido común No dejes de ser autocrítico y crítico Divide y vencerás
  38. 38. Show me the code! https://github.com/android10/Android-CleanArchitecture https://github.com/PaNaVTEC/Clean-Contacts
  39. 39. Gente con aura de tochez que sabe de arquitectura @pedro_g_s @PaNaVTEC@sefford @Akelael @fernando_cejas @flipper83 Saúl Díaz Android Engineer en Chicisimo Pedro Gómez Android Expert en Karumi Christian Panadero Android Developer en IG Rubén Serrano Lead Android Developer en Redbooth Fernando Cejas Android Developer en SoundCloud Jorge Barroso Cofounder y Android Expert en Karumi Pablo Guardiola Software Engineer en Telefonica I+D @Guardiola31337
  40. 40. Referencias Fernando Cejas - Architecting Android…The clean way? http://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/ Jorge Barroso - Forgetting Android https://www.youtube.com/watch?v=ROdIvrLL1ao Pedro Gómez - Software Design Patterns https://www.youtube.com/watch?v=tt3zI9cKiWU Pedro Gómez - Effective Android UI https://www.youtube.com/watch?v=N6yqe88ysNw Rubén Serrano y José Manuel Pereira - Arquitectura Hexagonal en Android https://www.youtube.com/watch?v=C3e3AwOTohg Christian Panadero - My way to Clean Architecture https://www.youtube.com/watch?v=lOEOK3UvmJM Pablo Guardiola - What is all this Clean Architecture jibber-jabber about? http://pguardiola.com/blog/clean-architecture-part-1/ Uncle Bob- The Clean Architecture http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
  41. 41. Preguntas José Manuel Pereira García (JMPergar) ANDROID TECH LEAD www.jmpergar.com @JMPergar jm.pereira.g@gmail.com +JoseMPereira
  42. 42. GRACIAS

×