software is not a building - designing technical architecture for change

45
SOFTWARE ISN’t a building Designing technical architecture for change by: David Fox, Director of Technical Architecture Design

Upload: cantina

Post on 09-Jan-2017

232 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Software is not a Building - Designing Technical Architecture for Change

SOFTWARE ISN’t a buildingDesigning technical architecture for change

by: David Fox, Director of Technical Architecture Design

Page 2: Software is not a Building - Designing Technical Architecture for Change

agenda• Buildings vs So!ware • Tension Between Malleability and Complexity • Barriers to Change in So!ware and Their Solu"ons

Page 3: Software is not a Building - Designing Technical Architecture for Change

ArchitectsAll they do is draw boxes and lines on whiteboards.

Who needs them?

Page 4: Software is not a Building - Designing Technical Architecture for Change

building architecture

Page 5: Software is not a Building - Designing Technical Architecture for Change

SOFTWARE architecture

Page 6: Software is not a Building - Designing Technical Architecture for Change

Building ARCHITECTURE

FAIL

Page 7: Software is not a Building - Designing Technical Architecture for Change

What makes software hard to change?

Page 8: Software is not a Building - Designing Technical Architecture for Change

“If you pick any one aspect of so!ware then you can make it easy to change…making

everything easy to change makes the en"re system very complex. Complexity is what

makes so!ware hard to change.”

Ralph Johnson speaking with Mar"n Fowler - “Who Needs an Architect?”h#p://mar"nfowler.com/ieeeSo!ware/whoNeedsArchitect.pdf

Page 9: Software is not a Building - Designing Technical Architecture for Change

Barriers to change• Lack of Design • Coupling • Invasive APIs • Dehydra"on • Infrastructure Investments • Team • Technical Debt

Page 10: Software is not a Building - Designing Technical Architecture for Change

LACK OF DESIGNTurns out you do need that architect designer

Page 11: Software is not a Building - Designing Technical Architecture for Change

DESIGN SYMPTOMS• “Let’s just use Framework X” before star"ng to think about design

• “Let’s just start coding”

• No clear design leader(s)/ownership

• Developers le! to decide on components without overall direc"on

• Ge#ng bogged down in details

Page 12: Software is not a Building - Designing Technical Architecture for Change

DESIGN RECOMMENDATIONS• Developers must have some idea of the overall design before coding begins

• Team must agree on design and be aware of general design and roles of components

• Work “outside in”. Use the walking skeleton.

• Designer(s) must work with the team throughout development and review work directly to ensure design is being followed

• Choose frameworks based on your architecture, not the other way around

Page 13: Software is not a Building - Designing Technical Architecture for Change

Coupling

Page 14: Software is not a Building - Designing Technical Architecture for Change

Connascence• So!ware quality metric and taxonomy of coupling

• Used by Meilir Page-Jones in ACM ar"cle “Comparing Techniques by Means of Encapsula"on and Connascence” in 1992

• Expanded in “What every programmer should know about object-oriented design” in 1996

• Visit h$p://connascence.io for more info

Page 15: Software is not a Building - Designing Technical Architecture for Change

Connascence

• Name • Type • Meaning • Posi"on • Algorithm • Execu"on • Timing • Values • Iden"ty

• Strength • Locality • Degree

Connascences Proper!es

Image source: http://connascence.io/locality.html

Page 16: Software is not a Building - Designing Technical Architecture for Change

Coupling recommendations• Iden"fy strong connascence and refactor to weak wherever possible

• Boundaries between components, par"cularly foreign APIs, are essen"al

• Adding layers does add (some) complexity, but:

• Reveals intent in the ubiquitous language of the domain

• Eases re-implementa"on of components

• Improves testability

• Learn and follow good prac"ces, such as SOLID

Page 17: Software is not a Building - Designing Technical Architecture for Change

Invasive APIsand leaky abstrac"ons

Page 18: Software is not a Building - Designing Technical Architecture for Change

INVASIVE API SYMPTOMS• Dependencies on implementa"on reach up through layers

• Specialized implementa"on types are exposed in APIs

• Custom types are used when simple, built-in types would suffice

• Infrastructure is needed in other layers to support a leaky abstrac"on

Page 19: Software is not a Building - Designing Technical Architecture for Change

INVASIVE API recommendations• Always put boundaries between your domain and foreign APIs

• Translate data structures at boundary

• Ensure core of domain remains pure and free of external dependencies

• Use standard types that don’t require clients to import implementa"on details

• Prefer libraries that use open standards

• Unless the infrastructure really is transparent, favor designs where boundaries are enforced, and don’t leak outside the component

• Prefer external mapping or configura"on over annota"ons

Page 20: Software is not a Building - Designing Technical Architecture for Change

DehydrationThere is such a thing as too DRY

Page 21: Software is not a Building - Designing Technical Architecture for Change

Dehydration SYMPTOMS• Confla"ng persistence, domain, and presenta"on concerns

• “One Big Model”

• Sharing code between models in separate contexts

• Func"ons used by mul"ple clients contain special cases specific to those clients

Page 22: Software is not a Building - Designing Technical Architecture for Change

Dehydration RECOMMENDATIONS• Don’t try to be DRY at the cost of strong coupling

• Denormaliza"on is OK

• Consider the true impact of eventual consistency

• Separate aspects of models into bounded contexts

• If a model is suppor"ng mul"ple concerns, and has code specific to those use cases, it’s a sign mul"ple models might help, even if they end up being very similar

• It’s OK to have similar code in mul"ple places, especially separate modules

Page 23: Software is not a Building - Designing Technical Architecture for Change

Infrastructure investments

We already paid for the support contract!

Page 24: Software is not a Building - Designing Technical Architecture for Change

