Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Trygve Reenskaug 2011Ark2011 Slide 1 01.10.2015 07:52 Trygve Reenskaug Institutt for informatikk Universitetet i Oslo

Similar presentations


Presentation on theme: "© Trygve Reenskaug 2011Ark2011 Slide 1 01.10.2015 07:52 Trygve Reenskaug Institutt for informatikk Universitetet i Oslo"— Presentation transcript:

1 © Trygve Reenskaug 2011Ark2011 Slide 1 01.10.2015 07:52 Trygve Reenskaug Institutt for informatikk Universitetet i Oslo http://www.artima.com/articles/dci_vision.html heim.ifi.uio.no/~trygver/themes/babyide The DCI Architecture: A New Vision of Object-Oriented Programming

2 © Trygve Reenskaug 2011Ark2011 Slide 2 01.10.2015 07:52 Legal Notice This presentation is copyright ©2011 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.

3 © Trygve Reenskaug 2011Ark2011 Slide 3 01.10.2015 07:52 The Essence of Object Orientation An object by itself is not interesting The essence of object orientation is that objects communicate to achieve a common goal  We need explicit code that clearly specifies the context = a network of communicating objects + the responsibility of each object

4 © Trygve Reenskaug 2011Ark2011 Slide 4 01.10.2015 07:52 Candidate – Responsibility – Collaboration CRC – Card Examples name = FromAccount responsibility = This is the source account for the funds transfer collaborators = ToAccount name = ToAccount responsibility = This is the destination account for the funds transfer collaborators = none Rebecca Wirfs-Brock: Responsibility Driven Design

5 © Trygve Reenskaug 2011Ark2011 Slide 5 01.10.2015 07:52 Webster: Arcitecture The art or science of building; specifically: the art or practice of designing and building structures and especially habitable ones

6 © Trygve Reenskaug 2011Ark2011 Slide 6 01.10.2015 07:52 Our Hero: (End) User program execution creates value

7 © Trygve Reenskaug 2011 The Direct Manipulation Metaphor Ark2011 Slide 7 01.10.2015 07:52

8 © Trygve Reenskaug 2011 MVC – Model View Controller Ark2011 Slide 8 01.10.2015 07:52

9 © Trygve Reenskaug 2011Ark2011 Slide 9 01.10.2015 07:52 Conclusion – 2 of 2 DCI = End User Mental Model system mental model physical What the system DOES magic: What the system IS Computer Augmentation!

10 © Trygve Reenskaug 2011Ark2011 Slide 10 01.10.2015 07:52 IN State Behavior IN State Behavior Each object must behave appropriately ”Do The Right Thing” IN State Behavior Class

11 © Trygve Reenskaug 2011Ark2011 Slide 11 01.10.2015 07:52 IN State Behavior IN State Behavior Network of Communicating Objects Object-Centered Thinking with Roles IN State Behavior What are the objects? How are they interconnected? What do they do?

12 © Trygve Reenskaug 2011Ark2011 Slide 12 01.10.2015 07:52Object-Orientation In computer terms, Smalltalk is a recursion on the notion of computer itself. Instead of dividing “computer stuff” into things each less strong than the whole—like data structures, procedures, and functions which are the usual paraphernalia of programming languages—each Smalltalk object is a recursion on the entire possibilities of the computer. Thus its semantics are a bit like having thousands and thousands of computer all hooked together by a very fast network. Questions of concrete representation can thus be postponed almost indefinitely because we are mainly concerned that the computers behave appropriately, and are interested in particular strategies only if the results are off or come back too slowly.

13 © Trygve Reenskaug 2011Ark2011 Slide 13 01.10.2015 07:52 A Rapidly Changing Network of Communicating Objects

14 © Trygve Reenskaug 2011Ark2011 Slide 14 01.10.2015 07:52 The Distributed Organization An Object Oriented Model ICCAS 1973

15 © Trygve Reenskaug 2011Ark2011 Slide 15 01.10.2015 07:52 RestrictedOO: Object does the right thing FullOO: System does the right thing

16 © Trygve Reenskaug 2011Ark2011 Slide 16 01.10.2015 07:52 Bank ToAccount transfer (amount, fromAccount, toAccount) FromAccount transfer (amount,toAccount) deposit (amount) Customer End User’s Mental Model What the system DOES

