Table Of ContentLean Architecture for
Agile Software
Development
James Coplien
Gertrud Bjørnvig
A John Wiley and Sons, Ltd, Publication
www.it-ebooks.info
www.it-ebooks.info
Lean Architecture for
Agile Software
Development
James Coplien
Gertrud Bjørnvig
A John Wiley and Sons, Ltd, Publication
www.it-ebooks.info
Thiseditionfirstpublished2010
2010JamesCoplienandGertrudBjørnvig
Registeredoffice
JohnWiley&SonsLtd,TheAtrium,SouthernGate,Chichester,WestSussex,PO198SQ,United
Kingdom
Fordetailsofourglobaleditorialoffices,forcustomerservicesandforinformationabouthowtoapply
forpermissiontoreusethecopyrightmaterialinthisbookpleaseseeourwebsiteatwww.wiley.com.
Therightoftheauthortobeidentifiedastheauthorofthisworkhasbeenassertedinaccordancewith
theCopyright,DesignsandPatentsAct1988.
Allrightsreserved.Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,or
transmitted,inanyformorbyanymeans,electronic,mechanical,photocopying,recordingor
otherwise,exceptaspermittedbytheUKCopyright,DesignsandPatentsAct1988,withouttheprior
permissionofthepublisher.
Wileyalsopublishesitsbooksinavarietyofelectronicformats.Somecontentthatappearsinprint
maynotbeavailableinelectronicbooks.
Designationsusedbycompaniestodistinguishtheirproductsareoftenclaimedastrademarks.All
brandnamesandproductnamesusedinthisbookaretradenames,servicemarks,trademarksor
registeredtrademarksoftheirrespectiveowners.Thepublisherisnotassociatedwithanyproductor
vendormentionedinthisbook.Thispublicationisdesignedtoprovideaccurateandauthoritative
informationinregardtothesubjectmattercovered.Itissoldontheunderstandingthatthepublisher
isnotengagedinrenderingprofessionalservices.Ifprofessionaladviceorotherexpertassistanceis
required,theservicesofacompetentprofessionalshouldbesought.
QuotesfromTheClockoftheLongNow:TimeandResponsibility–TheIdeasBehindtheWorld’sSlowest
ComputerareCopyright2000StewartBrand.ReprintedbypermissionofBasicBooks,amemberof
thePerseusBooksGroup.
AcataloguerecordforthisbookisavailablefromtheBritishLibrary.
ISBN978-0-470-68420-7
Typesetin11/13PalatinobyLaserwordsPrivateLimited,Chennai,India.
PrintedinGreatBritainbyTJInternational,Padstow,Cornwall
www.it-ebooks.info
Dedication
To Trygve Mikkjel Heyerdahl Reenskaug, also a grandfather
www.it-ebooks.info
Publisher’s Acknowledgments
Some of the people who helped bring this book to market include
the following:
EditorialandProduction
VPConsumerandTechnologyPublishingDirector:MichelleLeete
AssociateDirector–BookContentManagement:MartinTribe
AssociatePublisher:ChrisWebb
ExecutiveCommissioningEditor:BirgitGruber
AssistantEditor:ColleenGoldring
PublishingAssistant:EllieScott
ProjectEditor:JulietBooker
ContentEditor:NicoleBurnett
CopyEditor:RichardWalshe
Marketing:
SeniorMarketingManager:LouiseBreinholt
MarketingExecutive:KateBatchelor
CompositionServices:
Compositor:LaserwordsPrivateLimited,Chennai,India
ProofReader:AlexGrey
Indexer:AnnetteMusker
www.it-ebooks.info
Contents
AbouttheAuthors xii
Preface xiii
1 Introduction 1
1.1 TheTouchstones:LeanandAgile 1
1.2 LeanArchitectureandAgileFeatureDevelopment 4
1.3 AgileProduction 7
1.3.1 AgileBuildsonLean 7
1.3.2 TheScopeofAgileSystems 8
1.3.3 AgileandDCI 9
1.4 TheBookinaVerySmallNutshell 10
1.5 LeanandAgile:ContrastingandComplementary 11
1.5.1 TheLeanSecret 14
1.6 LostPractices 14
1.6.1 Architecture 15
1.6.2 HandlingDependenciesbetweenRequirements 15
1.6.3 Foundat ionsforUsability 16
1.6.4 Documentation 16
CodeDoesNotStandAlone 17
Capturingthe‘‘Why’’ 19
1.6.5 CommonSense,Thinking,andCaring 19
1.7 WhatthisBookisNotAbout 21
1.8 Agile,Lean–Oh,Yeah,andScrumandMethodologiesandSuch 22
1.9 HistoryandSuch 24
2 AgileProduction inaNutshell 27
2.1 EngagetheStakeholders 27
2.2 DefinetheProblem 29
2.3 FocusingonWhattheSystemIs:TheFoundationsofForm 30
2.4 FocusingonWhattheSystemDoes:TheSystemLifeblood 32
2.5 DesignandCode 33
2.6 Countdown:3,2,1... 34
v
www.it-ebooks.info
vi Contents
3 Stakeholder Engagement 35
3.1 TheValueStream 35
3.1.1 EndUsersandOtherStakeholdersasValueStreamAnchors 36
3.1.2 ArchitectureintheValueStream 37
3.1.3 TheLeanSecret 38
3.2 TheKeyStakeholders 41
3.2.1 EndUsers 43
PsychingOuttheEndUsers 44
Don’tForgetBehavior 46
TheEndUserLandscape 47
3.2.2 TheBusiness 47
ASpecialNoteforManagers 48
3.2.3 Customers 50
...AsContrastedwithEndUsers 50
‘‘Customers’’intheValueStream 52
3.2.4 DomainExperts 52
NoIvoryTowerArchitects 53
ExpertsinBothProblemandSolutionDomains 54
3.2.5 DevelopersandTesters 55
3.3 ProcessElementsofStakeholderEngagement 57
3.3.1 GettingStarted 58
3.3.2 CustomerEngagement 60
3.4 TheNetworkofStakeholders:TrimmingWastedTime 61
3.4.1 StovepipeVersusSwarm 61
3.4.2 TheFirstThingYouBuild 64
3.4.3 KeeptheTeamTogether 65
3.5 NoQuickFixes,butSomeHope 66
4 Problem Definition 67
4.1 What’sAgileaboutProblemDefinitions? 68
4.2 What’sLeanaboutProblemDefinitions? 68
4.3 GoodandBadProblemDefinitions 70
4.4 ProblemsandSolutions 72
4.5 TheProcessAroundProblemDefinitions 73
4.5.1 ValuetheHuntOverthePrize 73
4.5.2 ProblemOwnership 74
4.5.3 CreepingFeaturism 75
4.6 ProblemDefinitions,Goals,Charters,Visions,andObjectives 76
4.7 Documentation? 77
5 WhattheSystemIs,Part1:LeanArchitecture 79
5.1 SomeSurprisesaboutArchitecture 80
5.1.1 What’sLeanaboutThis? 82
Deliberationand‘‘Pull’’ 83
Failure-ProofConstraintsorPoka-Yoke 83
TheLeanMantrasofConservation,Consistency,andFocus 84
5.1.2 What’sAgileaboutArchitecture? 84
It’sAllAboutIndividualsandInteractions 84
www.it-ebooks.info
Contents vii
PastExcesses 85
DispellingaCoupleofAgileMyths 86
5.2 TheFirstDesignStep:Partitioning 88
5.2.1 TheFirstPartition:DomainFormVersusBehavioralForm 89
5.2.2 TheSecondPartitioning:Conway’sLaw 90
5.2.3 TheRealComplexityofPartitioning 93
5.2.4 DimensionsofComplexity 94
5.2.5 Domains:AParticularlyInterestingPartitioning 94
5.2.6 BacktoDimensionsofComplexity 96
5.2.7 ArchitectureandCulture 100
5.2.8 Wrap-UponConway’sLaw 100
5.3 TheSecondDesignStep:SelectingaDesignStyle 100
5.3.1 ContrastingStructuringwithPartitioning 102
5.3.2 TheFundamentalsofStyle:CommonalityandVariation 104
5.3.3 StartingwithTacitCommonalityandVariation 105
5.3.4 Commonality,Variation,andScope 108
5.3.5 MakingCommonalitiesandVariationsExplicit 111
CommonalityCategories 112
NextSteps 114
5.3.6 TheMostCommonStyle:ObjectOrientation 114
JustWhatisObjectOrientation? 115
5.3.7 OtherStyleswithintheVonNeumannWorld 117
5.3.8 Domain-SpecificLanguagesandApplicationGenerators 120
TheStateoftheArtinDSLs 121
DSLs’PlaceinArchitecture 121
5.3.9 CodifiedForms:PatternLanguages 122
5.3.10 Third-PartySoftwareandOtherParadigms 124
5.4 Documentation? 127
5.4.1 TheDomainDictionary 128
5.4.2 ArchitectureCarryover 128
5.5 HistoryandSuch 129
6 WhattheSystemIs,Part2:Coding ItUp 131
6.1 TheThirdStep:TheRoughFramingoftheCode 131
6.1.1 AbstractBaseClasses 133
6.1.2 Pre-Conditions,Post-Conditions,andAssertions 137
StaticCling 142
6.1.3 AlgorithmicScaling:TheOtherSideofStaticAssertions 144
6.1.4 FormVersusAccessibleServices 146
6.1.5 Scaffolding 147
6.1.6 TestingtheArchitecture 149
UsabilityTesting 149
ArchitectureTesting 149
6.2 RelationshipsinArchitecture 153
6.2.1 KindsofRelationship 153
6.2.2 TestingtheRelationships 155
6.3 NotYourOldProfessor’sOO 155
6.4 HowmuchArchitecture? 159
www.it-ebooks.info
viii Contents
6.4.1 BalancingBUFDandYAGNI 159
6.4.2 OneSizeDoesNotFitAll 160
6.4.3 WhenAreYouDone? 160
6.5 Documentation? 162
6.6 HistoryandSuch 163
7 WhattheSystemDoes:SystemFunctionality 165
7.1 WhattheSystemDoes 166
7.1.1 UserStories:ABeginning 166
7.1.2 EnablingSpecificationsandUseCases 167
7.1.3 HelpingDevelopers,Too 169
7.1.4 YourMileagemayVary 170
7.2 WhoisGoingtoUseOurSoftware? 171
7.2.1 UserProfiles 171
7.2.2 Personas 171
7.2.3 UserProfilesorPersonas? 172
7.2.4 UserRolesandTerminology 173
7.3 WhatdotheUsersWanttoUseOurSoftwarefor? 173
7.3.1 FeatureLists 173
7.3.2 DataflowDiagrams 174
7.3.3 PersonasandScenarios 174
7.3.4 Narratives 174
7.3.5 Behavior-DrivenDevelopment 175
7.3.6 NowthatWe’reWarmedUp... 175
Prototypes 176
TowardsFoundationsforDecisions 176
KnownandUnknownUnknowns 176
UseCasesasaDecisionFramework 177
7.4 WhyDoestheUserWanttoUseOurSoftware? 177
7.5 ConsolidationofWhattheSystemDoes 178
7.5.1 TheHelicopterView 181
Habits:TheDeveloperViewandtheUserView 182
TrimmingtheScope 185
7.5.2 SettingtheStage 186
7.5.3 PlaytheSunnyDayScenario 187
BusinessRules 191
7.5.4 AddtheInterestingStuff 193
7.5.5 UseCasestoRoles 200
RolesfromtheUseCase 201
BridgingtheGapbetweentheBusinessandtheProgrammer 202
7.6 Recap 203
7.6.1 SupporttheUser’sWorkflow 203
7.6.2 SupportTestingClosetoDevelopment 203
7.6.3 SupportEfficientDecision-MakingaboutFunctionality 204
7.6.4 SupportEmergingRequirements 204
7.6.5 SupportReleasePlanning 204
7.6.6 SupportSufficientInputtotheArchitecture 205
7.6.7 SupporttheTeam’sUnderstandingofWhattoDevelop 205
www.it-ebooks.info
Description:Project Editor: Juliet Booker 1.2 Lean Architecture and Agile Feature Development. 4 used well, gets us closer to running code even faster.