investments symptoms• We already bought the license to “Database X”, so we have to use that

• All our code is wri$en to use “Middleware Y”, so it’s hard to change

• We already hired our team for their experience with “Framework Z”

Page 25: Software is not a Building - Designing Technical Architecture for Change

investments recommendations• Wait un"l the “last responsible moment” to decide on specific technology

investments

• “Fake it un"l you make it” to put off implementa"on of components un"l all requirements are known

• Design in terms of classes of technology rather than specific technologies

• Prefer libraries over large, invasive frameworks - and/or -

• Segregate implementa"ons using boundaries

• Prefer open-source so!ware

Page 26: Software is not a Building - Designing Technical Architecture for Change

Team

Page 27: Software is not a Building - Designing Technical Architecture for Change

TEAM SYMPTOMS• Our developers only know “Framework X”

• Our developers aren’t sophis"cated enough to use “Technology Y”

• Developers don’t want to learn how to write SQL correctly

• The front-end team is responsible for that

• We have to run all updates through the database team

• Only Steve knows that par"cular part of the code

Page 28: Software is not a Building - Designing Technical Architecture for Change

TEAM recommendations• Invest in and encourage training in broad skill areas, not just technologies

• Structure teams so that more experienced engineers work on design and modeling with less-experienced engineers

• Less experienced engineers review more experienced engineers’ code

• Push engineers to become more full-stack

• Don’t choose technologies only based on “what the team knows”

Page 29: Software is not a Building - Designing Technical Architecture for Change

“organiza"ons which design systems ... are constrained to produce designs which are copies of the communica"on structures of

these organiza"ons”

Melvin Conway

Page 30: Software is not a Building - Designing Technical Architecture for Change

TEAM recommendations• Base designs on the problem domain, not team structure, and shape the team

around it

• Group developers based on bounded contexts and func"onality, not applica"on layers or technologies

• Create smaller mul"-disciplinary teams

• Allow for direct communica"on between groups

• Integrate constantly

Page 31: Software is not a Building - Designing Technical Architecture for Change

Technical DebtAdding features no ma$er what the cost

Page 32: Software is not a Building - Designing Technical Architecture for Change

Technical Debt SYMPTOMS• Velocity isn’t nearly what it was when the project began

• We have to add features, there’s no "me to refactor

• This part of the code is a mess! We need to rewrite it

• We can refactor that code without breaking something

Page 33: Software is not a Building - Designing Technical Architecture for Change

Technical Debt recommendations• Pay down technical debt as you go

• If you must defer paying down debt to complete features, try:

• Refactor just enough to add a feature without incurring more debt (“the Boy Scout Rule”)

• Have a “cleanup” phase a!er the feature push

• Ensure that there are tests in place so refactoring can be done regularly and with confidence

• Prescrip"ve refactoring over “rewrites”. If you make it part of development, it isn’t “extra expense”.

Page 34: Software is not a Building - Designing Technical Architecture for Change

LACK OF DESIGNDo overall design up front and empower leaders to guide

developers in implementa"on.

Page 35: Software is not a Building - Designing Technical Architecture for Change

COUPLINGLearn about connascence, reduce strong to weak, and add

boundaries to segregate components.

Page 36: Software is not a Building - Designing Technical Architecture for Change

INVASIVE APISTranslate 3rd party APIs into your domain model and add

boundaries to prevent leaky abstrac"ons.

Page 37: Software is not a Building - Designing Technical Architecture for Change

DEHYDRATIONSacrifice DRYness if it reduces coupling. Split up large models by bounded contexts. Reduce scope of shared

dependencies.

Page 38: Software is not a Building - Designing Technical Architecture for Change

INFRASTRUCTUREWait un"l the “last responsible moment” and “fake it un"l you make it” to ensure procurements reflect actual needs

Page 39: Software is not a Building - Designing Technical Architecture for Change

TEAMInvest in your team knowledge. Increase communica"on.

Your team structure is your architecture.

Page 40: Software is not a Building - Designing Technical Architecture for Change

TECHNICAL DEBTPay it down as you go so it doesn’t grow out of control. Refactoring is not rewri"ng and is part of development.

Page 41: Software is not a Building - Designing Technical Architecture for Change

evolving architectureHow Buildings Learn: What Happens A!er They're Built By: Stewart Brand

Page 42: Software is not a Building - Designing Technical Architecture for Change

About cantina• Boston-based digital design and development agency

• Founded in 2007, 60+ employees

• We help clients like Putnam Investments, John Hancock, CUNA Mutual Group, Epsilon, and Pearson deliver be$er digital products for their customers

• Can"na’s people turn great ideas into digital reality, execu"ng with the best design and development techniques available

Page 43: Software is not a Building - Designing Technical Architecture for Change

thank you

Page 44: Software is not a Building - Designing Technical Architecture for Change

References• “Who Needs an Architect?”

h$p://mar"nfowler.com/ieeeSo!ware/whoNeedsArchitect.pdf

• What Every Programmer Should Know About Object-Oriented Design h$p://www.amazon.com/Every-Programmer-Should-Object-Oriented-Design/dp/0932633315/ref=sr_1_1?qid=1446730637

• Connascence h$p://connascence.io

• How Buildings Learn: What Happens A!er They're Builth$p://www.amazon.com/How-Buildings-Learn-Happens-Theyre/dp/0140139966

Page 45: Software is not a Building - Designing Technical Architecture for Change

References• Growing Object-Oriented So!ware, Guided by Tests

h$p://www.amazon.com/Growing-Object-Oriented-So!ware-Guided-Tests/dp/0321503627/ref=sr_1_1?s=books&ie=UTF8&qid=1446730723