Models, Sketches and Everything In-Between Simon Brown Coding the - - PowerPoint PPT Presentation

models sketches and everything in between
SMART_READER_LITE
LIVE PREVIEW

Models, Sketches and Everything In-Between Simon Brown Coding the - - PowerPoint PPT Presentation

Models, Sketches and Everything In-Between Simon Brown Coding the Architecture Eoin Woods Artechra Software Architect 2014 October 2014, London Welcome Its hello from me Simon Brown, Coding the Architecture And


slide-1
SLIDE 1

Models, Sketches and Everything In-Between

Simon Brown Coding the Architecture
 Eoin Woods Artechra

  • Software Architect 2014


October 2014, London

slide-2
SLIDE 2

Welcome

  • It’s hello from me
  • Simon Brown, Coding the Architecture
  • And hello from him
  • Eoin Woods, Artechra
slide-3
SLIDE 3

Our Agenda

  • Simon Says …
  • Eoin Says …
  • Questions and Queries:
  • Q1. Modelling - Why Bother?
  • Q2. Models and Agility
  • Q3. How to Do It?
  • Q4. UML - Worth the Hassle?
  • Q5. Modelling in the Large vs the Small
  • Summary and Conclusions
slide-4
SLIDE 4

Background

  • We’ve been talking about software modelling for ages
  • We both think its a good idea (in moderation)
  • Simon likes boxes and lines, Eoin likes UML (sort of)
  • Simon has C4, Eoin has V&P (with Nick Rozanski)
  • We’ve both inflicted a book on the world …
  • We’d like to work out what the real answer is today
  • We’ve got questions, but yours are probably better
slide-5
SLIDE 5

The Point of Modelling

  • Simon:
  • How do you understand what you’re building?
  • How do you explain it to the rest of the team?
  • The trick is not getting stuck in analysis paralysis.
  • Eoin:
  • Main problem with not modelling is lack of intellectual control
  • Main problem with modelling is believing that modelling is an

end in itself

slide-6
SLIDE 6

Some Opinions

slide-7
SLIDE 7

Simon Says …

slide-8
SLIDE 8

How do we

communicate

software architecture?

slide-9
SLIDE 9

9 out of 10 people don’t use UML

(in my experience)

slide-10
SLIDE 10

It’s usually difficult to show the entire design on a single diagram Different views of the design can be used to manage complexity and highlight different aspects

  • f the solution
slide-11
SLIDE 11
slide-12
SLIDE 12

Do the names

  • f those views make

sense?

Development vs Physical Process vs Functional Conceptual vs Logical Development vs Implementation Physical vs Implementation Physical vs Deployment

slide-13
SLIDE 13

Logical and development

views are often

separated

slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16

In my experience,

software teams aren’t able to effectively communicate the software architecture

  • f their systems
slide-17
SLIDE 17

Abstraction

is about reducing detail

rather than creating a different representation

slide-18
SLIDE 18

Abstractions help us

reason about

a big and/or complex software system

slide-19
SLIDE 19

A common set of abstractions

is more important than a common notation

slide-20
SLIDE 20

Sketches are maps

that help a team navigate a complex codebase

slide-21
SLIDE 21

Static Model

(at different levels
  • f abstraction)

Runtime/ Behavioural Deployment Infrastructure Operation & Support Data

slide-22
SLIDE 22

Does your code reflect the

abstractions

that you think about?

slide-23
SLIDE 23

My focus is primarily on the

static structure

  • f software, which is ultimately about

code

slide-24
SLIDE 24

Software developers are the most important

stakeholders

  • f software architecture
slide-25
SLIDE 25

Eoin Says …

slide-26
SLIDE 26

The point is that …

  • Some models worth creating are worth

preserving

  • Models capture things that code can’t
  • Sketches the place to start … but limited
  • Models communicate, so ground rules are

useful - UML is a good base to work from

slide-27
SLIDE 27

What is modelling?

  • A model is any simplified representation of reality
  • a spreadsheet of data
  • a Java domain model
  • a UML model
  • Modelling represents concepts to allow some

aspect of them to be understood

slide-28
SLIDE 28

Why create models?

Communicate Understand Record

slide-29
SLIDE 29

Models vs diagrams

  • A diagram is a purely visual representation
  • A model contains definitions (and possibly a diagram)
  • In UML terms diagrams provide views of a model
slide-30
SLIDE 30

Types of Model

Low Detail High Detail High Precision Low Precision

slide-31
SLIDE 31

Uses for models

  • Consistency
  • change once, its changed everywhere
  • Reporting
  • ask your model a question
  • “what is connected to the Flange Modulator Service?”
  • Checking and Validation
  • do I have a deployment node for every piece of the system?
  • how complicated is the system going to be?
  • Sharing information
  • generate many views of a single model
  • Powerpoint, wiki, tables, ...
slide-32
SLIDE 32

An Analogy

  • Would you use JSON to represent your shopping list?
  • I personally use a PostIt™ note
  • Would you hold system configuration in free text?
  • I personally would rather XML or JSON
  • Long lived models are valuable … store them as data
  • UML is a practical option for machine readable models
slide-33
SLIDE 33

Some Questions and Answers

slide-34
SLIDE 34
  • Q1. Modelling - Why Bother?
  • Simon:
  • A model makes it easy to step back and see the big picture.
  • A model aids communication, inside and outside of the team.
  • Modelling provides a ubiquitous language with which to

describe software.

  • Eoin:
  • Modelling helps you understand what you have and need
  • You can’t understand all of the detail anyway
  • Code is in fact a model, we just don’t think of it as such
