it wasn’t the if-

98
06/07/22 www.vsmerlot.com 1 The Model is the Code Using COSA Technology by Gordon Morrison Copyright © 2012 All Rights Reserved

Upload: gordon-morrison

Post on 18-Dec-2014

79 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: It wasn’t the if-

04/10/23 www.vsmerlot.com 1

The Model is the Code

Using COSA Technology

by

Gordon Morrison

Copyright © 2012

All Rights Reserved

Page 2: It wasn’t the if-

04/10/23 www.vsmerlot.com 2

It wasn’t the “go to”

• The ‘if’ has caused more spaghetti code than the ‘go to’ ever could.

Page 3: It wasn’t the if-

04/10/23 www.vsmerlot.com 3

Simple Calculator Example

• Subtract two negative numbers resulting in a negative result.

Page 4: It wasn’t the if-

04/10/23 www.vsmerlot.com 4

A COSA Solution

• Rules– Operand1– Operate– Operand2– Result– Done– Error

Page 5: It wasn’t the if-

04/10/23 www.vsmerlot.com 5

The Application

• Five Functions– Add– Subtract– Multiply– Divide– Percent

• Clear• Clear Entry

Page 6: It wasn’t the if-

04/10/23 www.vsmerlot.com 6

On Subtract Event

• Handled as Negate

Page 7: It wasn’t the if-

04/10/23 www.vsmerlot.com 7

Run Engine

Page 8: It wasn’t the if-

04/10/23 www.vsmerlot.com 8

Engine On

Page 9: It wasn’t the if-

04/10/23 www.vsmerlot.com 9

Check Event State

• Static State– Compared to

• Dynamic State

Page 10: It wasn’t the if-

04/10/23 www.vsmerlot.com 10

True Rule or Behavior

• Dynamically bind to True Member

Page 11: It wasn’t the if-

04/10/23 www.vsmerlot.com 11

Operand1 Rule

• Step– Negate

Page 12: It wasn’t the if-

04/10/23 www.vsmerlot.com 12

Rule’s True Behavior

Page 13: It wasn’t the if-

04/10/23 www.vsmerlot.com 13

Single Point True Trace

Page 14: It wasn’t the if-

04/10/23 www.vsmerlot.com 14

Trace what you want

• Complex or• Simple

Page 15: It wasn’t the if-

04/10/23 www.vsmerlot.com 15

Next Rule

• Base on True

Page 16: It wasn’t the if-

04/10/23 www.vsmerlot.com 16

Engine Off

• Return to OS…

Page 17: It wasn’t the if-

04/10/23 www.vsmerlot.com 17

Exit to OS

Page 18: It wasn’t the if-

04/10/23 www.vsmerlot.com 18

Model

• Model = Code• Code = Model

Page 19: It wasn’t the if-

04/10/23 www.vsmerlot.com 19

Application

Page 20: It wasn’t the if-

04/10/23 www.vsmerlot.com 20

Next On Click Event

Page 21: It wasn’t the if-

04/10/23 www.vsmerlot.com 21

Back to Engine

Page 22: It wasn’t the if-

04/10/23 www.vsmerlot.com 22

Page 23: It wasn’t the if-

04/10/23 www.vsmerlot.com 23

Page 24: It wasn’t the if-

04/10/23 www.vsmerlot.com 24

Same Rule Next Step

• Previous Step Allows– True Any Number– False One Period

Page 25: It wasn’t the if-

04/10/23 www.vsmerlot.com 25

True Behavior

Page 26: It wasn’t the if-

04/10/23 www.vsmerlot.com 26

Turn Engine Off

Page 27: It wasn’t the if-

04/10/23 www.vsmerlot.com 27

Trace

Page 28: It wasn’t the if-

04/10/23 www.vsmerlot.com 28

Next True Step

Page 29: It wasn’t the if-

04/10/23 www.vsmerlot.com 29

Engine Off

Page 30: It wasn’t the if-

04/10/23 www.vsmerlot.com 30

Return to OS

Page 31: It wasn’t the if-

04/10/23 www.vsmerlot.com 31

Rule Operand1 Step Any Number

• Model = Code• Code = Model

Page 32: It wasn’t the if-

04/10/23 www.vsmerlot.com 32

Page 33: It wasn’t the if-

04/10/23 www.vsmerlot.com 33

Page 34: It wasn’t the if-

04/10/23 www.vsmerlot.com 34

Page 35: It wasn’t the if-

04/10/23 www.vsmerlot.com 35

Page 36: It wasn’t the if-

04/10/23 www.vsmerlot.com 36

Page 37: It wasn’t the if-

04/10/23 www.vsmerlot.com 37

Page 38: It wasn’t the if-

04/10/23 www.vsmerlot.com 38

Page 39: It wasn’t the if-

04/10/23 www.vsmerlot.com 39

Page 40: It wasn’t the if-

04/10/23 www.vsmerlot.com 40

Page 41: It wasn’t the if-

04/10/23 www.vsmerlot.com 41

Page 42: It wasn’t the if-

04/10/23 www.vsmerlot.com 42

Page 43: It wasn’t the if-

04/10/23 www.vsmerlot.com 43

Page 44: It wasn’t the if-

04/10/23 www.vsmerlot.com 44

Page 45: It wasn’t the if-

