44
Design smart, not hard how flow -orientation makes software design easier Ralf Westphal [email protected] @ralfw gplus.to/ralfwestphal http://ralfw.blogspot.com http://geekswithblogs.net/thearchitectsnapkin Donnerstag, 22. September 11

Ralf Westphal - Design smart not hard ()

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Ralf Westphal - Design smart not hard ()

Design smart, not hard – how flow-orientation makes

software design easier

Ralf Westphal

[email protected]@ralfw

gplus.to/ralfwestphalhttp://ralfw.blogspot.com

http://geekswithblogs.net/thearchitectsnapkin

Donnerstag, 22. September 11

Page 2: Ralf Westphal - Design smart not hard ()

The challenge:

Donnerstag, 22. September 11

Page 3: Ralf Westphal - Design smart not hard ()

Let´s start spinning...

Donnerstag, 22. September 11

Page 4: Ralf Westphal - Design smart not hard ()

Feature slice 1

Donnerstag, 22. September 11

Page 5: Ralf Westphal - Design smart not hard ()

Flow-Design 1

Run Parse command line

Read lines #om file

Display lines

(args:string[]) (filename:string) (lines:string*)

Donnerstag, 22. September 11

Page 6: Ralf Westphal - Design smart not hard ()

Code 1 Parse command line

(args:string[]) (filename:string)

Donnerstag, 22. September 11

Page 7: Ralf Westphal - Design smart not hard ()

Feature slice 2

Donnerstag, 22. September 11

Page 8: Ralf Westphal - Design smart not hard ()

Flow-Design 2

Run Parse command line Read lines #om file

Display lines

(PageDirections)

Buffer lines

Get page #om buffer

lineBuffer:List<string>

(pageLength:int)

portal

logic

adapterapp

Donnerstag, 22. September 11

Page 9: Ralf Westphal - Design smart not hard ()

Code 2

Get page #om buffer

Donnerstag, 22. September 11

Page 10: Ralf Westphal - Design smart not hard ()

Feature slice 3

Donnerstag, 22. September 11

Page 11: Ralf Westphal - Design smart not hard ()

Flow-Design 3a

Run Parse command line Read lines #om file

Display lines

Buffer lines

Get page #om buffer

lineBuffer:List<string>

Format page+

(csvLines:string*)(string*)lineBuffer:List<string>

Donnerstag, 22. September 11

Page 12: Ralf Westphal - Design smart not hard ()

Flow-Design 3b

Format page -

Parse lines Format table(csvLines:string*) (string*)

(records:CsvRecord*)

Donnerstag, 22. September 11

Page 13: Ralf Westphal - Design smart not hard ()

Code 3

Format page

Parse lines

+

Donnerstag, 22. September 11

Page 14: Ralf Westphal - Design smart not hard ()

Flow-Design 4

Donnerstag, 22. September 11

Page 15: Ralf Westphal - Design smart not hard ()

Flow-Design 4a

Run Parse command line Read lines #om file

UI

Buffer lines

Get page #om buffer Format page

++(PageDirections)

Donnerstag, 22. September 11

Page 16: Ralf Westphal - Design smart not hard ()

Flow-Design 4b

Get page #om buffer -Calc index of first

line of pageGet page lines #om buffer(PageDirections) (string*)

(index:int, pageLength:int)

(pageLength:int)

lineBuffer:List<string>

Donnerstag, 22. September 11

Page 17: Ralf Westphal - Design smart not hard ()

Code 4

Donnerstag, 22. September 11

Page 18: Ralf Westphal - Design smart not hard ()

Feature slice 5

Donnerstag, 22. September 11

Page 19: Ralf Westphal - Design smart not hard ()

Flow-Design 5a

Run Parse command line Read lines #om file

UI

Buffer lines

Get page #om buffer Format page

++

Donnerstag, 22. September 11

Page 20: Ralf Westphal - Design smart not hard ()

Flow-Design 5b

Format page -

Parse lines Format table

(records:CsvRecord*)

Normalize columns

(records:CsvRecord*)

Donnerstag, 22. September 11

Page 21: Ralf Westphal - Design smart not hard ()

Code 5

Donnerstag, 22. September 11

Page 22: Ralf Westphal - Design smart not hard ()

Feature slice 6

The challenge continues...

Donnerstag, 22. September 11

Page 23: Ralf Westphal - Design smart not hard ()

Flow-Design 6

Run Parse command line Read lines #om file

UI

Buffer lines

Get page #om buffer Format page

++

Prepend line index

(string*)

(string*)

Donnerstag, 22. September 11

Page 24: Ralf Westphal - Design smart not hard ()

Code 6

Donnerstag, 22. September 11

Page 25: Ralf Westphal - Design smart not hard ()

Feature slice 7

Donnerstag, 22. September 11

