Whoops! Where did my architecture go? Approaches to architecture - - PowerPoint PPT Presentation

whoops where did my architecture go
SMART_READER_LITE
LIVE PREVIEW

Whoops! Where did my architecture go? Approaches to architecture - - PowerPoint PPT Presentation

Whoops! Where did my architecture go? Approaches to architecture management for Java and Spring applications Oliver Gierke Oliver Gierke SpringSource Engineer Spring Data ogierke@vmware.com olivergierke www.olivergierke.de Background 5


slide-1
SLIDE 1

Whoops! Where did my architecture go?

Approaches to architecture management for Java and Spring applications

Oliver Gierke

slide-2
SLIDE 2

Oliver Gierke

SpringSource Engineer Spring Data

  • gierke@vmware.com
  • livergierke

www.olivergierke.de

slide-3
SLIDE 3

Background

5 years of consulting Lots of code reviews Eoin Woods‘ talk on InfoQ

slide-4
SLIDE 4

"

If you think architecture is expensive, try no architecture.

slide-5
SLIDE 5

Macro VS. Micro Architecture

slide-6
SLIDE 6

Macro VS. Micro Architecture

slide-7
SLIDE 7

Sample Code

http:/ /github.com/olivergierke/ whoops-architecture

slide-8
SLIDE 8

Roadmap

Divide and conquer Of layers and slices A plain Java based approach

slide-9
SLIDE 9

Architecture 101

slide-10
SLIDE 10

Know your dependencies

slide-11
SLIDE 11

Explicit / Visible dependencies

slide-12
SLIDE 12

Granularity

Modules Layers Vertical slices Subsystems

slide-13
SLIDE 13

Granularity

Java ARchive Package Class

slide-14
SLIDE 14

Divide and conquer

slide-15
SLIDE 15

Component

slide-16
SLIDE 16

Component

Single unit to understand

slide-17
SLIDE 17

Component

Single unit to change

slide-18
SLIDE 18

Component

Scope of risk of change

slide-19
SLIDE 19

B A

slide-20
SLIDE 20

B A

slide-21
SLIDE 21

B

Cost of separation

A

slide-22
SLIDE 22

B

Definition and maintenance

  • f dependencies

A

slide-23
SLIDE 23

B

Smaller unit to understand

A

slide-24
SLIDE 24

B

Reduced risk of change

A

slide-25
SLIDE 25

Of layers and slices…

slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28

Presentation Service Data Access

slide-29
SLIDE 29

Presentation Service Data Access

slide-30
SLIDE 30

Presentation Service Data Access

slide-31
SLIDE 31

Presentation Service Data Access Account Customer Core

slide-32
SLIDE 32

Presentation Service Data Access Account Customer Core

slide-33
SLIDE 33

Presentation Service Data Access Account Customer Core

slide-34
SLIDE 34

Layers

Well understood Known to developers Less important to business

slide-35
SLIDE 35

Slices

Hardly understood New to developers Key for business req

slide-36
SLIDE 36

Presentation Service Data Access Account Customer Core

slide-37
SLIDE 37

"

How to implement an architecture inside a codebase?

slide-38
SLIDE 38

Architecture VS. Codebase

slide-39
SLIDE 39

"

How to implement an architecture inside a codebase?

slide-40
SLIDE 40

"

How to implement an architecture inside a codebase?

slide-41
SLIDE 41

"

How to maintain an architecture inside a codebase?

slide-42
SLIDE 42

Code analysis

JDepend Sonar

slide-43
SLIDE 43

Demo

slide-44
SLIDE 44

Sonargraph

Formerly known as SonarJ

slide-45
SLIDE 45

Demo

slide-46
SLIDE 46

A plain Java based approach

slide-47
SLIDE 47

"

How far can we get with plain Java means only?

slide-48
SLIDE 48

Presentation Service Data Access Account Customer Core

slide-49
SLIDE 49

Packages

slide-50
SLIDE 50

….layer.slice ….slice.layer ….slice

slide-51
SLIDE 51

….web.core ….service.core ….repository.core

slide-52
SLIDE 52

….core.web ….core.service ….core.repository

slide-53
SLIDE 53

….core ….customer ….account

slide-54
SLIDE 54

"

Why the f#$k should I even care?

slide-55
SLIDE 55

"

Does it make a difference?

slide-56
SLIDE 56

Dependency management

slide-57
SLIDE 57

"

You only need to manage, what you can refer to…

slide-58
SLIDE 58

Layers first

Leaks slice internals Lower layers visible to everyone

slide-59
SLIDE 59

Slices first/only

Start with package per slice Expose interfaces and domain types Keep implementations private

slide-60
SLIDE 60

Slices first/only

Encapsulates business module Internals understood anyway

slide-61
SLIDE 61

"

Start with less packages and the least visibility possible…

slide-62
SLIDE 62

Presentation Service Data Access Account Customer Core

slide-63
SLIDE 63

Presentation Service Data Access Account Customer Core

slide-64
SLIDE 64

Demo

slide-65
SLIDE 65

Take-aways

Know your dependencies On every granularity Start as strict as possible Get lenient where necessary

slide-66
SLIDE 66

Resources

Spring Data JPA @ GitHub Sonargraph Blogpost

slide-67
SLIDE 67

Thanks & credits

Eoin Woods - Talk @ InfoQ Uwe Friedrichsen - Slides @ Slideshare