ࡱ> Root EntryT GJENNOMSNITTANTALLIKKEELLERPRODUKTH Fk`/ BriWordDocument+00GVO :i+00#C 1"riAlistairALISTAIRkCompObj#C:\ 1"riAlistair#nVArticlesARTIje maSummaryInformation+00#C:\(iAlistairALISTAIRARTI '<()*+,-./0123456=>?@ABCDEFGHIJKLMNOPQRoot EntryT GJENNOMSNITTANTALLIKKEELLERPRODUKTH Fk`/ BriWordDocument+00GVO :i+00#C 1"riAlistairALISTAIRkCompObj#C:\ 1"riAlistair#nVArticlesARTIje maSummaryInformation+00#C:\(iAlistairALISTAIRARTI'!"#$%&7()*+,-./0123456 89:;RSTUVWXYZ[\]^_`abcosoft Word for Windows 95@ @@@6#Zࡱ՜.+,0HPdlt |  Norges Bank< Workshop on OO Design Qualityࡱ FMicrosoft Word-dokument MSWordDocWord.Document.69qࡱOh+'0 8D l x  Workshop on OO Design Qualitye\v oAlistair CockburnCC Normal.dotAlistair Cockburn7ocMicrܥh[de kc"pp22222r7Z2r7r7r7r77r7k177777777YYYYKYZ[BkXkS[Q2~977~9~9[hY2277hYhYhY~92727Y`/2.2,22227YhYEhYWorkshop on OO Design Quality I offer this problem to give a concrete case against which to test quality suggestions. The coffee machine problem The basic problem is this: design a software controller for a coffee vending machine. Since that presuppoܥh[Te kc"pp22222r7Z2r7r7r7r77r7k177777777YYYYKYZ[BkXkS[Q2~977~9~9[hY2277hYhYhY~92727Y62.2,22227YhYEhYWorkshop on OO Design Quality I offer this problem to give a concrete case against which to test quality suggestions. The coffee machine problem The basic problem is this: design a software controller for a coffee vending machine. Since that presupposes a given design for the mechanical part of the machine, I broader the problem to be: Design the whole coffee machine. The problem comes as a base requirement plus a set of extensions. The designs can be tested against the extensions and against other proposed extensions. The designer can look at all extensions before designing, to get the best design. The question is, which is the best design, and why. Problem 1: Just four buttons, or a dial with four positions: coffee, black, black&sweet, white, white&sweet. All cost .35. Machine accepts various coins, gives change if it can. Other requirements are not specified. Assume there will be a cup dispenser, 3 powder- and a water dispenser. Problem 2: Add a fifth choice: bouillion for .25. Problem 3: Add a badge reader and link to a network for direct debit against the employees payroll or other credit system managed by a network computer. Now the customer can put in coins or swipe the badge. Problem 4: Make the machine so that the owner can swap in and out or add various products with various prices. Assume at least a milk steamer and water dispenser plus various powders. Assume we shall want to be able to make things like espresso, cappucino, mocchacino, hot chocolate, perhaps double espresso, etc. Prices may vary from .25 to 1.50 or above. Important is that updating the machine with a "drink of the week" is easy. Design 1 for Problem 1: .A D1.1.CashBox: Knows all about coins and giving change. K*b8W p68RuvwtFbZ^~[\ !ACQlz\]o_*. -lmudyzX{} ~  $678v~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#- K`Normalac&A@&Standardskrift for avsnittnows the price of the drink (.35 in problem 1).Disables the front panel until enough money is put in. Is told by the Mixer when the drink has been made, and then takes the money. D1.2. FrontPanel: .A ___________________________________ 1 (designed for problem 1) -----------CashBox D1.2. FrontPanelGets enabled and disabled. Knows the possible drinks, and the current selecDocumentSummaryInformation8 ses a given design for the mechanical part of the machine, I broader the problem to be: Design the whole coffee machine. The problem comes as a base requirement plus a set of extensions. The designs can be tested against the extensions and against other proposed extensions. The designer can look at all extensions before designing, to get the best design. The question is, which is the best design, and why. Problem 1: Just four buttons, or a dial with four positions: coffee, black, black&sweet, white, white&sweet. All cost .35. Machine accepts various coins, gives change if it can. Other requirements are not specified. Assume there will be a cup dispenser, 3 powder- and a water dispenser. Problem 2: Add a fifth choice: bouillion for .25. Problem 3: Add a badge reader and link to a network for direct debit against the employees payroll or other credit system managed by a network computer. Now the customer can put in coins or swipe the badge. Problem 4: Make the machine so that the owner can swap in and out or add various products with various prices. Assume at least a milk steamer and water dispenser plus various powders. Assume we shall want to be able to make things like espresso, cappucino, mocchacino, hot chocolate, perhaps double espresso, etc. Prices may vary from .25 to 1.50 or above. Important is that updating the machine with a "drink of the week" is easy. Design 1 for Problem 1: .A D1.1.CashBox: Knows all about coins and giving change. K*b8W p68RuvwtFbZ^~[\ !ACQlz\]o_*. -lmudyzX{} ~  $678v~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#-+++++++++,,,!,3,B,C,D,a,,,,,, ---$-/-:-----...^.//u&c"/!     c") DEWno  YZ   M g h   E F G H I J n  R(RSw /0 :|n 6{34E B l z a!b!v!Q"R"S"T"U"b"c"~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#m+/*.dtmms;0x#-+'`.,,RCgenaw SKREVETAV KOMMENTARER OPPRETTDATOREDTIDFILNAVN FILSTRRELSE NKKELORDSENESTLAGRETAV ANTALLTEGN ANTALLSIDER ANTALLORD UTSKRIFTSDATOPRIVATRDVERSNR SENESTLAGRETEMNEIHMALTITTELXEDOKUMENTEGENSKAPER ALFABETISKVANLIGESTOREFOR MENGDETEKST TEGNFORMAT VALUTATEKST FRSTESTORHEKSSM FLETTEFORMAT ORDENSTALL ORDENSTEKST ROMERTALLSTOREABSAVRUNDETDEFHELTALLOGUSANNMAKSMINREST GJENNOMSNITTANTALLIKKEELLERPRODUKTHVISFORTEGNSUMSANNEMNVW]w{  $(,36:C[abfp{"&:DKQZadijnoz  $*+/046EFLMUeju #25LTY^wz  %&(278DMVY_`efj %./6:?@FNU[bnqv~  $'+HLMTU\_efhinosz~  (-459JNZ_`ijt}    " ' + 0 ; < ? @ D I S Y a f j o y z } ~     # ' * . 4 > C K M R V \ b e y K`Normalac&A@&Standardskrift for avsnittnows the price of the drink (.35 in problem 1).Disables the front panel until enough money is put in. Is told by the Mixer when the drink has been made, and then takes the money. D1.2. FrontPanel: .A ___________________________________ 1 (designed for problem 1) -----------CashBox D1.2. FrontPanelGets enabled and disabled. Knows the possible drinks, and the current selec+++++++++,,,!,3,B,C,D,a,,,,,, ---$-/-:-----...^.//u&c"/!     c") DEWno  YZ   M g h   E F G H I J n  R(RSw /0 :|n 6{34E B l z a!b!v!Q"R"S"T"U"b"c"~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#m+/*.dtmms;0x#-+'`.,,RCgenaw SKREVETAV KOMMENTARER OPPRETTDATOREDTIDFILNAVN FILSTRRELSE NKKELORDSENESTLAGRETAV ANTALLTEGN ANTALLSIDER ANTALLORD UTSKRIFTSDATOPRIVATRDVERSNR SENESTLAGRETEMNEIHMALTITTELXEDOKUMENTEGENSKAPER ALFABETISKVANLIGESTOREFOR MENGDETEKST TEGNFORMAT VALUTATEKST FRSTESTORHEKSSM FLETTEFORMAT ORDENSTALL ORDENSTEKST ROMERTALLSTOREABSAVRUNDETDEFHELTALLOGUSANNMAKSMINREST GJENNOMSNITTANTALLIKKEELLERPRODUKTHVISFORTEGNSUMSANNEMNVW]w{  $(,36:C[abfp{"&:DKQZadijnoz  $*+/046EFLMUeju #25LTY^wz  %&(278DMVY_`efj %./6:?@FNU[bnqv~  $'+HLMTU\_efhinosz~tion when it is made. Knows the materials needed for each drink. Instructs the Mixer what ingredient to drop next. Gets told by the mixer if an ingredient is empty, so that it can disable the selection. D1.3. Mixer Acts as a pass-thru. Gets told what ingredient to drop. Knows the locations of the ingredient dispensers, tells them to drop a unit. Tell the front panel if a dispenser is empty. D1.4. Dispensers Knows how to drop a unit when told to. Knows when it is empty. Legitimate dispensers are cup, water, various powders. Discussion of Design 1. When design 1 encounters problem 4, the Cashbox knows all the prices and possible selections so it can inform the FrontPanel which selections to enable as money comes in; the FrontPanel knows all the recipes, so it can still control the mixer; the rest of the design stays the same. ___________________________________ Design 2 (design originally for problem 2) ------------ D2.1. Cashbox Does not knowof the drink. Does not control anything else. Is asked "How much do you have?" and is told "take .35 now". D2.2. FrontPanelKnows the possible drinks, their prices, and the current selection when it is made. Knows the materials needed for each drink. Instructs the Mixer what ingredient to drop next. Gets told by the mixer if an ingredient is empty, so that it can disable the selection. Asks the Cashbox how much money it has, tells it when to take that money. D2.3. Mixer Exactly as before. D2.4. Dispensers Exactly as before. Discussion of Design 2. When design 2 encounter problem 4, all the needed changes are local to the FrontPanel. ___________________________________ Design 3 (design originally for problem 3) ------------ Like any of the other designs in this story except that messages into and out of the CashBox are different. The modification to design 1 is that the CashBox enables all products immediately when a card is used. The modification to designs 2+ is that the CashBox is not asked "How much do you have?", but "Do you have sufficient for .35?" or whatever the amount is. That way, when a card is used, the cashbox does not have to reveal the credit limit of the customer or use a special token for infinity. ___________________________________ 4 (designed for problem 4) -----------D4.1. Drink Knows its price and recipe and whether there are enough ingredients available to make it. D4.2. FrontPanelKnows how to find the available drinks. Sends the selected drink to the Cashbox asking, "Do you have sufficient credit for this drink?" If yes, it passes the drink to the Mixer, saying "Make this drink". Gets told by the mixer if an ingredient is empty, tells each drink that the given ingredient is out, so the drink can decide if it can still be available. Sends the drink to the cashbox again to say, "take the money for this drink." 43CashBoxDoes not knowof the drink. Does not control anything else. Is given a drink and asked "Do you have sufficient credit for this drink" and is told "take the money for this drink now". D4.3. Mixer Is told to make a drink. Asks the drink how much of what ingredients it needs, and tells the dispensers to drop that much. Tell the front panel if a dispenser is empty. D4.4. Dispensers As before. .A I propose that the people interested in metrics or other specific quality tests get together to work out a set of questions to ask the design, and derive both mnp~KL79:;BO $$$'%.%%&&&'+'''''''''''3(4(l(m((%)7)8))))T*V*p*q*****&+'+6+H+J+T+_+l+~++++++++[ud[1[\@A_`a+mn89~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#-$(%%%4&X&&&'''''4(m(8)))U*V*q******* +&+'+++++.*.~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#-personal preferences for the designs, and preferences predicted by the quality tests. This will give us a base line for discussing quality.Or, design a coffee machine controller that can be placed into many, custom-designed coffee machines. Other discussed extensions, not in this problem set: v1 - fancier change making mechanisms, such as optionally leaving the money in the changer so one person can treat others to drinks. v2 - changing not only the ingredients but also the quantities v3 - changing not only the quantities but also the manner of processing v4 - including accounting functions v5 - including direct ordering of ingredients when dispenser gets low. 5 As design 4, but all the control logic is moved out of the FrontPanel into a special controller (which may be the coffee machine itself). The FrontPanel only knows the current selection, the controller knows and does all the rest. 6 it is enabled. Knows its necessary dispensers. Gets told when the CashBox has changed value and asks the CashBox whether it has the needed price for the drink. Gets told when a dispenser becomes empty or non-empty. Enables itself when there is sufficient both credit and ingredients.Gets told when the customer has selected it. If it is disabled, it does nothing, if enabled it tells the dispensers what to dispense. convert a dial or button or whatever to a message to a drink saying "you are selected". May optionally have a light or signal saying whether each drink is enabled. On any change in state, it tells all the dispensers, "I have changed value". They each ask, "Do have have xxx credit?" .A ____________________________________ Alistair Cockburn Humans and Technology given There are 7 designs given here. Many more variations are possible. Which is better, and why? - Smart CashBox- Smart FrontPanel- Protected Credit Card- Dumb Drinks, Smart FrontPanel- Smart Controller - Smart Drinks7 - Smart Drinks behind a Register - Smart CashBox - Smart FrontPanel - Protected Credit Card - Dumb Drinks, Smart FrontPanel- Smart Controller - Smart Drinks6,, and whether it got selected what to dispense, and tells the CashBox how much credit to deduct.D66 It gets told when to deduct credit and how much.D6As before, but now report empty to all the drinks.7 - Smart Drinks behind a RegisterAs design 6, but there is a DrinkRegister between the drinks and the other parts of the machine, so that the CashBox only tells the DrinkRegister, "I have changed", and the Dispensers only tell the DrinkRegister, "I have changed". D7.5. DrinkRegister Knows the whereabouts of all drinks. Catches and passes on "I have changed" messages to the drinks from wherever, so the drinks can themselves ask the cashbox and dispensers for their state, as they are interested. .A tmms;0x#-+'`.,,RCgenaw SKREVETAV KOMMENTARER OPPRETTDATOREDTIDFILNAVN FILSTRRELSE NKKELORDSENESTLAGRETAV ANTALLTEGN ANTALLSIDER ANTALLORD UTSKRIFTSDATOPRIVATRDVERSNR SENESTLAGRETEMNEIHMALTITTELXEDOKUMENTEGENSK  (-459JNZ_`ijt}    " ' + 0 ; < ? @ D I S Y a f j o y z } ~     # ' * . 4 > C K M R V \ b e y    , 2 3 9    - 2 3 9 : ? C F O S [ ` a e t x   " ( - 1 : C H M N R S ] a e f j m q r v ~    (23=?DEIMQpr  -1;EY`afouz!&BG "&+23;FKMPQUY\koz} !&'+,6:>?CFJKOW\]_cmqvxz{#'-0:IMW`tz{&+7;BHIMNVW[kr#+0256:>AJMRU[es{ EIJPXbdl   &).3;IPQW]`fpqw|    , 2 3 9    - 2 3 9 : ? C F O S [ ` a e t x   " ( - 1 : C H M N R S ] a e f j m q r v ~    (23=?DEIMQpr  -1;EY`afouz!&BG "&+23;FKMPQUY\koz} !&'+,6:>?CFJKOW\]_cmqvxz{#'-0:IMW`tz{&+7;BHIMNVW[kr#+0256:>AJMRU[es{ EIJPXbdl   &).3;IPQW]`fpqw| ",57FLMO`ilq ")*2OTY\blmsx| !+/3489=TVfkt~#&-.8:?@CKQRYZ`hrswx}"#(-35<CJPW_gjopst}~  %)26=>DEIJOS]^bciny{  !'+1:DEJKNRY\`djnv| $%+145;INWakrsx|   S Y Z ` !!!'!1!2!6!@!M!W!^!h!u!v!{!!!!!!!!!!!!!!!!!!!!""""$")"."9"="B"L"e"EAlistair Cockburn0C:\Alistair\Articles\Coffee machine\Workshop.doc@HP LaserJet 4Si - TEK1Q\\osloserv4\tek1qHPPCL5MSHP LaserJet 4Si - TEK1QHP LaserJet 4Si - TEK1Q@w XX@MSUDNHP LaserJet 4Si ;d HP LaserJet 4Si - TEK1Q@w XX@MSUDNHP LaserJet 4Si ;d bbbPL Emng GVY   g h o p q     " # 3 9 D E I J m n u v w   J  k =YQUuRSvwMaD     59:ABCPbz{| &';P =Um?np8a  345=Jgjps56z{2346DEKR.  A B I J Z ` k l w z !!!!P!^!a!b!!O"Q"R"S"U"b"c"11 10p*0q*0*0*01111 1$1*1?$0x0z001$0z0$0'%1.%0%0} 0*0&+1 1v1w1'+0116+01111H+1J+1T+01 11_+1l+01 1&11~+01 1'1+01 1+1+1+1+00+0~ 1R0u1 1v1w1+1+1x010 1 1 10 1 1 1p0 100105111t010111F0b10Z1^1~1110100[1\011+1+11+010101 1 11t11 0!1A1C051Q1l1z111\1]1o0110101000_0111+1+1+1+11101010*1.010101 11,1,1,11010 10 1-0l0m1n1p051~11111K1L11071 191 1:1 1;0 1 1 1B1t1O1111111100110101000&101 1&11!,010&1'0+'0'101 1'13,010'11B,1 0 1C,1-121'1D,1'1'1'1'0'1'03(14(0l(1m(0l1(1a,07)0m1,1p051~118)1)0)1 1,1 1:1 1;0 1 1 1)1,0T*01,01,0101 1 -1-1-1$-010'1/-1:-1-1-1-1-1.0.00.1^.00#0060 0 1Times New Roman Symbol &Arial"A++IZ<$SWorkshop on OO Design QualityAlistair CockburnAlistair Cockburn5>AI ",57FLMO`ilq ")*2OTY\blmsx| !+/3489=TVfkt~#&-.8:?@CKQRYZ`hrswx}"#(-35<CJPW_gjopst}~  %)26=>DEIJOS]^bciny{  !'+1:DEJKNRY\`djnv| $%+145;INWakrsx|   S Y Z ` !!!'!1!2!6!@!M!W!^!h!u!v!{!!!!!!!!!!!!!!!!!!!!""""$")"."9"="B"L"e"EAlistair Cockburn0C:\Alistair\Articles\Coffee machine\Workshop.doc@HP LaserJet 4Si - TEK1Q\\osloserv4\tek1qHPPCL5MSHP LaserJet 4Si - TEK1QHP LaserJet 4Si - TEK1Q@w XX@MSUDNHP LaserJet 4Si ;d HP LaserJet 4Si - TEK1Q@w XX@MSUDNHP LaserJet 4Si ;d bbbPL Emng GVY   g h o p q     " # 3 9 D E I J m n u v w   J  k =YQUuRSvwMaD     59:ABCPbz{| &';P =Um?np8a  345=Jgjps56z{2346DEKR.  A B I J Z ` k l w z !!!!P!^!a!b!!O"Q"R"S"U"b"c"11 10p*0q*0*0*01111 1$1*1?$0x0z001$0z0$0'%1.%0%0} 0*0&+1 1v1w1'+0116+01111H+1J+1T+01 11_+1l+01 1&11~+01 1'1+01 1+1+1+1+00+0~ 1R0u1 1v1w1+1+1x010 1 1 10 1 1 1p0 100105111t010111F0b10Z1^1~1110100[1\011+1+11+010101 1 11t11 0!1A1C051Q1l1z111\1]1o0110101000_0111+1+1+1+11101010*1.010101 11,1,1,11010 10 1-0l0m1n1p051~11111K1L11071 191 1:1 1;0 1 1 1B1t1O1111111100110101000&101 1&11!,010&1'0+'0'101 1'13,010'11B,1 0 1C,1-121'1D,1'1'1'1'0'1'03(14(0l(1m(0l1(1a,07)0m1,1p051~118)1)0)1 1,1 1:1 1;0 1 1 1)1,0T*01,01,0101 1 -1-1-1$-010'1/-1:-1-1-1-1-1.0.00.1^.00#0060 0 1Times New Roman Symbol &Arial"A+,LZ<$SWorkshop on OO Design QualityAlistair CockburnAlistair Cockburn