Page 26: Ralf Westphal - Design smart not hard ()

Flow-Design 7a

Run Parse command line Read lines #om file

UI

Buffer lines

Get page #om buffer Format page

++

Prepend line index

(pageNo:int)

Donnerstag, 22. September 11

Page 27: Ralf Westphal - Design smart not hard ()

Flow-Design 7b

Get page #om buffer -Calc index of first

line of pageGet page lines #om

buffer(PageDirections) (string*)

(pageLength:int) (pageNo:int)

Donnerstag, 22. September 11

Page 28: Ralf Westphal - Design smart not hard ()

Code 7

Donnerstag, 22. September 11

Page 29: Ralf Westphal - Design smart not hard ()

Feature slice 8

Donnerstag, 22. September 11

Page 30: Ralf Westphal - Design smart not hard ()

Flow-Design 8a

Run Parse command line Read lines #om file

UI

Buffer lines

Get page #om buffer Format page

++

Prepend line index

(PageOfLines)

Donnerstag, 22. September 11

Page 31: Ralf Westphal - Design smart not hard ()

Flow-Design 8b

Get page #om buffer -Calc index of first

line of pageGet page lines #om buffer (PageOfLines)

(index:int, pageLength:int,PageInfo)

Donnerstag, 22. September 11

Page 32: Ralf Westphal - Design smart not hard ()

Flow-Design 8c

Format page -

Parse lines Format table

(PageOfRecords)

Normalize columns(PageOfLines)

(PageOfRecords)(string*)

Donnerstag, 22. September 11

Page 33: Ralf Westphal - Design smart not hard ()

Code 8

Donnerstag, 22. September 11

Page 34: Ralf Westphal - Design smart not hard ()

Feature slice 9

The challenge continues...

Donnerstag, 22. September 11

Page 35: Ralf Westphal - Design smart not hard ()

Flow-Design 9.1

Config Parse command line

Read lines #om file

UI

Format page+

Get page #om buffer

+

Prepend line index

Buffer lines

Run

Asynchronizer

background thread

foreground thread

ConcurrentList<string>

Donnerstag, 22. September 11

Page 36: Ralf Westphal - Design smart not hard ()

Code 9.1

Donnerstag, 22. September 11

Page 37: Ralf Westphal - Design smart not hard ()

Flow-Design 9.2aConfig Parse command

line Read line positions #om file

Read page lines #om file

Calc index of

Ini- Read line positions #om file Buffer lines

UI

Format page+

Get page #om buffer

+

Run

ConcurrentList<long>

Donnerstag, 22. September 11

Page 38: Ralf Westphal - Design smart not hard ()

Get page #om buffer -

Calc index of first line of page

Get page line positions #om buffer

(PageOfLines)

Flow-Design 9.2b

Read page lines #om file

(PageOfLinePositions)

(pageLength:int)(pageNo:int)

(PageDirections)

ConcurrentList<string>

Donnerstag, 22. September 11

Page 39: Ralf Westphal - Design smart not hard ()

Code 9.2

Donnerstag, 22. September 11

Page 40: Ralf Westphal - Design smart not hard ()

Get page #om buffer -

Calc index of first line of page

Get page line positions #om buffer

Flow-Design 9.3

Read page lines #om file

Format page -

Parse lines

Format tableNormalize columns

Prepend line index

(PageOfLines)(PageOfLines)

Donnerstag, 22. September 11

Page 41: Ralf Westphal - Design smart not hard ()

Code 9.3

Donnerstag, 22. September 11

Page 42: Ralf Westphal - Design smart not hard ()

Donnerstag, 22. September 11

Page 43: Ralf Westphal - Design smart not hard ()

Flow-Design ResourcesFlow-Design Cheat Sheetshttp://geekswithblogs.net/theArchitectsNapkin/archive/2011/03/19/flow-design-cheat-sheet-ndash-part-i-notation.aspx

http://geekswithblogs.net/theArchitectsNapkin/archive/2011/03/20/flow-design-cheat-sheet-ndash-part-ii-translation.aspx

Flow-Design Literature List (partly German)http://clean-code-advisors.com/ressourcen/flow-design-ressourcen

Flow-Design Discussion Group (feel free to start discussions in English)http://groups.google.com/group/event-based-components

Donnerstag, 22. September 11

Page 44: Ralf Westphal - Design smart not hard ()

Ralf WestphalRalf Westphal (www.ralfw.de) is a freelance consultant, project coach, and trainer on .NET software architectural topics. He is the author of more than 450 publications since 1998 and has been awarded the Most Valued Professional badge by Microsoft each year since 2005. Together with his colleague Stefan Lieser he is the co-founder of the "Clean Code Developer" initiative to increase software quality through principles and practices (www.clean-code-developer.de).

Donnerstag, 22. September 11