SlideShare a Scribd company logo
1 of 27
Download to read offline
Connascence
Viernes técnico 25/11/2016
Definición lingüística
Definición técnica
Connascence ⇝ Acoplamiento
Conjunto de patrones, “métricas” para poder razonar mejor cómo de acoplado está tu
código (no sólo hablar en base a “sensaciones”).
Ofrece un vocabulario común para hablar sobre los diferentes tipos de acoplamiento.
Dos entes son “connascents” cuando deben cambiar de manera conjunta para que el
sistema siga siendo válido: Si A cambia, entonces B debe cambiar.
Tipos de connascence
● Estático
○ CoN: de nombre
○ CoT: de tipo
○ CoM / CoC: de significado o convención
○ CoP: de posición
○ CoA: de algoritmo
● Dinámico
○ CoE: de ejecución
○ CoT: de tiempos
○ CoV: de valores
○ CoI: de identidad
Properties
● Strength
● Locality
● Degree
Static Connascence
Connascence of Name (CoN)
Multiple components must agree on the name of an entity.
Method names are an example of this form of connascence: if the name of a method changes, callers of that
method must be changed to use the new name.
Connascence of Type (CoT)
Connascence of type is when multiple components must agree on the type of an entity.
Static languages: the compiler does your job.
Dynamic languages: you’re f** up
Connascence of Meaning (CoM)
Connascence of meaning is when multiple components must agree on the interpretation of data values.
Basically: magic number, magic strings, null/None, booleans, etc.
Solution: use of constants, Enums, etc.
Connascence of Position (CoP)
Connascence of position is when multiple entities must agree on the order of values.
Example 1: positional parameters in functions/methods
Solution: named parameters or an object
Connascence of Position (II)
Example 2: returning tuples or lists
Solution: object or dictionary/map
Connascence of Algorithm (CoA)
Connascence of algorithm is when multiple components must agree on a particular algorithm (on how to
process something).
● Transmisión de datos
○ Emisor y receptor deben consensuarlo
● Validaciones
○ Validación del email (JS, Controller, Model): en varios sitios, ¿de varias maneras?
● Codificaciones/Encriptaciones
● Algoritmos de compresión
● Testing:
○ Bad smell: verificar que un algoritmo funciona según lo esperado (se duplica en el test)
Dynamic Connascence
Connascence of Execution (CoE)
The order of execution of multiple components is important.
Example:
● objects encapsulating state machine
Connascence of Time (CoT)
The timing of the execution of multiple components is important.
Examples:
● Multithreading
● race conditions
Connascence of Time (II)
Java 1.5: AtomicInteger, e.g. para contadores accedidos por varios threads
(lectura + escritura no separada)
Connascence of Value (CoV)
Several values must change together (a.k.a the values of two components are related).
It’s a runtime problem.
Ejemplo: http://connascence.io/value.html
Connascence of Value (CoV)
Connascence of Identity (CoI)
Two components must reference the same entity/object.
Ejemplo en nuestros tests: mismo repo para leer y escribir.
Properties / Axes of Connescence
Properties
● Strength
● Locality
● Degree
Axe: Strength
The strength of a form of connascence is determined by the ease with which that type of coupling can be
refactored.
Stronger connascences are harder to discover or harder to refactor.
For example, connascence of name is a weak form of connascence because renaming entities across a codebase
is usually reasonably trivial. However, connascence of meaning is considered a stronger form of connascence
since semantic meaning is harder to find across an entire codebase.
Static connascences are considered to be weaker than dynamic connascences, since static connascences can be
determined simply by examining the source code.
Axe: Locality
The locality of an instance of connascence is how close the two entities are to each other.
Code that is close together (in the same module, class, or function) should typically have more, and higher
forms of connascence than code that is far apart (in separate modules, or even codebases).
Axe: Degree
An entity which is connascent with thousands of other entities is likely to be a larger issue than one is
connascent with only a few.
Connascence might be acceptable in limited degree but unacceptable in large degree.
Recursos
● https://en.wikipedia.org/wiki/Connascence_(computer_programming)
● http://connascence.io/
● Connascence en Python: https://www.youtube.com/watch?v=iwADIlIgDNA
● Connascence Examined: https://www.youtube.com/watch?v=HQXVKHoUQxY
● How to measure coupling: https://www.youtube.com/watch?v=L727roWRfFg
Introduction to Connascence
Introduction to Connascence

