SlideShare a Scribd company logo
1 of 89
Uncoupling
Michael T. Nygard
@mtnygard
About the Speaker
Developer
Architect
Operations
Blog: http://www.michaelnygard.com/
Twitter: http://twitter.com/mtnygard
About the Speaker
• Stewards of Clojure & ClojureScript
• Creators of Datomic
• Open source contributions
• Pedestal
• Vase
• Onto
• Simulant
Tensegrity
This Photo by Unknown Author is licensed under CC BY
No-tegrity
This Photo by Unknown Author is licensed under CC BY-NC-SA
Coupling
Scharfenberg Coupler
Watt’s
Linkage
Chebyshev
Linkage
Standard Model
Particle
Interactions
Coupling
Coupling
•Determines degrees of freedom.
Coupling
•Determines degrees of freedom.
•Enables some movements.
Coupling
•Determines degrees of freedom.
•Enables some movements.
•Inhibits other movements.
Coupling
•Determines degrees of freedom.
•Enables some movements.
•Inhibits other movements.
•Connects effects.
Everything is coupled to everything
• Ambient temperature
• Ambient atmosphere
• Acoustic vibrations
• Electromagnetic field
• Gravity
• Higgs field
We cannot attend to all things all the
time
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.)
Analyzing Coupling I
E-mail system
[Software System]
Microsoft Exchange
Sendsanotification that
areport isready to
Email Component
[Component: C#]
Sends emails
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
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
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.
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.
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
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
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.
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.
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
Suppose we use REST instead of SQL?
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
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
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
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
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
What if we invert the flow of control?
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
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.
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.
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.
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.
Coupling was present in all examples –
It is necessary and inescapable
Chains of Coupling
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
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
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
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
Long
Arrows
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
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
Digging Out
Information Hiding
“On the Criteria To Be Used in
Decomposing Systems into Modules",
David Parnas,
CACM, 1972
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
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.
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.
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.
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.
Why is the second one better?
• It hides decisions inside modules.
• Functional interfaces provide an abstract representation of the underlying data.
• Information hiding
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
LineLine
LineLine
Line
Ordered Storage
Input
Circular ShifterOutput
Ordered
Alphabetizer
Controller run
run
Creates all
components
Composing Interfaces
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
Relating Composability
Inversely proportional to # of interfaces
Inversely proportional to # of data types
Uncoupling
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
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
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
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
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
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
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
Let’s explore options to uncouple these
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
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
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
Just Used Libraries in 3 Ways
Just Used Libraries in 3 Ways
• Define meeting point (interface)
Just Used Libraries in 3 Ways
• Define meeting point (interface)
• Extract repeated functionality
Just Used Libraries in 3 Ways
• Define meeting point (interface)
• Extract repeated functionality
• Isolate shared concept/decision
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
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
Coupling
• Determines degrees of freedom.
• Enables some movements.
• Inhibits other movements.
• Connects effects.
Kinds of Coupling
• Operational
• Development
• Semantic
• Functional
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
Uncoupling
Michael T. Nygard
@mtnygard

More Related Content

What's hot

Srivalli Aparna - The Blueprints to Success
Srivalli Aparna - The Blueprints to SuccessSrivalli Aparna - The Blueprints to Success
Srivalli Aparna - The Blueprints to SuccessNeotys_Partner
 
Reactive programming
Reactive programmingReactive programming
Reactive programmingNick Hodge
 
Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...
Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...
Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...Flink Forward
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx javaCongTrung Vnit
 
Reactive programming and RxJS
Reactive programming and RxJSReactive programming and RxJS
Reactive programming and RxJSRavi Mone
 
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Flink Forward
 
Flink Forward San Francisco 2018 keynote: Srikanth Satya - "Stream Processin...
Flink Forward San Francisco 2018 keynote:  Srikanth Satya - "Stream Processin...Flink Forward San Francisco 2018 keynote:  Srikanth Satya - "Stream Processin...
Flink Forward San Francisco 2018 keynote: Srikanth Satya - "Stream Processin...Flink Forward
 
Kafka Connect: Real-time Data Integration at Scale with Apache Kafka, Ewen Ch...
Kafka Connect: Real-time Data Integration at Scale with Apache Kafka, Ewen Ch...Kafka Connect: Real-time Data Integration at Scale with Apache Kafka, Ewen Ch...
Kafka Connect: Real-time Data Integration at Scale with Apache Kafka, Ewen Ch...confluent
 
Building a real time Tweet map with Flink in six weeks
Building a real time Tweet map with Flink in six weeksBuilding a real time Tweet map with Flink in six weeks
Building a real time Tweet map with Flink in six weeksMatthias Kricke
 
Webinar intro-to-central3.7-nov23-2016
Webinar intro-to-central3.7-nov23-2016Webinar intro-to-central3.7-nov23-2016
Webinar intro-to-central3.7-nov23-2016FileCatalyst
 
An Introduction to FileCatalyst
An Introduction to FileCatalystAn Introduction to FileCatalyst
An Introduction to FileCatalystFileCatalyst
 
Service Mesh - Observability
Service Mesh - ObservabilityService Mesh - Observability
Service Mesh - ObservabilityAraf Karsh Hamid
 
Kafka Connect by Datio
Kafka Connect by DatioKafka Connect by Datio
Kafka Connect by DatioDatio Big Data
 
Virtual Flink Forward 2020: Machine learning with Flink in Weibo - Yu Qian
Virtual Flink Forward 2020: Machine learning with Flink in Weibo - Yu QianVirtual Flink Forward 2020: Machine learning with Flink in Weibo - Yu Qian
Virtual Flink Forward 2020: Machine learning with Flink in Weibo - Yu QianFlink Forward
 
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Better Deployments with Sub Environments Using Spring Cloud and Netflix RibbonBetter Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Better Deployments with Sub Environments Using Spring Cloud and Netflix RibbonVMware Tanzu
 
Design patterns for scaling web applications
Design patterns for scaling web applicationsDesign patterns for scaling web applications
Design patterns for scaling web applicationsIvan Dimitrov
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services ArchitectureRanjan Baisak
 
Reactive programming
Reactive programmingReactive programming
Reactive programmingsaykopatt
 
Cloud computing-2 (1)
Cloud computing-2 (1)Cloud computing-2 (1)
Cloud computing-2 (1)JUDYFLAVIAB
 
Building High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic ApplicationsBuilding High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic Applicationsguest40cda0b
 

What's hot (20)

Srivalli Aparna - The Blueprints to Success
Srivalli Aparna - The Blueprints to SuccessSrivalli Aparna - The Blueprints to Success
Srivalli Aparna - The Blueprints to Success
 
Reactive programming
Reactive programmingReactive programming
Reactive programming
 
Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...
Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...
Kostas Tzoumas_Stephan Ewen - Keynote -The maturing data streaming ecosystem ...
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx java
 
Reactive programming and RxJS
Reactive programming and RxJSReactive programming and RxJS
Reactive programming and RxJS
 
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
Virtual Flink Forward 2020: How Streaming Helps Your Staging Environment and ...
 
Flink Forward San Francisco 2018 keynote: Srikanth Satya - "Stream Processin...
Flink Forward San Francisco 2018 keynote:  Srikanth Satya - "Stream Processin...Flink Forward San Francisco 2018 keynote:  Srikanth Satya - "Stream Processin...
Flink Forward San Francisco 2018 keynote: Srikanth Satya - "Stream Processin...
 
Kafka Connect: Real-time Data Integration at Scale with Apache Kafka, Ewen Ch...
Kafka Connect: Real-time Data Integration at Scale with Apache Kafka, Ewen Ch...Kafka Connect: Real-time Data Integration at Scale with Apache Kafka, Ewen Ch...
Kafka Connect: Real-time Data Integration at Scale with Apache Kafka, Ewen Ch...
 
Building a real time Tweet map with Flink in six weeks
Building a real time Tweet map with Flink in six weeksBuilding a real time Tweet map with Flink in six weeks
Building a real time Tweet map with Flink in six weeks
 
Webinar intro-to-central3.7-nov23-2016
Webinar intro-to-central3.7-nov23-2016Webinar intro-to-central3.7-nov23-2016
Webinar intro-to-central3.7-nov23-2016
 
An Introduction to FileCatalyst
An Introduction to FileCatalystAn Introduction to FileCatalyst
An Introduction to FileCatalyst
 
Service Mesh - Observability
Service Mesh - ObservabilityService Mesh - Observability
Service Mesh - Observability
 
Kafka Connect by Datio
Kafka Connect by DatioKafka Connect by Datio
Kafka Connect by Datio
 
Virtual Flink Forward 2020: Machine learning with Flink in Weibo - Yu Qian
Virtual Flink Forward 2020: Machine learning with Flink in Weibo - Yu QianVirtual Flink Forward 2020: Machine learning with Flink in Weibo - Yu Qian
Virtual Flink Forward 2020: Machine learning with Flink in Weibo - Yu Qian
 
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Better Deployments with Sub Environments Using Spring Cloud and Netflix RibbonBetter Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
 
Design patterns for scaling web applications
Design patterns for scaling web applicationsDesign patterns for scaling web applications
Design patterns for scaling web applications
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
 
Reactive programming
Reactive programmingReactive programming
Reactive programming
 
Cloud computing-2 (1)
Cloud computing-2 (1)Cloud computing-2 (1)
Cloud computing-2 (1)
 
Building High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic ApplicationsBuilding High Performance MySql Query Systems And Analytic Applications
Building High Performance MySql Query Systems And Analytic Applications
 

Similar to Uncoupling Systems and Components

Michael Nygard - Uncoupling
Michael Nygard - UncouplingMichael Nygard - Uncoupling
Michael Nygard - UncouplingDevOpsDays DFW
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaborationJulien Pivotto
 
Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)
Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)
Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)Spark Summit
 
