SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Achieving Low Coupling by
Refactoring Towards
Higher Cohesion
Florin Coros
www.rabs.ro | www.iquarc.com
florin.coros@rabs.ro
@florincoros
blog.iquarc.com/florin
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Many thanks to our sponsors & partners!
GOLD
SILVER
PARTNERS
PLATINUM
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
About me
Co-Founder
Software Architect
@florincoros
Founder & Partner
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Low Coupling is GOOD
Loosely coupled
systems are
more
maintainable
Loose coupled
code is easier to
change
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Separation of Concerns is what we NEED
SoC, our single
chance to manage
complexity of
software
Easier to address
one concern at
the time, in
isolation
The end goal of
Design Pattern
and Principles
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
High Cohesion and Loose Coupling go hand in hand
A class has high
cohesion, when
most of its fields are
used by most of its
functions
High cohesive
classes are
loosely coupled
Loosely coupled
classes have high
cohesion
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
From Practices to Code
High cohesive
classes are
loosely
coupled
Loose coupled
code is easier
to change
The end goal of
Design Pattern
and Principles
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Do we get to a code design which is Loosely
Coupled and has a good Separation of Concerns
from the start?
Most probably NO
How we get to good code design?
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
• Small Steps
• Follow a Recipe
• Mechanized
Refactor
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Dependencies
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Refactoring Recipe: Step 1. Reduce Parameters
Reduce Functions Parameters
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Refactoring Recipe: Step 2. Increase Class Cohesion
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Refactoring Recipe: Step 3. Reduce Class Dependencies
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Refactoring Recipe: Step 3. Reduce Class Dependencies
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Code Demo
www.github.com  iQuarc  Code-Design-Training  LessonsSamples  Lesson7  CohesionCoupling
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Thank You!
@ITCAMPRO #ITCAMP15Community Conference for IT Professionals
Many thanks to our sponsors & partners!
GOLD
SILVER
PARTNERS
PLATINUM

Mais conteúdo relacionado

Destaque

Por que-(não)-ensinar-gramática-na-escola-sírio-possenti
Por que-(não)-ensinar-gramática-na-escola-sírio-possentiPor que-(não)-ensinar-gramática-na-escola-sírio-possenti
Por que-(não)-ensinar-gramática-na-escola-sírio-possentishaianebandeira
 
Chapter 5 software design
Chapter 5 software designChapter 5 software design
Chapter 5 software designdespicable me
 
Vida e obra de almeida garrett
Vida  e obra de almeida garrettVida  e obra de almeida garrett
Vida e obra de almeida garrettMarta Marinho
 
Perspectivas De La PsicologíA
Perspectivas De La PsicologíAPerspectivas De La PsicologíA
Perspectivas De La PsicologíAPrepa Ciz
 
Gratis Wordpress Webinar - Web-Blogsystem Einführung mit Eduvision Ausbildungen
Gratis Wordpress Webinar - Web-Blogsystem Einführung mit Eduvision AusbildungenGratis Wordpress Webinar - Web-Blogsystem Einführung mit Eduvision Ausbildungen
Gratis Wordpress Webinar - Web-Blogsystem Einführung mit Eduvision AusbildungenEduvision Ausbildungen
 
Gratis Social Media-Webinar, Eduvision
Gratis Social Media-Webinar, EduvisionGratis Social Media-Webinar, Eduvision
Gratis Social Media-Webinar, EduvisionEduvision Ausbildungen
 

Destaque (9)

Por que-(não)-ensinar-gramática-na-escola-sírio-possenti
Por que-(não)-ensinar-gramática-na-escola-sírio-possentiPor que-(não)-ensinar-gramática-na-escola-sírio-possenti
Por que-(não)-ensinar-gramática-na-escola-sírio-possenti
 
Chapter 5 software design
Chapter 5 software designChapter 5 software design
Chapter 5 software design
 
Mtech seminar1
Mtech seminar1Mtech seminar1
Mtech seminar1
 