More Related Content

Viewers also liked

Viewers also liked (20)

Գիշատիչ բույսեր
Գիշատիչ բույսերԳիշատիչ բույսեր
Գիշատիչ բույսեր
 
Simulado2011
Simulado2011Simulado2011
Simulado2011
 
Presentaciòn 4to naturales
Presentaciòn 4to naturalesPresentaciòn 4to naturales
Presentaciòn 4to naturales
 
Autorizacion072
Autorizacion072Autorizacion072
Autorizacion072
 
CORE-2008-BRF-LT_Paper_D5
CORE-2008-BRF-LT_Paper_D5CORE-2008-BRF-LT_Paper_D5
CORE-2008-BRF-LT_Paper_D5
 
Placa Madre
Placa MadrePlaca Madre
Placa Madre
 
Jornal Pedro Américo setembro 2014
Jornal Pedro Américo setembro 2014Jornal Pedro Américo setembro 2014
Jornal Pedro Américo setembro 2014
 
Hcd powerpoint
Hcd powerpointHcd powerpoint
Hcd powerpoint
 
Johana hoyos capitulo1
Johana hoyos capitulo1Johana hoyos capitulo1
Johana hoyos capitulo1
 
kinkoi
 kinkoi  kinkoi
kinkoi
 
Silveira cidadania e_participacao_social
Silveira cidadania e_participacao_socialSilveira cidadania e_participacao_social
Silveira cidadania e_participacao_social
 
Questões do brincar na vida e no desenvolvimento do ser humano adulto
Questões do brincar na vida e no desenvolvimento do ser humano adultoQuestões do brincar na vida e no desenvolvimento do ser humano adulto
Questões do brincar na vida e no desenvolvimento do ser humano adulto
 
Mapa quimica
Mapa quimicaMapa quimica
Mapa quimica
 
Psp
PspPsp
Psp
 
POLI 193 paper final version
POLI 193 paper final versionPOLI 193 paper final version
POLI 193 paper final version
 
Guareschi estrategias de_invencao_do_presente_final
Guareschi estrategias de_invencao_do_presente_finalGuareschi estrategias de_invencao_do_presente_final
Guareschi estrategias de_invencao_do_presente_final
 
Criei Meu Site e Agora?
Criei Meu Site e Agora?Criei Meu Site e Agora?
Criei Meu Site e Agora?
 
Oração as drogas
Oração as drogasOração as drogas
Oração as drogas
 
HOMENAGEM ÀS MULHERES
HOMENAGEM ÀS MULHERESHOMENAGEM ÀS MULHERES
HOMENAGEM ÀS MULHERES
 
Firewall de windows cambiado
Firewall de windows cambiadoFirewall de windows cambiado
Firewall de windows cambiado
 

Similar to Introduction to Connascence

Domain-Specific Term Extraction for Concept Identification in Ontology Constr...
Domain-Specific Term Extraction for Concept Identification in Ontology Constr...Domain-Specific Term Extraction for Concept Identification in Ontology Constr...
Domain-Specific Term Extraction for Concept Identification in Ontology Constr...Innovation Quotient Pvt Ltd
 
Design Patterns For Distributed NO-reational databases
Design Patterns For Distributed NO-reational databasesDesign Patterns For Distributed NO-reational databases
Design Patterns For Distributed NO-reational databaseslovingprince58
 
Peckham 2014 i_em_ss
Peckham 2014 i_em_ssPeckham 2014 i_em_ss
Peckham 2014 i_em_ssEarthCube
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented DesignAravinth NSP
 
Explaining why methods change together
Explaining why methods change togetherExplaining why methods change together
Explaining why methods change togetherAngela Lozano
 