Cilium:: Application-Aware Microservices via BPF
Cilium:: Application-Aware Microservices via BPFCilium:: Application-Aware Microservices via BPF
Cilium:: Application-Aware Microservices via BPFCynthia Thomas
 
Redis Streams for Event-Driven Microservices
Redis Streams for Event-Driven MicroservicesRedis Streams for Event-Driven Microservices
Redis Streams for Event-Driven MicroservicesRedis Labs
 
Meetup Microservices Commandments
Meetup Microservices CommandmentsMeetup Microservices Commandments
Meetup Microservices CommandmentsBill Zajac
 
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & RestoreLadies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restoregemziebeth
 
Streaming real time data with Vibe Data Stream
Streaming real time data with Vibe Data StreamStreaming real time data with Vibe Data Stream
Streaming real time data with Vibe Data StreamInformaticaMarketplace
 
RDB - Repairable Database Systems
RDB - Repairable Database SystemsRDB - Repairable Database Systems
RDB - Repairable Database SystemsAlexey Smirnov
 
Data Collection and Consumption
Data Collection and ConsumptionData Collection and Consumption
Data Collection and ConsumptionBrian Greig
 
Detecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDetecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataJames Sirota
 
ClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and howClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and howAltinity Ltd
 
Managing microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - MeetupManaging microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - MeetupJosé Román Martín Gil
 
