Hexagonal Rails @mattwynne GOTO !Amsterdam !| !18th !June !2013 - - PowerPoint PPT Presentation

hexagonal rails
SMART_READER_LITE
LIVE PREVIEW

Hexagonal Rails @mattwynne GOTO !Amsterdam !| !18th !June !2013 - - PowerPoint PPT Presentation

Refactoring Workshop Hexagonal Rails @mattwynne GOTO !Amsterdam !| !18th !June !2013 Tuesday, 18 June 13 Structure of this session: Installing things (first pass) Intro presentation Installing things (for real) Refactoring


slide-1
SLIDE 1

@mattwynne GOTO !Amsterdam !| !18th !June !2013

Hexagonal Rails

Refactoring Workshop

Tuesday, 18 June 13
slide-2
SLIDE 2

Structure of this session:

  • Installing things (first pass)
  • Intro presentation
  • Installing things (for real)
  • Refactoring exercise
  • Further exploration
  • Show & tell
Tuesday, 18 June 13
slide-3
SLIDE 3 Tuesday, 18 June 13
slide-4
SLIDE 4 Tuesday, 18 June 13
slide-5
SLIDE 5 Tuesday, 18 June 13
slide-6
SLIDE 6 Tuesday, 18 June 13
slide-7
SLIDE 7 Tuesday, 18 June 13
slide-8
SLIDE 8

and then...

Tuesday, 18 June 13
slide-9
SLIDE 9 Tuesday, 18 June 13
slide-10
SLIDE 10

Why?

Tuesday, 18 June 13
slide-11
SLIDE 11 Tuesday, 18 June 13
slide-12
SLIDE 12

Connected

Tuesday, 18 June 13
slide-13
SLIDE 13

Modular

Tuesday, 18 June 13
slide-14
SLIDE 14 Tuesday, 18 June 13
slide-15
SLIDE 15 Tuesday, 18 June 13
slide-16
SLIDE 16

Modular, in the large

Tuesday, 18 June 13
slide-17
SLIDE 17 Tuesday, 18 June 13
slide-18
SLIDE 18

Modular, in the small

Tuesday, 18 June 13
slide-19
SLIDE 19 Tuesday, 18 June 13
slide-20
SLIDE 20

Your domain model is not in your classes, it's in the communication patterns between the objects at runtime.

Tuesday, 18 June 13
slide-21
SLIDE 21

Your domain model is not in your classes, it's in the communication patterns between the objects at runtime. — Steve Freeman & Nat Price

Tuesday, 18 June 13
slide-22
SLIDE 22

Your domain model is not where you think it is

Tuesday, 18 June 13
slide-23
SLIDE 23

Your domain model is in the protocols

Tuesday, 18 June 13
slide-24
SLIDE 24

Procedural code gets information then makes decisions. Object-oriented code tells objects to do things. — Alec Sharp, Smalltalk by Example

Tuesday, 18 June 13
slide-25
SLIDE 25

Procedural code gets information then makes decisions. Object-oriented code tells objects to do things. — Alec Sharp, Smalltalk by Example

Tell, don't ask

Tuesday, 18 June 13
slide-26
SLIDE 26

Rules

Core domain model cannot depend on the framework T e l l

  • b

j e c t s , a s k v a l u e s

Tuesday, 18 June 13
slide-27
SLIDE 27

Implications

Tuesday, 18 June 13
slide-28
SLIDE 28

Core domain model cannot depend on the framework C

  • r

e d

  • m

a i n m

  • d

e l c a n n

  • t

i n h e r i t f r

  • m

A c t i v e R e c

  • r

d F r a m e w

  • r

k c

  • m

m u n i c a t e s w i t h t h e c

  • r

e d

  • m

a i n v i a

A d a p t e r s

Tuesday, 18 June 13
slide-29
SLIDE 29

T e l l

  • b

j e c t s , a s k v a l u e s V i e w t e m p l a t e s s h

  • u

l d r e n d e r f r

  • m

i m m u t a b l e v a l u e s Y

  • u

c a n ' t s a y : i f ¡ u s e r . s a v e

Tuesday, 18 June 13
slide-30
SLIDE 30

Example:

Passive Controller

Tuesday, 18 June 13
slide-31
SLIDE 31 Tuesday, 18 June 13
slide-32
SLIDE 32 Tuesday, 18 June 13
slide-33
SLIDE 33 Tuesday, 18 June 13
slide-34
SLIDE 34 Tuesday, 18 June 13
slide-35
SLIDE 35 Tuesday, 18 June 13
slide-36
SLIDE 36 Tuesday, 18 June 13
slide-37
SLIDE 37 Tuesday, 18 June 13
slide-38
SLIDE 38 Tuesday, 18 June 13
slide-39
SLIDE 39 Tuesday, 18 June 13
slide-40
SLIDE 40

Let's explore!

Tuesday, 18 June 13
slide-41
SLIDE 41

References

http://www.threeriversinstitute.org/blog/?p=338 http://www.growing-object-oriented-software.com/ http://pragprog.com/articles/tell-dont-ask http://alistair.cockburn.us/Hexagonal+architecture http://devblog.avdi.org/2012/03/15/now-available-objects-on-rails/ http://mattwynne.net/category/hexagonal-rails/ http://www.wirfs-brock.com/PDFs/How%20Designs%20Differ.pdf http://nccastaff.bournemouth.ac.uk/jmacey/CA1/Papers/Responsibility-Driven%20Design.pdf

Tuesday, 18 June 13