YOW West 2017
OUR SPONSORS
YOW West 2017 OUR SPONSORS Cost of a dependency Lee Campbell - - PowerPoint PPT Presentation
YOW West 2017 OUR SPONSORS Cost of a dependency Lee Campbell Author of eBook and website IntroToRx.com Dev at Cashies Conference Circuit Trainer Practical Rx Project success Longevity How long will your project need to be used for? How
OUR SPONSORS
Dev at Cashies Trainer – Practical Rx
Author of eBook and website IntroToRx.com Conference Circuit
How long will your project need to be used for? How long will it need to be maintained for? How long will each of it’s dependent parts be relevant for?
Single man dependencies vs Fungible assets Technology lock-in vs Technology agnostic
A COLLECTION OF EXPERIENCES
COMPOUNDING EFFECTS
\GUI \Server \Datastore
\GUI
\Server
\Datastore
\GUI
\Server
\Datastore
\GUI
\Server
\Datastore
\GUI
\Server
\Framework
\Datastore
Who defines requirements and budget for each part of the system? Can this progression be maintained for the expected lifetime of the system? Do these things change together?
Build times increase Testing burden Friction to innovate Blurry boundaries Lack of responsibility
View Models Translators Validators
Testing now becomes an exercise in mocking Debugging is always a case of hitting finding "implementations of"
Focus is diluted Cognitive load is increased through indirection
We can also take dependencies on interface define by someone else So maybe you just mock out your
But these are normally defined in their package, with the implementation.
Deep system dependencies
My application
My application
Non linear growth 3 deep with each dependency having 3 children 1 + 3 + 9 = 13 total
Non linear growth Add 2 more layers (5 layers) 1 + 3 + (9 * 13) = 121 total
1 1 1 1 13 13 13 13 13 13 13 13 13
Non linear growth Add 2 more layers (7 layers) 1 + 3 + (9 * 121) = 1093 total
1 1 1 1 121 121 121 121 121 121 121 121 121
Packages that include
I depend on abstractions But they also depend on abstractions So I have deep call stacks
Deep call stacks
https://twitter.com/gregyoung/status/ 734713437146734592
Cognitive load increases exponentially with each layer Technical freedom is slowly eroded as each layer add more dependencies
Build times Test times Lack of Ownership
Magic Build scripts Using the real IoC Container in tests AOP
Cant be rationalised about Emergent behaviour (bugs, not features)
IS THERE A BETTER WAY?
FEATURE DEPENDENCY
Ways to identify
"Decompose your applications based on volatility" - Juval Lowy
\GUI
\Server
\Framework
\Datastore
FeatureA
FeatureB
FeatureC
GUI Lib Comms Lib Persistence Lib
Inherently parallel to build and test Forces the discussion about design by contract Can reduce the knee jerk reaction to share code
What is the benefit of this being injected? Can it be encapsulated into this unit?
Instead of Reuse being a goal, aim for encapsulation. Rule of 3 Reuse is an evolution
Avoid dependencies that require finesse to remove Single line to cut
A DOMAIN MODEL WITH NO DEPENDENCIES
Only depends on .NET
The Domain Model defines the interfaces for the things it needs
Can you tell what technology we are using here? Consumers are responsible to implement it We are isolating the business logic from our technology choices.
Hexagonal Architecture (Alistair Cockburn) Ports and Adapters Onion Architecture
IRepository is one of our ports We may have a SQLServer adapter, or perhaps a MongoDB one
App Service Domain Model
Data Service
ORM Data store
Comms Service
Serialization Messaging platform
Domain Model Comms adapter Data adapter App Service Data store Comms
CODE BREAK OUT
I can just use normal old Decorator pattern
Multi repo
Encapsulation
Inversion of Dependencies / Ports and Adapter
Cognitive load Onboarding friction Technical Freedom Time to prod
LeeCampbell.com Implementing Domain Driven Design – Vaugh Vernon Greg Young – Good enough software Hex Arch – Alistair Cockburn
Having the computer to do what you want isn’t the hard part, having a person understand the intent of your code is.