© trygve reenskaug 2011ark2011 slide 1 01.10.2015 07:52 trygve reenskaug institutt for informatikk...

22
© Trygve Reenskaug 2011 Ark2011 Slide 1 18.06.22 13:35 rygve Reenskaug rygve Reenskaug nstitutt for informatikk nstitutt for informatikk niversitetet i Oslo niversitetet i Oslo tp://www.artima.com/articles/dci_vision.html tp://www.artima.com/articles/dci_vision.html eim.ifi.uio.no/~trygver/themes/babyide eim.ifi.uio.no/~trygver/themes/babyide The DCI Architecture: A The DCI Architecture: A New Vision of Object- New Vision of Object- Oriented Programming Oriented Programming

Upload: dwight-lambert

Post on 29-Dec-2015

224 views

Category:

Documents


4 download

TRANSCRIPT

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

© Trygve Reenskaug 2011Ark2011 Slide 119.04.23 18:19

Trygve ReenskaugTrygve ReenskaugInstitutt for informatikkInstitutt for informatikkUniversitetet i OsloUniversitetet i Oslo

http://www.artima.com/articles/dci_vision.htmlhttp://www.artima.com/articles/dci_vision.html

heim.ifi.uio.no/~trygver/themes/babyideheim.ifi.uio.no/~trygver/themes/babyide

The DCI Architecture: A New The DCI Architecture: A New Vision of Object-Oriented Vision of Object-Oriented ProgrammingProgramming

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

© Trygve Reenskaug 2011Ark2011 Slide 219.04.23 18:19

Legal NoticeLegal 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.

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

© Trygve Reenskaug 2011Ark2011 Slide 519.04.23 18:19

Webster: ArcitectureWebster: Arcitecture

The art or science of building; specifically: the art or practice of designing and building structures and especially habitable ones

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

© Trygve Reenskaug 2011Ark2011 Slide 619.04.23 18:19

Our Hero: (End) UserOur Hero: (End) Userprogram execution creates valueprogram execution creates value

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

© Trygve Reenskaug 2011

The Direct Manipulation MetaphorThe Direct Manipulation Metaphor

Ark2011 Slide 719.04.23 18:19

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

© Trygve Reenskaug 2011

MVC MVC – Model View Controller– Model View Controller

Ark2011 Slide 819.04.23 18:19

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

© Trygve Reenskaug 2011Ark2011 Slide 1219.04.23 18:19

Object-OrientationObject-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.

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

© Trygve Reenskaug 2011Ark2011 Slide 1319.04.23 18:19

A Rapidly ChangingA Rapidly ChangingNetwork of Communicating ObjectsNetwork of Communicating Objects

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

© Trygve Reenskaug 2011Ark2011 Slide 1419.04.23 18:19

The Distributed OrganizationThe Distributed OrganizationAn Object Oriented ModelAn Object Oriented Model

ICCAS 1973

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

© Trygve Reenskaug 2011Ark2011 Slide 1519.04.23 18:19

RestrictedOO: Object does the right thingRestrictedOO: Object does the right thingFullOO: System does the right thingFullOO: System does the right thing

RestrictedOO

1

Full OO

3

2

4

5Restricted

OORestricted

OORestricted

OO

1

Full OOFull OO

3

2

4

5

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

© Trygve Reenskaug 2011Ark2011 Slide 1619.04.23 18:19

Bank

ToAccount

transfer (amount, fromAccount, toAccount)

FromAccount

transfer (amount,toAccount)

deposit (amount)

Customer

End User’s Mental ModelEnd User’s Mental Model What the system DOESWhat the system DOES

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

© Trygve Reenskaug 2011Ark2011 Slide 1719.04.23 18:19

Use CasesUse CasesSeparation of Concern: IS and DOESSeparation of Concern: IS and DOES

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

© Trygve Reenskaug 2011Ark2011 Slide 1819.04.23 18:19

Use CasesUse CasesSeparation of Concern: IS and DOESSeparation of Concern: IS and DOES

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

© Trygve Reenskaug 2011Ark2011 Slide 1919.04.23 18:19

Use CaseUse CaseExecuted in a ContextExecuted in a Context

Context-1

UseCase-1

UseCase-2

Context-2

BankTransfer

BankTransferContext

Role binding

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

© Trygve Reenskaug 2011Ark2011 Slide 2019.04.23 18:19

Coplien, Bjørnvig: Lean ArchitectureCoplien, Bjørnvig: Lean ArchitectureISBN: 978-0-470-68420-7ISBN: 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 stateWhat the system DOES: Its behavior

No wasteGet it right the first time!Be prepared for changes!

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

© Trygve Reenskaug 2011Ark2011 Slide 2119.04.23 18:19

ConclusionConclusionDCI = Mental Model + Readable CodeDCI = Mental Model + Readable Code

The DCI paradigm:Work with system in different perspectives

• D ata Objects for what the system ISRestricted OO for domain information

• C ontext for the network of communicating objectsmarshal participating role-playing objects .

• I nteraction for what the system DOESdescribes runtime behavior

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

© Trygve Reenskaug 2011

Combining Structure and Algorithm in a ClassCombining Structure and Algorithm in a Class

Ark2011 Slide 2219.04.23 18:19

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

© Trygve Reenskaug 2011

Combining Structure and Algorithm in an ObjectCombining Structure and Algorithm in an Object

INF5120 Slide 2319.04.23 18:19

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

© Trygve Reenskaug 2011

Mapping Roles to ObjectsMapping Roles to Objects

INF5120 Slide 2419.04.23 18:19

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

© Trygve Reenskaug 2011

TraitsTraits

INF5120 Slide 2519.04.23 18:19

 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.

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

© Trygve Reenskaug 2011Ark2011 Slide 2619.04.23 18:19

http://www.ifi.uio.no/~trygver mailto:

Useful Web resources:http://fullOO.infohttp://www.leansoftwarearchitecture.com/home/more-online-resourceshttp://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

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 readingMore reading

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

© Trygve Reenskaug 2011Ark2011 Slide 2719.04.23 18:19

Comments?Questions?