Plan curricular anual octavo egb 2015 2016
Plan curricular anual octavo egb 2015 2016Plan curricular anual octavo egb 2015 2016
Plan curricular anual octavo egb 2015 2016
 
Vida e obra de almeida garrett
Vida  e obra de almeida garrettVida  e obra de almeida garrett
Vida e obra de almeida garrett
 
Suku kata
Suku kataSuku kata
Suku kata
 
Perspectivas De La PsicologíA
Perspectivas De La PsicologíAPerspectivas De La PsicologíA
Perspectivas De La PsicologíA
 
Gratis Wordpress Webinar - Web-Blogsystem Einführung mit Eduvision Ausbildungen
Gratis Wordpress Webinar - Web-Blogsystem Einführung mit Eduvision AusbildungenGratis Wordpress Webinar - Web-Blogsystem Einführung mit Eduvision Ausbildungen
Gratis Wordpress Webinar - Web-Blogsystem Einführung mit Eduvision Ausbildungen
 
Gratis Social Media-Webinar, Eduvision
Gratis Social Media-Webinar, EduvisionGratis Social Media-Webinar, Eduvision
Gratis Social Media-Webinar, Eduvision
 

Mais de Florin Coros

Implementing Clean Architecture
Implementing Clean ArchitectureImplementing Clean Architecture
Implementing Clean ArchitectureFlorin Coros
 
Implementing Clean Architecture
Implementing Clean ArchitectureImplementing Clean Architecture
Implementing Clean ArchitectureFlorin Coros
 
Enforce Consistentcy with Clean Architecture
Enforce Consistentcy with Clean ArchitectureEnforce Consistentcy with Clean Architecture
Enforce Consistentcy with Clean ArchitectureFlorin Coros
 
‘Cloud Ready’ Design through Application Software Infrastructure
‘Cloud Ready’ Design through Application Software Infrastructure‘Cloud Ready’ Design through Application Software Infrastructure
‘Cloud Ready’ Design through Application Software InfrastructureFlorin Coros
 
Enforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureEnforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureFlorin Coros
 
Enforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureEnforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureFlorin Coros
 
Enforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureEnforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureFlorin Coros
 
Cloud Ready Design through Application Software Infrastructure
Cloud Ready Design through Application Software InfrastructureCloud Ready Design through Application Software Infrastructure
Cloud Ready Design through Application Software InfrastructureFlorin Coros
 
Good Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality CodeGood Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality CodeFlorin Coros
 

Mais de Florin Coros (9)

Implementing Clean Architecture
Implementing Clean ArchitectureImplementing Clean Architecture
Implementing Clean Architecture
 
Implementing Clean Architecture
Implementing Clean ArchitectureImplementing Clean Architecture
Implementing Clean Architecture
 
Enforce Consistentcy with Clean Architecture
Enforce Consistentcy with Clean ArchitectureEnforce Consistentcy with Clean Architecture
Enforce Consistentcy with Clean Architecture
 
‘Cloud Ready’ Design through Application Software Infrastructure
‘Cloud Ready’ Design through Application Software Infrastructure‘Cloud Ready’ Design through Application Software Infrastructure
‘Cloud Ready’ Design through Application Software Infrastructure
 
Enforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureEnforce Consistency through Application Infrastructure
Enforce Consistency through Application Infrastructure
 
Enforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureEnforce Consistency through Application Infrastructure
Enforce Consistency through Application Infrastructure
 
Enforce Consistency through Application Infrastructure
Enforce Consistency through Application InfrastructureEnforce Consistency through Application Infrastructure
Enforce Consistency through Application Infrastructure
 
Cloud Ready Design through Application Software Infrastructure
Cloud Ready Design through Application Software InfrastructureCloud Ready Design through Application Software Infrastructure
Cloud Ready Design through Application Software Infrastructure
 
Good Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality CodeGood Unit Tests Ask For Quality Code
Good Unit Tests Ask For Quality Code
 

Último

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 

Último (20)

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 

Achieving Low Coupling by Refactoring Towards Higher Cohesion