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.
S.O.L.I.D. ¿Cómo lo aplico en mi código?
#codepassion_pe    @JuanjoFuchs   @RaybertParedes
http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx
Que pasa  cuando nos  toca modificar  código?http://www.albertelli.com/photoarchive/Random_2003/lawn_jenga0002.jpeg
Da miedo…http://blog.rwbenwick.com/wp-content/uploads/2009/12/Reason-For-Leaving-iStock_000008369823Medium.jpg
http://www.albertelli.com/photoarchive/Random_2003/lawn_jenga0002.jpeg
Quien nos podrá ayudar?                                                                 Pues….http://browse.deviantart.com...
Tampoco….http://www.pharmatek.com/developers/developers.htm
Nosotroshttp://www.catosplace.net/blogs/personal/wp-content/uploads/2011/04/developers.jpg
Pero como??http://4.bp.blogspot.com/-wLWxI2BZTEo/TbP44yGHHXI/AAAAAAAACMA/ck1BVzrucHo/s1600/bg_doubt.jpg
Aprendiendo un poco de…                          Etc…
En donde???              Y otros mas…
Bueno, manos a la ubre!!           Perdón, a la obra…. ;)
Entonces, ¿Qué es S.O.L.I.D.?Es un acrónimo de:• Siempre• Olvido• Lo• Interesante del• Desarrollo
Mentira, S.O.L.I.D. es un acrónimo de:• Single Responsibility• Open Closed• Liskov Substitution• Interface Segregation• De...
Single Responsibility Principle      Una clase jamás debería tener más       de una razón por la cual cambiar• Responsabil...
Single Responsibility PrincipleCohesión:                         Acoplamiento:     Qué tan fuertemente             El grad...
Single Responsibility Principle
Single Responsibility Principle
https://github.com/JuanjoFuchs/SOLID/tree/master/SRP       https://github.com/JuanjoFuchs/SOLID/tree/master/SRP%20-%20Refa...
Open Closed Principle    Entidades de software (clases, módulos,  funciones, etc.) deberían estar abiertas para   extensió...
Open Closed PrincipleAbiertas para extensión       Cerradas para modificación    Podemos hacer que la      No se necesita ...
Open Closed Principle          https://gist.github.com/2896236#file_ocp_empleados.sin_refactorizar.cs
Open Closed Principlehttps://gist.github.com/2896236#file_ocp_empleados.refactorizado.cs
https://github.com/JuanjoFuchs/SOLID/tree/master/OCP       https://github.com/JuanjoFuchs/SOLID/tree/master/OCP%20-%20Refa...
Liskov Substitution Principle  Funciones que usen punteros o referencias a clases base deben poder usar objetos de clases ...
Liskov Substitution Principlehttps://gist.github.com/2896064             https://gist.github.com/2896078
https://github.com/JuanjoFuchs/SOLID/tree/master/LSPDemo
Interface Segregation Principle    Los clientes no deberían estar forzados a     depender de interfaces que no utilizan.• ...
Interface Segregation Principle                https://gist.github.com/2896112#file_lsp_animal.sin_refactorizar.cs
Interface Segregation Principle                 https://gist.github.com/2896112#file_lsp_animal.refactorizado.cs
https://github.com/JuanjoFuchs/SOLID/tree/master/ISPDemo
Dependency Inversion Principle• Módulos de alto nivel no deben depender de  módulos de bajo nivel. Ambos deben  depender d...
DIP – Ejemplo 1https://gist.github.com/2896132#file_dip_hola_mundo.sin_refactoriza   https://gist.github.com/2896132#file_...
DIP – Ejemplo 2https://gist.github.com/2896132#file_dip_volvo.sin_refactorizar.cs   https://gist.github.com/2896132#file_d...
DIP – Arquitectura tradicional                 UI          Negocio                                    DependenciaAcceso a ...
DIP – Arquitectura invertidaAcceso a               Pruebas       Web            UI Datos                 Unitarias   Servi...
https://github.com/JuanjoFuchs/SOLID/tree/master/DIP_Multicapa       https://github.com/JuanjoFuchs/SOLID/tree/master/DIP_...
Referencias• Posters motivacionales   http://lostechies.com/derickbailey/2009/02/11/solid-development-principles-in-motiva...
¿Preguntas?
SOLID - ¿Cómo lo aplico a mi código?
SOLID - ¿Cómo lo aplico a mi código?
SOLID - ¿Cómo lo aplico a mi código?
SOLID - ¿Cómo lo aplico a mi código?
SOLID - ¿Cómo lo aplico a mi código?
SOLID - ¿Cómo lo aplico a mi código?
Upcoming SlideShare
Loading in …5
×