04/10/23 www.vsmerlot.com 45

Page 46: It wasn’t the if-

04/10/23 www.vsmerlot.com 46

Page 47: It wasn’t the if-

04/10/23 www.vsmerlot.com 47

Page 48: It wasn’t the if-

04/10/23 www.vsmerlot.com 48

Page 49: It wasn’t the if-

04/10/23 www.vsmerlot.com 49

Page 50: It wasn’t the if-

04/10/23 www.vsmerlot.com 50

Page 51: It wasn’t the if-

04/10/23 www.vsmerlot.com 51

Number

Page 52: It wasn’t the if-

04/10/23 www.vsmerlot.com 52

Page 53: It wasn’t the if-

04/10/23 www.vsmerlot.com 53

Now Click Subtract

Page 54: It wasn’t the if-

04/10/23 www.vsmerlot.com 54

Subtract

• On Click Event

Page 55: It wasn’t the if-

04/10/23 www.vsmerlot.com 55

Not Any Number

• Next Step

Page 56: It wasn’t the if-

04/10/23 www.vsmerlot.com 56

Not Any Number

• Next Step

Page 57: It wasn’t the if-

04/10/23 www.vsmerlot.com 57

Not Clear Entry

Page 58: It wasn’t the if-

04/10/23 www.vsmerlot.com 58

Not Clear Entry

Page 59: It wasn’t the if-

04/10/23 www.vsmerlot.com 59

Not Clear

Page 60: It wasn’t the if-

04/10/23 www.vsmerlot.com 60

Not Clear

Page 61: It wasn’t the if-

04/10/23 www.vsmerlot.com 61

Rule Operate

• Not Step Addition

Page 62: It wasn’t the if-

04/10/23 www.vsmerlot.com 62

Not Addition Step

• Rule Operate

Page 63: It wasn’t the if-

04/10/23 www.vsmerlot.com 63

Rule Operate

• Step Subtract

Page 64: It wasn’t the if-

04/10/23 www.vsmerlot.com 64

Rule Operate

• Step Subtraction

Page 65: It wasn’t the if-

04/10/23 www.vsmerlot.com 65

Next Rule

• Operand 2

Page 66: It wasn’t the if-

04/10/23 www.vsmerlot.com 66

First Step

• Return to OS

Page 67: It wasn’t the if-

04/10/23 www.vsmerlot.com 67

Subtracting

Page 68: It wasn’t the if-

04/10/23 www.vsmerlot.com 68

Page 69: It wasn’t the if-

04/10/23 www.vsmerlot.com 69

Page 70: It wasn’t the if-

04/10/23 www.vsmerlot.com 70

Rule Operand2

• Step Negate

Page 71: It wasn’t the if-

04/10/23 www.vsmerlot.com 71

Page 72: It wasn’t the if-

04/10/23 www.vsmerlot.com 72

Page 73: It wasn’t the if-

04/10/23 www.vsmerlot.com 73

Page 74: It wasn’t the if-

04/10/23 www.vsmerlot.com 74

A Negative Number

Page 75: It wasn’t the if-

04/10/23 www.vsmerlot.com 75

Page 76: It wasn’t the if-

04/10/23 www.vsmerlot.com 76

Page 77: It wasn’t the if-

04/10/23 www.vsmerlot.com 77

Page 78: It wasn’t the if-

04/10/23 www.vsmerlot.com 78

Page 79: It wasn’t the if-

04/10/23 www.vsmerlot.com 79

Page 80: It wasn’t the if-

04/10/23 www.vsmerlot.com 80

Page 81: It wasn’t the if-

04/10/23 www.vsmerlot.com 81

Page 82: It wasn’t the if-

04/10/23 www.vsmerlot.com 82

Page 83: It wasn’t the if-

04/10/23 www.vsmerlot.com 83

Page 84: It wasn’t the if-

04/10/23 www.vsmerlot.com 84

Page 85: It wasn’t the if-

04/10/23 www.vsmerlot.com 85

Page 86: It wasn’t the if-

04/10/23 www.vsmerlot.com 86

Page 87: It wasn’t the if-

04/10/23 www.vsmerlot.com 87

Page 88: It wasn’t the if-

04/10/23 www.vsmerlot.com 88

Page 89: It wasn’t the if-

04/10/23 www.vsmerlot.com 89

Page 90: It wasn’t the if-

04/10/23 www.vsmerlot.com 90

Then Click Equals

Page 91: It wasn’t the if-

04/10/23 www.vsmerlot.com 91

On Click Equals

Page 92: It wasn’t the if-

04/10/23 www.vsmerlot.com 92

Not Any Number Step

Page 93: It wasn’t the if-

04/10/23 www.vsmerlot.com 93

Exit Rule Operand 2

Page 94: It wasn’t the if-

04/10/23 www.vsmerlot.com 94

Page 95: It wasn’t the if-

04/10/23 www.vsmerlot.com 95

Not Clear Entry

• Etc.

Page 96: It wasn’t the if-

04/10/23 www.vsmerlot.com 96

Result Rule

• Not Percent Step

Page 97: It wasn’t the if-

04/10/23 www.vsmerlot.com 97

Result Rule

• Equals Step

Page 98: It wasn’t the if-

04/10/23 www.vsmerlot.com 98

Result