Variables: names, bindings, type, scope
Variables: names, bindings, type, scopeVariables: names, bindings, type, scope
Variables: names, bindings, type, scopesuthi
 
Configuration of classes
Configuration of classesConfiguration of classes
Configuration of classesanumshakeel5
 
Ruminations on Cloud / Microservices / DevOps
Ruminations on Cloud / Microservices / DevOpsRuminations on Cloud / Microservices / DevOps
Ruminations on Cloud / Microservices / DevOpsGreg Liebowitz
 
A Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsA Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsRebecca Bilbro
 

Similar to Introduction to Connascence (20)

Software quality - Connascence
Software quality - ConnascenceSoftware quality - Connascence
Software quality - Connascence
 
Ch09
Ch09Ch09
Ch09
 
Domain-Specific Term Extraction for Concept Identification in Ontology Constr...
Domain-Specific Term Extraction for Concept Identification in Ontology Constr...Domain-Specific Term Extraction for Concept Identification in Ontology Constr...
Domain-Specific Term Extraction for Concept Identification in Ontology Constr...
 
C Omega
C OmegaC Omega
C Omega
 
Substitutability
SubstitutabilitySubstitutability
Substitutability
 
Design Patterns For Distributed NO-reational databases
Design Patterns For Distributed NO-reational databasesDesign Patterns For Distributed NO-reational databases
Design Patterns For Distributed NO-reational databases
 
Rbce
Rbce Rbce
Rbce
 
Sorted
SortedSorted
Sorted
 
Peckham 2014 i_em_ss
Peckham 2014 i_em_ssPeckham 2014 i_em_ss
Peckham 2014 i_em_ss
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
 
Explaining why methods change together
Explaining why methods change togetherExplaining why methods change together
Explaining why methods change together
 
Variables: names, bindings, type, scope
Variables: names, bindings, type, scopeVariables: names, bindings, type, scope
Variables: names, bindings, type, scope
 
Configuration of classes
Configuration of classesConfiguration of classes
Configuration of classes
 
NoSql Database
NoSql DatabaseNoSql Database
NoSql Database
 
Ruminations on Cloud / Microservices / DevOps
Ruminations on Cloud / Microservices / DevOpsRuminations on Cloud / Microservices / DevOps
Ruminations on Cloud / Microservices / DevOps
 
C++ programing lanuage
C++ programing lanuageC++ programing lanuage
C++ programing lanuage
 
Interoperability
InteroperabilityInteroperability
Interoperability
 
A Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and DistributionsA Visual Exploration of Distance, Documents, and Distributions
A Visual Exploration of Distance, Documents, and Distributions
 

More from Alea Soluciones, S.L.

More from Alea Soluciones, S.L. (9)

Boot process: BIOS vs UEFI
Boot process: BIOS vs UEFIBoot process: BIOS vs UEFI
Boot process: BIOS vs UEFI
 
JavaScript, qué hermoso eres
JavaScript, qué hermoso eresJavaScript, qué hermoso eres
JavaScript, qué hermoso eres
 
Introducción a sysdig
Introducción a sysdigIntroducción a sysdig
Introducción a sysdig
 
Tests funcionales con Geb
Tests funcionales con GebTests funcionales con Geb
Tests funcionales con Geb
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Polymer 101
Polymer 101Polymer 101
Polymer 101
 
Twelve factor apps
Twelve factor appsTwelve factor apps
Twelve factor apps
 
Presentación CAS 2016: Alineando valores y principios con prácticas técnicas
Presentación CAS 2016: Alineando valores y principios con prácticas técnicasPresentación CAS 2016: Alineando valores y principios con prácticas técnicas
Presentación CAS 2016: Alineando valores y principios con prácticas técnicas
 