Data mining final report
Data mining final reportData mining final report
Data mining final reportKedar Kumar
 
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Building A Distributed Build System at Google Scale (StrangeLoop 2016)Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Building A Distributed Build System at Google Scale (StrangeLoop 2016)Aysylu Greenberg
 
Anaconda and PyData Solutions
Anaconda and PyData SolutionsAnaconda and PyData Solutions
Anaconda and PyData SolutionsTravis Oliphant
 
Seattle spark-meetup-032317
Seattle spark-meetup-032317Seattle spark-meetup-032317
Seattle spark-meetup-032317Nan Zhu
 
Cloud to hybrid edge cloud evolution Jun112020.pptx
Cloud to hybrid edge cloud evolution Jun112020.pptxCloud to hybrid edge cloud evolution Jun112020.pptx
Cloud to hybrid edge cloud evolution Jun112020.pptxMichel Burger
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 
Meteor Workshop - Open Sanca
Meteor Workshop - Open SancaMeteor Workshop - Open Sanca
Meteor Workshop - Open SancaPaulo Hecht
 

Similar to Uncoupling Systems and Components (20)

Michael Nygard - Uncoupling
Michael Nygard - UncouplingMichael Nygard - Uncoupling
Michael Nygard - Uncoupling
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaboration
 
Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)
Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)
Towards Benchmaking Modern Distruibuted Systems-(Grace Huang, Intel)
 