slide-35
SLIDE 35
  • Q2. Modelling and Agility
  • Simon:
  • Good communication helps you move fast.
  • A model provides long-lived documentation.
  • A model provides the basis for structure, vision and risks.
  • Eoin:
  • No fundamental conflict - “model with a purpose” (Daniels)
  • Working software over comprehensive documentation
  • Agility should be for the long haul, not this sprint
  • Can you know all the feed dependencies from your system?
slide-36
SLIDE 36
  • Q3. How to Do It?
  • Simon:
  • Start with the big picture, and work into the detail.
  • Stop when you get to a “sufficient” level of detail.
  • Include technology choices!
  • Eoin:
  • Start small, start with a definite purpose
  • Start with a whiteboard or a napkin or an A4 sheet
  • Skip Visio and Omnigraffle … get a tool, get a model
slide-37
SLIDE 37
  • Q4. UML - Is It Worth the Hassle?
  • Simon:
  • No.
  • Eoin:
  • Maybe … depends what you need
  • Would you write a shopping list in JSON? Would you store

configuration settings in a free text file?

  • If you have long lived models and want to use the data then

yes, highly tailored UML is worth the effort

slide-38
SLIDE 38
  • Q5. Modelling in the Large vs the Small
  • Simon:
  • Sketches will quickly become out of date.
  • Reverse-engineering tends to lead to cluttered diagrams.
  • Many small diagrams are better than one uber-diagram.
  • Eoin:
  • A large system means you need help from a computer to

understand it

  • However large your model, the code is still “the truth”
  • Modelling languages scale like programming languages
slide-39
SLIDE 39

How We Do It

slide-40
SLIDE 40

Simon

slide-41
SLIDE 41

Agree on a simple set of abstractions that the whole team can use to communicate

Class Class Class Component Component Component

Container

(e.g. web application, application server, standalone application, browser, database, file system, etc)

Container

(e.g. web application browser, database, f

ntainer

, database, file system, etc)

Software System

slide-42
SLIDE 42

The C4 model

Classes

Component or pattern implementation details

System Context

The system plus users and system dependencies

Containers

The overall shape of the architecture and technology choices

Components

Logical components and their interactions within a container

slide-43
SLIDE 43

Context

  • What are we

building?

  • Who is using it?

(users, actors, roles, personas, etc)

  • How does it fit into

the existing IT environment?

(systems, services, etc)

slide-44
SLIDE 44

Containers

  • What are the high-level

technology decisions?

(including responsibilities)

  • How do containers

communicate with one another?

  • As a developer, where

do I need to write code?

slide-45
SLIDE 45

Components

  • What components/

services is the container made up of?

  • Are the technology

choices and responsibilities clear?

slide-46
SLIDE 46

structurizr.com

slide-47
SLIDE 47

Eoin

slide-48
SLIDE 48

Common Types of Models

  • System Environment - context view
  • Run Time Structure - functional view
  • Software meets Infrastructure - deployment view
  • Stored and In-Transit Data - information view
slide-49
SLIDE 49

The Viewpoints and Perspectives model

Context View


(where the system lives)

Functional View


(runtime structure)

Information View


(data moving & at rest )

Development View


(code structures)

Concurrency View


(processes and threads)

Deployment View


(system meets infra)

Operational View


(keeping it running)

slide-50
SLIDE 50

Context View

C
  • m
p
  • n
e n t d i a g r a m w i t h a s i n g l e “ c
  • m
p
  • n
e n t ”
  • y
  • u
r s y s t e m E x t e r n a l s y s t e m s r e p r e s e n t e d a s < < e x t e r n a l > > c
  • m
p
  • n
e n t s I n t e r a c t i
  • n
s w i t h e x t e r n a l s y s t e m s u s i n g n a m e d a s s
  • c
i a t i
  • n
s U s e r g r
  • u
p s r e p r e s e n t e d b y a c t
  • r
s
slide-51
SLIDE 51

Functional View

P a c k a g e s (
  • r
c
  • m
p
  • n
e n t s ) f
  • r
r u n t i m e c
  • n
t a i n e r s S t e r e
  • t
y p e d c
  • m
p
  • n
e n t s f
  • r
y
  • u
r s
  • f
t w a r e e l e m e n t s U s a g e d e p e n d e n c i e s t
  • s
h
  • w
p
  • s
s i b l e c
  • m
m u n i c a t i
  • n
p a t h s ( a g a i n s t e r e
  • t
y p e ) C l a s s e s f
  • r
c
  • n
n e c t
  • r
s
slide-52
SLIDE 52

Deployment View

S h
  • w
t h e h
  • s
t s y
  • u
n e e d t
  • r
u n y
  • u
r c
  • m
p
  • n
e n t s E x e c u t i
  • n
e n v i r
  • n
m e n t s c a n b e u s e d t
  • s
h
  • w
t h e r u n t i m e c
  • n
t a i n e r s y
  • u
u s e f
  • r
y
  • u
r c
  • m
p
  • n
e n t s P a c k a g e s c a n s h
  • w
l
  • c
a t i
  • n
s
  • r
  • t
h e r g r
  • u
p i n g s
  • f
h
  • s
t s A r t i f a c t s a r e u s e d t
  • s
h
  • w
w h e r e y
  • u
r s y s t e m b i n a r i e s r e s i d e f
  • r
e x e c u t i
  • n
slide-53
SLIDE 53

Summary and Conclusions

slide-54
SLIDE 54

What We Have Talked About

  • Modelling is terrifically useful
  • communication
  • clarity
  • analysis
  • Many ways of doing it
  • napkins to UML tools
  • The key point is to get value from what you do
  • don’t get stuck in “analysis paralysis”
slide-55
SLIDE 55

Eoin Woods


www.eoinwoods.info
 @eoinwoodz

Questions?

Simon Brown


www.codingthearchitecture.com
 @simonbrown