The Common Sense of Object Oriented Programming UMLChina

The Common Sense of Object Oriented Programming UMLChina, December, 2008 Trygve Reenskaug Department of Informatics University of Oslo http: //folk. uio. no/trygver/ UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 1

Plan for talk 1958 - My first programs Software engineering in focus 1960 - Ship CAD/CAM Ship designer in focus 1970 - Distributed computing Business organization in focus 1978 - MVC User experience i focus 1980 - Role modeling Modeling processes in focus 1997 - Baby. UML- DCI paradigm Object oriented programming in focus 2008 - Baby. IDE Habitable programming tools in focus UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 2

Autokon (1960 -) Ship Design and Manufacture Mental model Computer Flame cutter http: //heim. ifi. uio. no/~trygver/2003/Hi. NC/hinc-18 final. pdf UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 3

What it is All About Build Tools for the End Users magic mental model commands Program presentations UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 4

System Distribution reflects organization structure http: //heim. ifi. uio. no/~trygver/1973/iccas/1973 -08 -ICCAS. pdf UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 5

MVC Model – View – Controller (1 of 2) magic mental model Model View User Illusion of magic: User works with own Mental Model UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 6

MVC makes a Tool Controller Coordinates Views magic mental model Controller 1 User Model * View Illusion of magic: User works with own Mental Model UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 7

Modeling Use Case with Roles a business organization Ruth (President) Adam (Chief Accountant) Joe (Paymaster) Eve (Software Manager) Douglas (Marketing manager) Elsie (Programmer) Joyce (Sales clerk) Bill (Dispatcher) UMLChina Bill (Bookkeeper) Peter (Technical author) John (Cashier) Kim (Methodologist) © Trygve Reenskaug 2008 Ann (Consultant) 9/6/2021 Slide 8

Modeling Use Case with Roles sample expense account process Ruth (President) Adam (Chief Accountant) Eve (Software Manager) Joe (Paymaster) Douglas (Marketing manager) Elsie (Programmer) 4: Bill (Bookkeeper) 3: 2: Joyce (Sales clerk) 1: Bill (Dispatcher) Peter (Technical author) Ann (Consultant) 5: John (Cashier) UMLChina 6: Kim (Methodologist) © Trygve Reenskaug 2008 9/6/2021 Slide 9

Modeling with Roles the role abstraction Ruth (President) Data Adam (Chief Accountant) Eve Authorizer (Software Manager) Joe (Paymaster) Douglas (Marketing manager) Elsie (Programmer) 4: Bill 3: 2: 1: 5: John Cashier (Cashier) 6: Context Bill (Dispatcher) Peter Traveler (Technical author) Bookkeeper (Bookkeeper) Joyce (Sales clerk) 4: Ann (Consultant) Kim (Methodologist) 5: 3: 2: 1: 6: Interaction Reenskaug et. al. : Working with objects. The OOram Software Engineering Method. Manning 1996; ISBN 1 -884777 -10 -4. UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 10

Gamma, Helm, Johnson, Vlissides: Design Patterns An object-oriented program's run-time structure often bears little resemblance to its code structure. • The code structure is frozen at compile-time; it consists of classes in fixed inheritance relationships. • The run-time structure consists of rapidly changing networks of communicating objects. …, it's clear that code won't reveal everything about how a system will work. [GOF] Gamma, E; Helm, R; Johonson, R; Vlissides, J: Design Patterns; ISBN 0 -201 -63361 -; Addison-Wesley, Reading, MA. 1995. p. 22, 23 UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 11

The DCI Paradigm System state and System behavior D ata The data classes - What the system IS C ontext The roles and their connectors - The stage where things happen I nteraction The players interact to achieve a use case - What the system DOES and how it does it UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 12

“Rapidly changing networks of communicating objects” ID=436 ID=351 ID=784 ID=442 ID=993 http: //heim. ifi. uio. no/~trygver/assets/animate-arrows. mpeg UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 13

Edsger W. Dijkstra from “GOTO considered harmful” • our powers to visualize processes evolving in time are relatively poorly developed. • shorten the conceptual gap between the static program and the dynamic process, • make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible. UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 14

Programmer Centered Programming mental DCI model magic Baby. IDE Program Computer Programmer UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 15

Baby. IDE screendump Interaction perspective UMLChina A B C D © Trygve Reenskaug 2008 9/6/2021 Slide 16

Conclusion DCI = Readable Code Dijkstra’s ideal: make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible. The DCI paradigm: Work with program in different perspectives • D ata Classes for what the system IS • C • I UMLChina ontext for seeing the Roles and Objects nteraction for what the system DOES © Trygve Reenskaug 2008 9/6/2021 Slide 17

State of Baby. IDE Project DCI Squeak mechanism ready Implementations in C++, Ruby, Scala, Python in progress. Java is difficult. Baby. IDE Squeak Demo version available Squeak Alpha version soon Professional IDE Basic technology is open, I hope professional toolmakers will pick it up. For now: No general tools available Think about the reader of your code Try Mediator pattern! UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 18

That’s all. Thank you for listening. Comments, Questions? http: //heim. ifi. uio. no/~trygver/ UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 19

Legal Notice This presentation is copyright © 2008 Trygve Reenskaug Oslo, Norway. All rights reserved. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that the copies are not made for profit or commercial advantage and that copies bear this notice and full citation on the first page. UMLChina © Trygve Reenskaug 2008 9/6/2021 Slide 20
- Slides: 20