Cilium:: Application-Aware Microservices via BPF
Cilium:: Application-Aware Microservices via BPFCilium:: Application-Aware Microservices via BPF
Cilium:: Application-Aware Microservices via BPF
 
Redis Streams for Event-Driven Microservices
Redis Streams for Event-Driven MicroservicesRedis Streams for Event-Driven Microservices
Redis Streams for Event-Driven Microservices
 
Meetup Microservices Commandments
Meetup Microservices CommandmentsMeetup Microservices Commandments
Meetup Microservices Commandments
 
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & RestoreLadies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
 
Streaming real time data with Vibe Data Stream
Streaming real time data with Vibe Data StreamStreaming real time data with Vibe Data Stream
Streaming real time data with Vibe Data Stream
 
RDB - Repairable Database Systems
RDB - Repairable Database SystemsRDB - Repairable Database Systems
RDB - Repairable Database Systems
 
Data Collection and Consumption
Data Collection and ConsumptionData Collection and Consumption
Data Collection and Consumption
 
Detecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking DataDetecting Hacks: Anomaly Detection on Networking Data
Detecting Hacks: Anomaly Detection on Networking Data
 
ClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and howClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and how
 
Managing microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - MeetupManaging microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - Meetup
 
Data mining final report
Data mining final reportData mining final report
Data mining final report
 
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Building A Distributed Build System at Google Scale (StrangeLoop 2016)Building A Distributed Build System at Google Scale (StrangeLoop 2016)
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
 
Anaconda and PyData Solutions
Anaconda and PyData SolutionsAnaconda and PyData Solutions
Anaconda and PyData Solutions
 
Seattle spark-meetup-032317
Seattle spark-meetup-032317Seattle spark-meetup-032317
Seattle spark-meetup-032317
 
Cloud to hybrid edge cloud evolution Jun112020.pptx
Cloud to hybrid edge cloud evolution Jun112020.pptxCloud to hybrid edge cloud evolution Jun112020.pptx
Cloud to hybrid edge cloud evolution Jun112020.pptx
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 
Meteor Workshop - Open Sanca
Meteor Workshop - Open SancaMeteor Workshop - Open Sanca
Meteor Workshop - Open Sanca
 

More from Michael Nygard

Tempo, Maneuverability, and Initiative
Tempo, Maneuverability, and InitiativeTempo, Maneuverability, and Initiative
Tempo, Maneuverability, and InitiativeMichael Nygard
 
Manueverable architecture
Manueverable architectureManueverable architecture
Manueverable architectureMichael Nygard
 
Architecture without an end state
Architecture without an end stateArchitecture without an end state
Architecture without an end stateMichael Nygard
 
Chef in the cloud and on the ground code freeze 2012
Chef in the cloud and on the ground   code freeze 2012Chef in the cloud and on the ground   code freeze 2012
Chef in the cloud and on the ground code freeze 2012Michael Nygard
 

More from Michael Nygard (6)

Tempo, Maneuverability, and Initiative
Tempo, Maneuverability, and InitiativeTempo, Maneuverability, and Initiative
Tempo, Maneuverability, and Initiative
 
Manueverable architecture
Manueverable architectureManueverable architecture
Manueverable architecture
 
Architecture without an end state
Architecture without an end stateArchitecture without an end state
Architecture without an end state
 
Chef in the cloud and on the ground code freeze 2012
Chef in the cloud and on the ground   code freeze 2012Chef in the cloud and on the ground   code freeze 2012
Chef in the cloud and on the ground code freeze 2012
 