SOLID - ¿Cómo lo aplico a mi código?

14,138 views

Published on

¿Cómo aplicar los principios SOLID a mi código?

Definición de los principios y ejemplos clásicos de buenas prácticas de Diseño Orientado a Objetos

Audio de la presentación:
http://archive.org/details/10.S.o.l.i.d.ComoLoAplicoEnMiCdigo-JuanJosFuchs

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS 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 THIS 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 THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & 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 THIS 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 THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS 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 THIS 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 THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & 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 THIS 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 THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS 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 THIS 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 THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & 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 THIS 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 THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://shorturl.at/krvUW } ......................................................................................................................... Download Full EPUB Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download Full doc Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download PDF EBOOK here { http://shorturl.at/krvUW } ......................................................................................................................... Download EPUB Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... Download doc Ebook here { http://shorturl.at/krvUW } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS 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 THIS 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 THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & 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 THIS 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 THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • 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 & Proven Way to Build Good Habits & 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, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

SOLID - ¿Cómo lo aplico a mi código?

  1. 1. S.O.L.I.D. ¿Cómo lo aplico en mi código?
  2. 2. #codepassion_pe @JuanjoFuchs @RaybertParedes
  3. 3. http://www.lostechies.com/blogs/derickbailey/archive/2009/02/11/solid-development-principles-in-motivational-pictures.aspx
  4. 4. Que pasa cuando nos toca modificar código?http://www.albertelli.com/photoarchive/Random_2003/lawn_jenga0002.jpeg
  5. 5. Da miedo…http://blog.rwbenwick.com/wp-content/uploads/2009/12/Reason-For-Leaving-iStock_000008369823Medium.jpg
  6. 6. http://www.albertelli.com/photoarchive/Random_2003/lawn_jenga0002.jpeg
  7. 7. Quien nos podrá ayudar? Pues….http://browse.deviantart.com/?qh=&section=&q=avengers#/d41k54l
  8. 8. Tampoco….http://www.pharmatek.com/developers/developers.htm
  9. 9. Nosotroshttp://www.catosplace.net/blogs/personal/wp-content/uploads/2011/04/developers.jpg
  10. 10. Pero como??http://4.bp.blogspot.com/-wLWxI2BZTEo/TbP44yGHHXI/AAAAAAAACMA/ck1BVzrucHo/s1600/bg_doubt.jpg
  11. 11. Aprendiendo un poco de… Etc…
  12. 12. En donde??? Y otros mas…
  13. 13. Bueno, manos a la ubre!! Perdón, a la obra…. ;)
  14. 14. Entonces, ¿Qué es S.O.L.I.D.?Es un acrónimo de:• Siempre• Olvido• Lo• Interesante del• Desarrollo
  15. 15. Mentira, S.O.L.I.D. es un acrónimo de:• Single Responsibility• Open Closed• Liskov Substitution• Interface Segregation• Dependency Inversion
  16. 16. Single Responsibility Principle Una clase jamás debería tener más de una razón por la cual cambiar• Responsabilidad == Razón para cambiar• Si una clase asume más de una responsabilidad, entonces tendrá más de una razón para cambiar.• Acoplamiento de responsabilidades.
  17. 17. Single Responsibility PrincipleCohesión: Acoplamiento: Qué tan fuertemente El grado en el cual cadarelacionadas y enfocadas están módulo de un programalas distintas responsabilidades depende de cada uno de los de un módulo. otros módulos
  18. 18. Single Responsibility Principle
  19. 19. Single Responsibility Principle
  20. 20. https://github.com/JuanjoFuchs/SOLID/tree/master/SRP https://github.com/JuanjoFuchs/SOLID/tree/master/SRP%20-%20RefactorizadoDemo
  21. 21. Open Closed Principle Entidades de software (clases, módulos, funciones, etc.) deberían estar abiertas para extensión pero cerradas para modificación.• Si 1 cambio impacta a varios módulos, entonces la aplicación no está bien diseñada.• Debemos diseñar módulos que nunca cambien
  22. 22. Open Closed PrincipleAbiertas para extensión Cerradas para modificación Podemos hacer que la No se necesita hacer cambios aplicación se comporte de del código fuente de dicho distintas formas. módulo. Extendiendo elcomportamiento del módulo. Pero cómo? Abstracción
  23. 23. Open Closed Principle https://gist.github.com/2896236#file_ocp_empleados.sin_refactorizar.cs
  24. 24. Open Closed Principlehttps://gist.github.com/2896236#file_ocp_empleados.refactorizado.cs
  25. 25. https://github.com/JuanjoFuchs/SOLID/tree/master/OCP https://github.com/JuanjoFuchs/SOLID/tree/master/OCP%20-%20RefactorizadoDemo
  26. 26. Liskov Substitution Principle Funciones que usen punteros o referencias a clases base deben poder usar objetos de clases derivadas sin saberlo.• Si tenemos una clase BASE y dos subclases SUB1 y SUB2, el código cliente siempre debe referirse a BASE.• No decir: SUB1 es una BASE.• En cambio decir: SUB1 es reemplazable por una BASE.
  27. 27. Liskov Substitution Principlehttps://gist.github.com/2896064 https://gist.github.com/2896078
  28. 28. https://github.com/JuanjoFuchs/SOLID/tree/master/LSPDemo
  29. 29. Interface Segregation Principle Los clientes no deberían estar forzados a depender de interfaces que no utilizan.• Las interfaces “gordas” o “contaminadas” deben dividirse en varios grupos de funciones.• Cada grupo será implementado por distintos tipos de clientes.
  30. 30. Interface Segregation Principle https://gist.github.com/2896112#file_lsp_animal.sin_refactorizar.cs
  31. 31. Interface Segregation Principle https://gist.github.com/2896112#file_lsp_animal.refactorizado.cs
  32. 32. https://github.com/JuanjoFuchs/SOLID/tree/master/ISPDemo
  33. 33. Dependency Inversion Principle• Módulos de alto nivel no deben depender de módulos de bajo nivel. Ambos deben depender de abstracciones.• Abstracciones no deben depender de detalles. Los detalles deben depender de abstracciones.• Puede implementarse con: – Inyección de dependencias – IoC (Inversión del control)
  34. 34. DIP – Ejemplo 1https://gist.github.com/2896132#file_dip_hola_mundo.sin_refactoriza https://gist.github.com/2896132#file_dip_hola_mundo.refactorizado.
  35. 35. DIP – Ejemplo 2https://gist.github.com/2896132#file_dip_volvo.sin_refactorizar.cs https://gist.github.com/2896132#file_dip_volvo.refactorizado.cs
  36. 36. DIP – Arquitectura tradicional UI Negocio DependenciaAcceso a Datos Componentes
  37. 37. DIP – Arquitectura invertidaAcceso a Pruebas Web UI Datos Unitarias Services Capa de Negocio Entidades
  38. 38. https://github.com/JuanjoFuchs/SOLID/tree/master/DIP_Multicapa https://github.com/JuanjoFuchs/SOLID/tree/master/DIP_Multicapa_RefactorizadoDemo
  39. 39. Referencias• Posters motivacionales http://lostechies.com/derickbailey/2009/02/11/solid-development-principles-in-motivational-pictures/• PluralSight – SOLID Principles of Object Oriented Design http://www.pluralsight-training.net/microsoft/Courses/TableOfContents?courseName=principles-oo- design• Principios de DOO – Bob Martin http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod• Pablo’s SOLID Software Development http://lostechies.com/wp-content/uploads/2011/03/pablos_solid_ebook.pdf• Principios SOLID con ejemplos reales http://blog.gauffin.org/2012/05/solid-principles-with-real-world-examples/
  40. 40. ¿Preguntas?

×