Taller PyConEs 2016: Introducción a TDD
Taller PyConEs 2016: Introducción a TDDTaller PyConEs 2016: Introducción a TDD
Taller PyConEs 2016: Introducción a TDD
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Introduction to Connascence

  • 3. Definición técnica Connascence ⇝ Acoplamiento Conjunto de patrones, “métricas” para poder razonar mejor cómo de acoplado está tu código (no sólo hablar en base a “sensaciones”). Ofrece un vocabulario común para hablar sobre los diferentes tipos de acoplamiento. Dos entes son “connascents” cuando deben cambiar de manera conjunta para que el sistema siga siendo válido: Si A cambia, entonces B debe cambiar.
  • 4. Tipos de connascence ● Estático ○ CoN: de nombre ○ CoT: de tipo ○ CoM / CoC: de significado o convención ○ CoP: de posición ○ CoA: de algoritmo ● Dinámico ○ CoE: de ejecución ○ CoT: de tiempos ○ CoV: de valores ○ CoI: de identidad
  • 7. Connascence of Name (CoN) Multiple components must agree on the name of an entity. Method names are an example of this form of connascence: if the name of a method changes, callers of that method must be changed to use the new name.
  • 8. Connascence of Type (CoT) Connascence of type is when multiple components must agree on the type of an entity. Static languages: the compiler does your job. Dynamic languages: you’re f** up
  • 9. Connascence of Meaning (CoM) Connascence of meaning is when multiple components must agree on the interpretation of data values. Basically: magic number, magic strings, null/None, booleans, etc. Solution: use of constants, Enums, etc.
  • 10. Connascence of Position (CoP) Connascence of position is when multiple entities must agree on the order of values. Example 1: positional parameters in functions/methods Solution: named parameters or an object
  • 11. Connascence of Position (II) Example 2: returning tuples or lists Solution: object or dictionary/map
  • 12. Connascence of Algorithm (CoA) Connascence of algorithm is when multiple components must agree on a particular algorithm (on how to process something). ● Transmisión de datos ○ Emisor y receptor deben consensuarlo ● Validaciones ○ Validación del email (JS, Controller, Model): en varios sitios, ¿de varias maneras? ● Codificaciones/Encriptaciones ● Algoritmos de compresión ● Testing: ○ Bad smell: verificar que un algoritmo funciona según lo esperado (se duplica en el test)
  • 14. Connascence of Execution (CoE) The order of execution of multiple components is important. Example: ● objects encapsulating state machine
  • 15. Connascence of Time (CoT) The timing of the execution of multiple components is important. Examples: ● Multithreading ● race conditions
  • 16. Connascence of Time (II) Java 1.5: AtomicInteger, e.g. para contadores accedidos por varios threads (lectura + escritura no separada)
  • 17. Connascence of Value (CoV) Several values must change together (a.k.a the values of two components are related). It’s a runtime problem. Ejemplo: http://connascence.io/value.html
  • 19. Connascence of Identity (CoI) Two components must reference the same entity/object. Ejemplo en nuestros tests: mismo repo para leer y escribir.
  • 20. Properties / Axes of Connescence
  • 22. Axe: Strength The strength of a form of connascence is determined by the ease with which that type of coupling can be refactored. Stronger connascences are harder to discover or harder to refactor. For example, connascence of name is a weak form of connascence because renaming entities across a codebase is usually reasonably trivial. However, connascence of meaning is considered a stronger form of connascence since semantic meaning is harder to find across an entire codebase. Static connascences are considered to be weaker than dynamic connascences, since static connascences can be determined simply by examining the source code.
  • 23. Axe: Locality The locality of an instance of connascence is how close the two entities are to each other. Code that is close together (in the same module, class, or function) should typically have more, and higher forms of connascence than code that is far apart (in separate modules, or even codebases).
  • 24. Axe: Degree An entity which is connascent with thousands of other entities is likely to be a larger issue than one is connascent with only a few. Connascence might be acceptable in limited degree but unacceptable in large degree.
  • 25. Recursos ● https://en.wikipedia.org/wiki/Connascence_(computer_programming) ● http://connascence.io/ ● Connascence en Python: https://www.youtube.com/watch?v=iwADIlIgDNA ● Connascence Examined: https://www.youtube.com/watch?v=HQXVKHoUQxY ● How to measure coupling: https://www.youtube.com/watch?v=L727roWRfFg