17 © Trygve Reenskaug 2011Ark2011 Slide 17 01.10.2015 07:52 Use Cases Separation of Concern: IS and DOES

18 © Trygve Reenskaug 2011Ark2011 Slide 18 01.10.2015 07:52 Use Cases Separation of Concern: IS and DOES

19 © Trygve Reenskaug 2011Ark2011 Slide 19 01.10.2015 07:52 Use Case Executed in a Context Context-1 UseCase-1 UseCase-2 Context-2 BankTransfer BankTransferContext Role binding

20 © Trygve Reenskaug 2011Ark2011 Slide 20 01.10.2015 07:52 Coplien, Bjørnvig: Lean Architecture ISBN: 978-0-470-68420-7 Lean Principle: ”everybody, all together, from early on.” System architecture shall reflect the end user's mental model. Architecture has two parts: What the system IS: Its state What the system DOES: Its behavior No waste Get it right the first time! Be prepared for changes!

21 © Trygve Reenskaug 2011Ark2011 Slide 21 01.10.2015 07:52 Conclusion DCI = Mental Model + Readable Code The DCI paradigm: Work with system in different perspectives D ata Objects for what the system IS Restricted OO for domain information C ontext for the network of communicating objects marshal participating role-playing objects. I nteraction for what the system DOES describes runtime behavior

22 © Trygve Reenskaug 2011 Combining Structure and Algorithm in a Class Ark2011 Slide 22 01.10.2015 07:52

23 © Trygve Reenskaug 2011 Combining Structure and Algorithm in an Object INF5120 Slide 23 01.10.2015 07:52

24 © Trygve Reenskaug 2011 Mapping Roles to Objects INF5120 Slide 24 01.10.2015 07:52

25 © Trygve Reenskaug 2011Traits INF5120 Slide 25 01.10.2015 07:52 If a role is an analysis concept (from the mind of the end user), then a trait is a general design concept that represents the role, and its implementation varies from programming language to programming language.

26 © Trygve Reenskaug 2011Ark2011 Slide 26 01.10.2015 07:52 http://www.ifi.uio.no/~trygver mailto: Useful Web resources: http://fullOO.info http://www.leansoftwarearchitecture.com/home/more-online-resources http://www.gertrudandcope.com/thedciarchitecture http://fullOO.info http://www.leansoftwarearchitecture.com/home/more-online-resources http://www.gertrudandcope.com/thedciarchitecture DCI project mailinglist: Coplien, J.O., Bjørnvig, G; Lean Architecture for Agile Software Development; Wiley, Chichester, UK, 2010; ISBN 978-0-470-68420-7 Kay, Alan; The Early History of Smalltalk; Proceeding HOPL-II The second ACM SIGPLAN conference on History of programming languages; ACM New York, NY, USA 1993; ISBN:0-89791- 570-4; doi>10.1145/154766.155364; http://www.smalltalk.org/smalltalk/TheEarlyHistoryOfSmalltalk_Introduction.html http://www.smalltalk.org/smalltalk/TheEarlyHistoryOfSmalltalk_Introduction.html Reenskaug, T; Wold, P.;, Lehne, O. A.: Working With Objects; Manning, Greenwich, CT 06830;1996; ISBN 1-884777-10-4; (Prentice Hall ISBN 0-13-452930-8). This book is out of print. An early.pdf version kan be downloaded free from [web page] http://folk.uio.no/trygver/1996/book/book11d.pdf Wirfs-Brock, R.; McKean, A.; Object Design. Roles, Responsibilities, and Collaborations. ISBN 0 ‑ 201 ‑ 37943 ‑ 0; Addison-Wesley; Boston, MA, 2003. Gamma et.al. (GOF) Design Patterns; ISBN 0-201-63361-; Addison-Wesley, Reading, MA. 1995. More reading

27 © Trygve Reenskaug 2011Ark2011 Slide 27 01.10.2015 07:52 Comments? Questions?


Download ppt "© Trygve Reenskaug 2011Ark2011 Slide 1 01.10.2015 07:52 Trygve Reenskaug Institutt for informatikk Universitetet i Oslo"

Similar presentations


Ads by Google