The Big Red Button
The Big Red ButtonThe Big Red Button
The Big Red Button
 
Where to put_my_data
Where to put_my_dataWhere to put_my_data
Where to put_my_data
 

Recently uploaded

Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 

Recently uploaded (20)

Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 

Uncoupling Systems and Components

  • 2. About the Speaker Developer Architect Operations Blog: http://www.michaelnygard.com/ Twitter: http://twitter.com/mtnygard
  • 3. About the Speaker • Stewards of Clojure & ClojureScript • Creators of Datomic • Open source contributions • Pedestal • Vase • Onto • Simulant
  • 4.
  • 5.
  • 6. Tensegrity This Photo by Unknown Author is licensed under CC BY
  • 7. No-tegrity This Photo by Unknown Author is licensed under CC BY-NC-SA
  • 15. Coupling •Determines degrees of freedom. •Enables some movements.
  • 16. Coupling •Determines degrees of freedom. •Enables some movements. •Inhibits other movements.
  • 17. Coupling •Determines degrees of freedom. •Enables some movements. •Inhibits other movements. •Connects effects.
  • 18.
  • 19.
  • 20.
  • 21. Everything is coupled to everything • Ambient temperature • Ambient atmosphere • Acoustic vibrations • Electromagnetic field • Gravity • Higgs field
  • 22. We cannot attend to all things all the time
  • 23. 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.)
  • 24. Analyzing Coupling I E-mail system [Software System] Microsoft Exchange Sendsanotification that areport isready to Email Component [Component: C#] Sends emails
  • 25. 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
  • 26. 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
  • 27. 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.
  • 28. 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.
  • 29.
  • 30. 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
  • 31. 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
  • 32. 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.
  • 33. 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.
  • 34. 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
  • 35. Suppose we use REST instead of SQL?
  • 36. 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
  • 37. 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
  • 38. 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
  • 39. 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
  • 40. 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
  • 41. What if we invert the flow of control?
  • 42. 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
  • 43. 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.
  • 44. 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.
  • 45. 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.
  • 46. 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.
  • 47. Coupling was present in all examples – It is necessary and inescapable
  • 49. 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
  • 50. 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
  • 51. 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
  • 52. 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
  • 54. 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
  • 55. 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
  • 57. Information Hiding “On the Criteria To Be Used in Decomposing Systems into Modules", David Parnas, CACM, 1972
  • 58. 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
  • 59. 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.
  • 60. 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.
  • 61. 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.
  • 62. 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.
  • 63. Why is the second one better? • It hides decisions inside modules. • Functional interfaces provide an abstract representation of the underlying data. • Information hiding
  • 64. 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
  • 66. 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
  • 67. Relating Composability Inversely proportional to # of interfaces Inversely proportional to # of data types
  • 69. 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
  • 70. 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
  • 71. 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
  • 72. 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
  • 73. 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
  • 74. 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
  • 75. 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
  • 76. Let’s explore options to uncouple these
  • 77. 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
  • 78. 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
  • 79. 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
  • 80. Just Used Libraries in 3 Ways
  • 81. Just Used Libraries in 3 Ways • Define meeting point (interface)
  • 82. Just Used Libraries in 3 Ways • Define meeting point (interface) • Extract repeated functionality
  • 83. Just Used Libraries in 3 Ways • Define meeting point (interface) • Extract repeated functionality • Isolate shared concept/decision
  • 84. 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
  • 85. 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
  • 86. Coupling • Determines degrees of freedom. • Enables some movements. • Inhibits other movements. • Connects effects.
  • 87. Kinds of Coupling • Operational • Development • Semantic • Functional
  • 88. 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

Editor's Notes

  1. You’ve been working in your system for a year. Things are going well.
  2. You think it’s made of small pieces arranged beautifully. Until the day everything changes. You get the one new requirements that just doesn’t fit. You move one part, but that forces you to change something on the other side of the world. You change that and find that a different part breaks for no apparent reason.
  3. You begin to realize that your system is not a lovely arrangement of isolated pieces. It is more like a nest of opposing forces, it wants to fly apart or collapse at any time. It’s only held back from chaos by a network of interwoven dependencies. You pull one part and it tugs on a dozen others. You push a piece and it pushes back.
  4. You fight. The system fights back. Eventually, you are consumed by the chaos. A rewrite starts to sound better and better. After all, it should only take two weeks. You have fallen prey to coupling. This is the “choose your own adventure” page that says “You have died, go to page 1.”
  5. As we dissolve large systems into pieces, coupling ever more important. Moving from static equilibrium to dynamic equilibrium. Coupling is a dirty word in our industry. “Coupled” basically means “bad.” Coupling keeps us from making changes. It keeps our business from evolving. Coupling not a dirty word in other fields. Coupling means connector. It enables structure.
  6. Coupling as safety. Keeping two parts together.
  7. Coupling allows matter to exist.
  8. Knee bends in one plane. Doesn’t bend in other planes. (Not without damage anyway!)
  9. Knee bends in one plane. Doesn’t bend in other planes. (Not without damage anyway!)
  10. Knee bends in one plane. Doesn’t bend in other planes. (Not without damage anyway!)
  11. Knee bends in one plane. Doesn’t bend in other planes. (Not without damage anyway!)
  12. Knee bends in one plane. Doesn’t bend in other planes. (Not without damage anyway!)
  13. Note: Sometimes called the "Death Star" moon. Two tone coloring observed by Giovanni Cassini. In 2009, discovered that the likely cause is Phoebe.
  14. This is Phoebe.  213 km mean diameter.
  15. Note: Phoebe has a ring, Saturn's largest and most diffuse. 40x biggest than the entirety of the other rings. Ablated from Phoebe by micrometeorites. Solar pressure causes ring material to spiral toward Saturn. Swept up by Iapetus (which is tidally locked to Saturn.)
  16. Tell story of screaming at disks.
  17. What could we do about this to reduce the degree of coupling.
  18. What could we do about this to reduce the degree of coupling.
  19. What could we do about this to reduce the degree of coupling.
  20. What could we do about this to reduce the degree of coupling.
  21. What could we do about this to reduce the degree of coupling.
  22. Assume this is a direct database connection
  23. Assume this is a direct database connection
  24. Assume this is a direct database connection
  25. Assume this is a direct database connection
  26. Assume this is a direct database connection
  27. Assume this is a direct database connection
  28. Assume this is a direct database connection
  29. Assume this is a direct database connection
  30. Assume this is a direct database connection
  31. Assume this is a direct database connection
  32. Assume this is a direct database connection
  33. Assume this is a direct database connection
  34. Assume this is a direct database connection
  35. Assume this is a direct database connection
  36. Assume this is a direct database connection
  37. But not as difficult to manage in every case.
  38. SKU = “stock keeping unit”.
  39. SKU = “stock keeping unit”.
  40. SKU = “stock keeping unit”.
  41. SKU = “stock keeping unit”.
  42. Easy to see how this works. Module 1 creates an array which 2, 3, 4 use. Module 2 creates array which 3 uses. Module 3 creates array that 4 uses.
  43. I expect: 1: (1, 4); 2: (1, 2, 3, 4); 3: (2, 3, 4); 4: (1, 2, 3, 4) Change eff. = (20 – 11)/20 = 45%
  44. Interesting difference is the idea of defined interfaces and multiple implementors of the interface.
  45. I expect: 1: (1, 4); 2: (1, 2, 3, 4); 3: (2, 3, 4); 4: (1, 2, 3, 4) Change eff. = (20 – 11)/20 = 45%
  46. Operational high in all cases… was running in a single process. Development weakened thanks to functional interface. Semantic reduced due to interface instead of direct access to arrays. Functional also reduced by not having array manip & char packing/unpacking in all modules.
  47. Explain what this view is.
  48. Architecture by tesseract
  49. Knee bends in one plane. Doesn’t bend in other planes. (Not without damage anyway!)
  50. This is Phoebe.  213 km mean diameter.