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.

Uncoupling

108 views

Published on

An examination of coupling, decoupling, uncoupling, and it's various challenges, uses, and dimensions.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Uncoupling

  1. 1. Uncoupling Michael T. Nygard @mtnygard
  2. 2. About the Speaker Developer Architect Operations Blog: http://www.michaelnygard.com/ Twitter: http://twitter.com/mtnygard
  3. 3. About the Speaker • Stewards of Clojure & ClojureScript • Creators of Datomic • Open source contributions • Pedestal • Vase • Onto • Simulant
  4. 4. Tensegrity This Photo by Unknown Author is licensed under CC BY
  5. 5. No-tegrity This Photo by Unknown Author is licensed under CC BY-NC-SA
  6. 6. Coupling
  7. 7. Scharfenberg Coupler
  8. 8. Watt’s Linkage
  9. 9. Chebyshev Linkage
  10. 10. Standard Model Particle Interactions
  11. 11. Coupling
  12. 12. Coupling •Determines degrees of freedom.
  13. 13. Coupling •Determines degrees of freedom. •Enables some movements.
  14. 14. Coupling •Determines degrees of freedom. •Enables some movements. •Inhibits other movements.
  15. 15. Coupling •Determines degrees of freedom. •Enables some movements. •Inhibits other movements. •Connects effects.
  16. 16. Everything is coupled to everything • Ambient temperature • Ambient atmosphere • Acoustic vibrations • Electromagnetic field • Gravity • Higgs field
  17. 17. We cannot attend to all things all the time
  18. 18. Kinds of Coupling Type Effect Operational Consumer cannot run without the provider Development Changes in producer and consumer must be coordinated Semantic Change together because of shared concepts Functional Change together because of shared responsibility Incidental Change together for no good reason. (E.g., breaking API changes.)
  19. 19. Analyzing Coupling I E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Email Component [Component: C#] Sends emails
  20. 20. Analyzing Coupling I E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Email Component [Component: C#] Sends emails Operational: Strong. SMTP is synchronous, connection-oriented, conversational
  21. 21. Analyzing Coupling I E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Email Component [Component: C#] Sends emails Operational: Strong. SMTP is synchronous, connection-oriented, conversational Development: Weak. SMTP is well-defined standard with history of interoperability
  22. 22. Analyzing Coupling I E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Email Component [Component: C#] Sends emails Operational: Strong. SMTP is synchronous, connection-oriented, conversational Development: Weak. SMTP is well-defined standard with history of interoperability Semantic: Very strong. SMTP defines entities, attributes, and allowed values.
  23. 23. Analyzing Coupling I E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Email Component [Component: C#] Sends emails Operational: Strong. SMTP is synchronous, connection-oriented, conversational Development: Weak. SMTP is well-defined standard with history of interoperability Semantic: Very strong. SMTP defines entities, attributes, and allowed values. Functional: Very weak. Sender and MTA both use network connections.
  24. 24. Analyzing Coupling II-A Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem SQL connection to RDBMS
  25. 25. Analyzing Coupling II-A Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem SQL connection to RDBMS Operational: Very strong. Dependent on availability of server. Must be aware of topology and failover strategy
  26. 26. Analyzing Coupling II-A Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem SQL connection to RDBMS Operational: Very strong. Dependent on availability of server. Must be aware of topology and failover strategy Development: Very strong. Dependent on schema, server version, protocol version.
  27. 27. Analyzing Coupling II-A Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem SQL connection to RDBMS Operational: Very strong. Dependent on availability of server. Must be aware of topology and failover strategy Development: Very strong. Dependent on schema, server version, protocol version. Semantic: Very strong. Tables, columns, and joins must be known to both parties.
  28. 28. Analyzing Coupling II-A Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem Operational: Very strong. Dependent on availability of server. Must be aware of topology and failover strategy Development: Very strong. Dependent on schema, server version, protocol version. Semantic: Very strong. Tables, columns, and joins must be known to both parties. Functional: Weak. Functions of data maintenance don’t overlap with retrieval into objects. SQL connection to RDBMS
  29. 29. Suppose we use REST instead of SQL?
  30. 30. Analyzing Coupling II-B Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem HTTPS request to REST API
  31. 31. Analyzing Coupling II-B Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem Operational: Strong, but less than before. Dependent on availability of server. HTTPS request to REST API
  32. 32. Analyzing Coupling II-B Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem Operational: Strong, but less than before. Dependent on availability of server. Development: Strong, but less. Insulated from data format changes. Open encoding can further reduce coupling HTTPS request to REST API
  33. 33. Analyzing Coupling II-B Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem Operational: Strong, but less than before. Dependent on availability of server. Development: Strong, but less. Insulated from data format changes. Open encoding can further reduce coupling Semantic: Still very strong. REST resources and C# entities must align. Concepts will still map 1:1 HTTPS request to REST API
  34. 34. Analyzing Coupling II-B Reference Data System [Software System] Managesreference data for all counterpartiesthe bank interacts with Getscounterparty datafrom Reference Data Importer [Component: C#] Imports data from the reference datasystem Operational: Strong, but less than before. Dependent on availability of server. Development: Strong, but less. Insulated from data format changes. Open encoding can further reduce coupling Semantic: Still very strong. REST resources and C# entities must align. Concepts will still map 1:1 Functional: Still weak. Different languages, techniques, design patterns apply. HTTPS request to REST API
  35. 35. What if we invert the flow of control?
  36. 36. Analyzing Coupling II-C Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Reference Data Receiver [Component: C#] Accepts and caches data from the reference datasystem Broadcasts Message Broker [Software System] Pub/sub hub, bub Broadcasts
  37. 37. Analyzing Coupling II-C Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Reference Data Receiver [Component: C#] Accepts and caches data from the reference datasystem Broadcasts Message Broker [Software System] Pub/sub hub, bub Broadcasts Operational: Very weak. Receiver can run with stale data when either broker or upstream are broken.
  38. 38. Analyzing Coupling II-C Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Reference Data Receiver [Component: C#] Accepts and caches data from the reference datasystem Broadcasts Message Broker [Software System] Pub/sub hub, bub Broadcasts Operational: Very weak. Receiver can run with stale data when either broker or upstream are broken. Development: Weak. Insulated from schema changes.
  39. 39. Analyzing Coupling II-C Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Reference Data Receiver [Component: C#] Accepts and caches data from the reference datasystem Broadcasts Message Broker [Software System] Pub/sub hub, bub Broadcasts Operational: Very weak. Receiver can run with stale data when either broker or upstream are broken. Development: Weak. Insulated from schema changes. Semantic: Strong, but not as strong. Broker allows for remapping concepts.
  40. 40. Analyzing Coupling II-C Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Reference Data Receiver [Component: C#] Accepts and caches data from the reference datasystem Broadcasts Message Broker [Software System] Pub/sub hub, bub Broadcasts Operational: Very weak. Receiver can run with stale data when either broker or upstream are broken. Development: Weak. Insulated from schema changes. Semantic: Strong, but not as strong. Broker allows for remapping concepts. Functional: Moderate. All components must share the same messaging tech.
  41. 41. Coupling was present in all examples – It is necessary and inescapable
  42. 42. Chains of Coupling
  43. 43. Chains of Coupling Retek IBM PIM Informatica Everybody Else Dotcom Catalog 3rd Party Data Vendors Reviews, Ratings, Imagery Dotcom Promotions Online Store Faceted Search SKU SKU SKU SKU SKU SKU SKU SKU
  44. 44. Chains of Coupling Retek IBM PIM Informatica Everybody Else Dotcom Catalog 3rd Party Data Vendors Reviews, Ratings, Imagery Dotcom Promotions Online Store Faceted Search SKU SKU SKU SKU SKU SKU SKU SKU Price Point
  45. 45. Chains of Coupling Retek IBM PIM Informatica Everybody Else Dotcom Catalog 3rd Party Data Vendors Reviews, Ratings, Imagery Dotcom Promotions Online Store Faceted Search SKU SKU SKU SKU SKU SKU SKU SKU Price Point Price Point Price Point Price Point Price Point Price Point Price Point
  46. 46. Chains of Coupling – Semantic Polymer Retek IBM PIM Informatica Everybody Else Dotcom Catalog 3rd Party Data Vendors Reviews, Ratings, Imagery Dotcom Promotions Online Store Faceted Search SKU SKU SKU SKU SKU SKU SKU SKU Price Point Price Point Price Point Price Point Price Point Price Point Price Point
  47. 47. Long Arrows
  48. 48. Each “interface” was really a chain 1. Extract tables to files 2. Push files across network 3. Load tables into “LZ” 4. Process into “cold” DB 5. Swap hot & cold DBs (hours later) 1. Send message to queue 2. Take message from queue, unwrap, inspect, and dispatch to 1-of-N other queues. 3. Drain queue to file 4. Batch job wakes up 2 times a day, does FTP to remote end 5. Another batch job pulls a reconciliation file, drops file into file system 6. Parser reads the file, shreds it into messages, puts them on another queue
  49. 49. Architecture Qualities in Long Chains Losses accumulate: • Latency strictly worse than the slowest link in the chain. • Availability strictly worse than the least available link. • Throughput strictly worse than the throughput of the worst bottleneck • Security strictly worse than the security of the weakest link
  50. 50. Digging Out
  51. 51. Information Hiding “On the Criteria To Be Used in Decomposing Systems into Modules", David Parnas, CACM, 1972
  52. 52. A KWIC Example • Input Software comprises an endless supply of structures. • Output an endless supply of structures. Software comprises comprises an endless supply of structures. Software endless supply of structures. Software comprises an of structures. Software comprises an endless supply Software comprises an endless supply of structures. structures. Software comprises an endless supply of supply of structures. Software comprises an endless
  53. 53. Modularization 1 1. Input Read EBCDIC characters, store them in core. 6-bit characters packed 4 per word. EOL is a special character. 2. Circular shifter Prepare index; pair of addr of first char of shift, original index of line in input array 3. Alphabetizer Take arrays from 1 & 2, produce new array of pairs like in 2, but in alphabetical order. 4. Output Using arrays from 1 & 3, format output 5. Control Allocate memory, call operations in1 - 4, report errors.
  54. 54. Consider the Effect of Changes For each change case listed here, how many modules have to be changed? • Read and print ASCII instead of EBCDIC. • Stop using packed characters, store one character per word. • Write index for circular shifts to offline storage instead of core to support larger input documents.
  55. 55. Modularization 2 1. Line Storage Offers functional interface: SETCH, GETCH, GETW, DELW, DELLINE 2. Input Reads EBCDIC chars, calls line storage to put them into lines. 3. Circular Shifter Offers same interface as line storage. Makes it appear to have all shifts of all lines. 4. Alphabetizer Offers sort function INIT, and access function iTH that gets a line. 5. Output Repeatedly call iTH on alphabetizer, printing the line. 6. Control Similar to first approach, call each module in sequence.
  56. 56. Consider the Effect of Changes For each change case listed here, how many modules have to be changed? • Read and print ASCII instead of EBCDIC. • Stop using packed characters, store one character per word. • Write index for circular shifts to offline storage instead of core to support larger input documents.
  57. 57. Why is the second one better? • It hides decisions inside modules. • Functional interfaces provide an abstract representation of the underlying data. • Information hiding
  58. 58. Line Line Line Line Line Ordered Ordered Storage Input Circular Shifter Alphabetizer Output "Needs an interface" "Offers an interface" Why did the second modularization survive change better? • Very few data types • Small number of well defined interfaces • Highly composable
  59. 59. LineLine LineLine Line Ordered Storage Input Circular ShifterOutput Ordered Alphabetizer Controller run run Creates all components Composing Interfaces
  60. 60. LineLine LineLine Line Ordered Storage Input Circular ShifterOutput Ordered Alphabetizer Controller run run Creates all components Composing Interfaces Consider each connector with respect to Operational, Development, Semantic, and Functional coupling
  61. 61. Relating Composability Inversely proportional to # of interfaces Inversely proportional to # of data types
  62. 62. Uncoupling
  63. 63. Orthogonality in Software • Separation of concerns • High cohesion within a module or component • Low coupling between modules or components • Little overlap in functionality between modules • Information hiding / decision hiding
  64. 64. Batch Process File System [Container: Network File Share] Stores risk reports Report Distributor [Component: C#] Publishes the report for the web application Publishesrisk reportsto Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Central Monitoring Service [Software System] The bank-wide monitoringand alertingdashboard Trade Data System [Software System] The system of record for trades of type X E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Getstrade datafrom Sendscritical failure alertsto [SNMP] Getscounterparty datafrom Email Component [Component: C#] Sends emails Trade Data Importer [Component: C#] Imports data from the trade data system Reference Data Importer [Component: C#] Imports data from the reference datasystem Report Checker [Component: C#] Checks that the report has been generated by 9 a.m. Singapore time Alerter [Component: C# with SNMP library] Sends SNMPalerts Sendsalerts using Orchestrator [Component: C#] Orchestrates the risk calculation process Sendsemail using Importsdata using Importsdata using Risk Calculator [Component: C#] Does math Report Generator [Component: C# and Microsoft.Office.Interop.Excel] Generates an Excel compatible risk report Generatesthe risk report using Calculatesrisk using Scheduler [Component: Quartz.net] Starts the risk calculation process at 5 p.m. New York time Starts Starts Publishesthe risk report using
  65. 65. Batch Process File System [Container: Network File Share] Stores risk reports Report Distributor [Component: C#] Publishes the report for the web application Publishesrisk reportsto Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Central Monitoring Service [Software System] The bank-wide monitoringand alertingdashboard Trade Data System [Software System] The system of record for trades of type X E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Getstrade datafrom Sendscritical failure alertsto [SNMP] Getscounterparty datafrom Email Component [Component: C#] Sends emails Trade Data Importer [Component: C#] Imports data from the trade data system Reference Data Importer [Component: C#] Imports data from the reference datasystem Report Checker [Component: C#] Checks that the report has been generated by 9 a.m. Singapore time Alerter [Component: C# with SNMP library] Sends SNMPalerts Sendsalerts using Orchestrator [Component: C#] Orchestrates the risk calculation process Sendsemail using Importsdata using Importsdata using Risk Calculator [Component: C#] Does math Report Generator [Component: C# and Microsoft.Office.Interop.Excel] Generates an Excel compatible risk report Generatesthe risk report using Calculatesrisk using Scheduler [Component: Quartz.net] Starts the risk calculation process at 5 p.m. New York time Starts Starts Publishesthe risk report using Risk calculator produces a data structure that the report generator must consume. Example from c4model.com
  66. 66. Batch Process File System [Container: Network File Share] Stores risk reports Report Distributor [Component: C#] Publishes the report for the web application Publishesrisk reportsto Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Central Monitoring Service [Software System] The bank-wide monitoringand alertingdashboard Trade Data System [Software System] The system of record for trades of type X E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Getstrade datafrom Sendscritical failure alertsto [SNMP] Getscounterparty datafrom Email Component [Component: C#] Sends emails Trade Data Importer [Component: C#] Imports data from the trade data system Reference Data Importer [Component: C#] Imports data from the reference datasystem Report Checker [Component: C#] Checks that the report has been generated by 9 a.m. Singapore time Alerter [Component: C# with SNMP library] Sends SNMPalerts Sendsalerts using Orchestrator [Component: C#] Orchestrates the risk calculation process Sendsemail using Importsdata using Importsdata using Risk Calculator [Component: C#] Does math Report Generator [Component: C# and Microsoft.Office.Interop.Excel] Generates an Excel compatible risk report Generatesthe risk report using Calculatesrisk using Scheduler [Component: Quartz.net] Starts the risk calculation process at 5 p.m. New York time Starts Starts Publishesthe risk report using Risk calculator produces a data structure that the report generator must consume. Data importers probably have similar implementation needs Example from c4model.com
  67. 67. Batch Process File System [Container: Network File Share] Stores risk reports Report Distributor [Component: C#] Publishes the report for the web application Publishesrisk reportsto Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Central Monitoring Service [Software System] The bank-wide monitoringand alertingdashboard Trade Data System [Software System] The system of record for trades of type X E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Getstrade datafrom Sendscritical failure alertsto [SNMP] Getscounterparty datafrom Email Component [Component: C#] Sends emails Trade Data Importer [Component: C#] Imports data from the trade data system Reference Data Importer [Component: C#] Imports data from the reference datasystem Report Checker [Component: C#] Checks that the report has been generated by 9 a.m. Singapore time Alerter [Component: C# with SNMP library] Sends SNMPalerts Sendsalerts using Orchestrator [Component: C#] Orchestrates the risk calculation process Sendsemail using Importsdata using Importsdata using Risk Calculator [Component: C#] Does math Report Generator [Component: C# and Microsoft.Office.Interop.Excel] Generates an Excel compatible risk report Generatesthe risk report using Calculatesrisk using Scheduler [Component: Quartz.net] Starts the risk calculation process at 5 p.m. New York time Starts Starts Publishesthe risk report using Risk calculator produces a data structure that the report generator must consume. Data importers probably have similar implementation needs Report checker doesn’t appear to connect with the file system that holds the reports. FS location is latent coupling that will be a nasty surprise later. Example from c4model.com
  68. 68. Batch Process File System [Container: Network File Share] Stores risk reports Report Distributor [Component: C#] Publishes the report for the web application Publishesrisk reportsto Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Central Monitoring Service [Software System] The bank-wide monitoringand alertingdashboard Trade Data System [Software System] The system of record for trades of type X E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Getstrade datafrom Sendscritical failure alertsto [SNMP] Getscounterparty datafrom Email Component [Component: C#] Sends emails Trade Data Importer [Component: C#] Imports data from the trade data system Reference Data Importer [Component: C#] Imports data from the reference datasystem Report Checker [Component: C#] Checks that the report has been generated by 9 a.m. Singapore time Alerter [Component: C# with SNMP library] Sends SNMPalerts Sendsalerts using Orchestrator [Component: C#] Orchestrates the risk calculation process Sendsemail using Importsdata using Importsdata using Risk Calculator [Component: C#] Does math Report Generator [Component: C# and Microsoft.Office.Interop.Excel] Generates an Excel compatible risk report Generatesthe risk report using Calculatesrisk using Scheduler [Component: Quartz.net] Starts the risk calculation process at 5 p.m. New York time Starts Starts Publishesthe risk report using Risk calculator produces a data structure that the report generator must consume. Data importers probably have similar implementation needs Report checker doesn’t appear to connect with the file system that holds the reports. FS location is latent coupling that will be a nasty surprise later. Orchestrator might end need to do lots of data transformation to bridge interfaces. Example from c4model.com
  69. 69. Batch Process File System [Container: Network File Share] Stores risk reports Report Distributor [Component: C#] Publishes the report for the web application Publishesrisk reportsto Reference Data System [Software System] Manages reference data for all counterparties the bank interacts with Central Monitoring Service [Software System] The bank-wide monitoringand alertingdashboard Trade Data System [Software System] The system of record for trades of type X E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Getstrade datafrom Sendscritical failure alertsto [SNMP] Getscounterparty datafrom Email Component [Component: C#] Sends emails Trade Data Importer [Component: C#] Imports data from the trade data system Reference Data Importer [Component: C#] Imports data from the reference datasystem Report Checker [Component: C#] Checks that the report has been generated by 9 a.m. Singapore time Alerter [Component: C# with SNMP library] Sends SNMPalerts Sendsalerts using Orchestrator [Component: C#] Orchestrates the risk calculation process Sendsemail using Importsdata using Importsdata using Risk Calculator [Component: C#] Does math Report Generator [Component: C# and Microsoft.Office.Interop.Excel] Generates an Excel compatible risk report Generatesthe risk report using Calculatesrisk using Scheduler [Component: Quartz.net] Starts the risk calculation process at 5 p.m. New York time Starts Starts Publishesthe risk report using Risk calculator produces a data structure that the report generator must consume. Data importers probably have similar implementation needs Report checker doesn’t appear to connect with the file system that holds the reports. FS location is latent coupling that will be a nasty surprise later. Orchestrator might end need to do lots of data transformation to bridge interfaces. Example from c4model.com
  70. 70. Let’s explore options to uncouple these
  71. 71. Problem: Risk calculator produces a data structure that the report generator must consume. Solutions depend on architectural style Here we’re in a Windows service so we might use a shared library to define the interface. Orchestrator [Component: C#] Orchestrates the risk calculation process Risk Calculator [Component: C#] Does math Report Generator [Component: C# and Microsoft.Office.Interop.Excel] Generates an Excel compatible risk report Generatesthe risk report using Calculatesrisk using
  72. 72. Problem: Redundant implementation details This would be a good place to use a shared library for common implementation. Trade Data Importer [Component: C#] Imports data from the trade data system Reference Data Importer [Component: C#] Imports data from the reference datasystem Orchestrator [Component: C#] Orchestrates the risk calculation process Importsdata using Importsdata using
  73. 73. File System [Container: Network File Share] Stores risk reports Report Distributor [Component: C#] Publishes the report for the web application Publishesrisk reportsto Report Checker [Component: C#] Checks that the report has been generated by 9 a.m. Singapore time Alerter [Component: C# with SNMP library] Sends SNMPalerts Sendsalerts using Scheduler [Component: Quartz.net] Starts Publishesthe risk Problem: Latent coupling about filesystem layout. Solution: A module to hide the decision about filesystem layout from both the Report Distributor and the Report Checker
  74. 74. Just Used Libraries in 3 Ways
  75. 75. Just Used Libraries in 3 Ways • Define meeting point (interface)
  76. 76. Just Used Libraries in 3 Ways • Define meeting point (interface) • Extract repeated functionality
  77. 77. Just Used Libraries in 3 Ways • Define meeting point (interface) • Extract repeated functionality • Isolate shared concept/decision
  78. 78. Find solutions by rotating your perspective • When looking at components, think about modules • When looking at modules, think about components • When looking at data, think about code • When looking at code, think about data
  79. 79. Use all your tools 1. Module structure – layout of your code and libraries 2. Component structure – interactions between runtime components 3. Abstraction – Emphasize similar interfaces & data formats
  80. 80. Coupling • Determines degrees of freedom. • Enables some movements. • Inhibits other movements. • Connects effects.
  81. 81. Kinds of Coupling • Operational • Development • Semantic • Functional
  82. 82. Summary • Hide decisions • Choose degrees of freedom that matter • Avoid semantic polymers • Use static and dynamic structures • Find more instances of fewer, more general interfaces • Prefer explicit to tacit
  83. 83. Uncoupling Michael T. Nygard @mtnygard

×