Download presentation
Published byThomasine Briggs Modified over 9 years ago
1
OO-NIK 2002 4/16/2017 4:19 AM Objektorientering og Informasjonssystemer for det 21. århundre (Understand – Explore – Master – Control) NIK 2003 Oslo. 25 november 2003 Trygve Reenskaug IfI, UiO OO-NIK 2003 ©2002 Trygve Reenskaug
2
Legal Notice This presentation is copyright
OO-NIK 2002 Legal Notice 4/16/2017 4:19 AM This presentation is copyright ©2003 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. OO-NIK 2003 ©2002 Trygve Reenskaug
3
The Invention of Object Orientation
OO-NIK 2002 The Invention of Object Orientation 4/16/2017 4:19 AM Objects Simula I Multi Process C Algol-60 Augment Lisp E-R Simula 67 Smalltalk Role Modeling C++ UML 1.x Squeak Java UML 2.0 IS21c-Information Systems for the 21st Century OO-NIK 2003 ©2002 Trygve Reenskaug
4
Simula… A system description language
SIMULA BEGIN: By a system we mean a collection of components which are either acting upon other components, being acted upon, or mutually interacting…" OO-NIK 2003
5
SIMULA BEGIN fig. 1.1.2 A I I I I A MODEL SYSTEM PERSON LANGUAGE
SYSTEM DESCRIPTION I: Information transfer A: Actions OO-NIK 2003
6
SIMULA BEGIN (1973) Example: A Post Office System
COUNTER POST OFFICE DOOR COUNTER CLERK QUEUE CUSTOMER LIST OF TASKS CARRY OUT ALL TASKS CUSTOMER CARRY OUT ALL TASKS LIST OF TASKS CUSTOMER CARRY OUT ALL TASKS LIST OF TASKS OO-NIK 2003
7
The small, but significant, difference Procedure Oriented
[ Brad Cox 87] activityA duration... start… end... norm_ frontload (…) activityB weight...duration... start… end... Planner Client activityC weight...duration... start… end... crane_ frontload (…) activityF duration... start… end... OO-NIK 2003
8
The small, but significant, difference Object Oriented
[ Brad Cox 87] activityA duration... start… end... frontload (…) activityB weight...duration... start… end... Planner Client frontload (…) frontload(time) activityC weight...duration... start… end... activityF duration... start… end... OO-NIK 2003
9
Two Approaches to Object Orientation
"East Coast Approach": Object orientation is a smart programming artifact. An object is an instance of a class. "West Coast Approach": Object Orientation is a powerful tool for thinking. An object is an entity with a well-defined boundary and identity that encapsulates state and behavior without revealing its interior construction. OO-NIK 2003
10
The Clerk metaphor for Object Orientation
Object B Object A Message triggers method causes response Port TO-B toB IN Message TO-C toC IN TO-C toC Message Object C Methods Data Methods Data IN State Behavior Identity Encapsulation Polymorphism Communication (Collaboration) Inheritance Methods Data OO-NIK 2003
11
The Idea: Records --> Objects Some relevant shipyard objects
OO-NIK 2002 4/16/2017 4:19 AM Object representing the Shipyard Object representing a ship’s schedule Object representing the shipyard resources Object representing a construction activity Object representing a resource Our example is taken from a shipyard. We represent important aspects by objects and let work scheduling be performed through negotiation between these objects. Fikk ikke til… persistens typing, lack of encapsulation. Object representing a ship's part OO-NIK 2003 ©2002 Trygve Reenskaug
12
IS21c-Information Systems for the 21st Century
OO-NIK 2002 Smalltalk 4/16/2017 4:19 AM Objects Simula I Multi Process C Algol-60 Augment Lisp E-R Simula 67 Smalltalk Role Modeling C++ UML 1.x Squeak Java UML 2.0 IS21c-Information Systems for the 21st Century OO-NIK 2003 ©2002 Trygve Reenskaug
13
Alan Kay's Dynabook Owner can view, navigate, edit objects
OO-NIK 2002 Alan Kay's Dynabook Owner can view, navigate, edit objects 4/16/2017 4:19 AM OO-NIK 2003 ©2002 Trygve Reenskaug
14
Smalltalk Personal Information Environment
OO-NIK 2002 Smalltalk Personal Information Environment 4/16/2017 4:19 AM Klassesett, world's first personal computer OO-NIK 2003 ©2002 Trygve Reenskaug
15
Smalltalk-78 in Oslo with Else Nordhagen
OO-NIK 2002 Smalltalk-78 in Oslo with Else Nordhagen 4/16/2017 4:19 AM OO-NIK 2003 ©2002 Trygve Reenskaug
16
IS21c-Information Systems for the 21st Century
OO-NIK 2002 Objective C, C++ , Java 4/16/2017 4:19 AM Objects Simula I Multi Process C Algol-60 Augment Lisp E-R Simula 67 Smalltalk Role Modeling C++ UML 1.x Squeak Java UML 2.0 IS21c-Information Systems for the 21st Century OO-NIK 2003 ©2002 Trygve Reenskaug
17
Role Modeling / OOram Activity Objects
OO-NIK 2002 Role Modeling / OOram Activity Objects 4/16/2017 4:19 AM Objects Simula I Multi Process C Algol-60 Augment Lisp E-R Simula 67 Smalltalk Role Modeling C++ UML 1.x Squeak Java UML 2.0 IS21c-Information Systems for the 21st Century OO-NIK 2003 ©2002 Trygve Reenskaug
18
The original 1979 MVC The TOOL AS A COMPOSITE
Mental Model Computer Model Editor View Controller User OO-NIK 2003
19
IS21c-Information Systems for the 21st Century
OO-NIK 2002 UML 1.x 4/16/2017 4:19 AM Objects Simula I Multi Process C Algol-60 Augment Lisp E-R Simula 67 Smalltalk Role Modeling C++ UML 1.x Squeak Java UML 2.0 IS21c-Information Systems for the 21st Century OO-NIK 2003 ©2002 Trygve Reenskaug
20
Java class definition: Activity
OO-NIK 2002 Java class definition: Activity 4/16/2017 4:19 AM public class Activity { protected String name; protected int duration; protected int earlyStart = 0; protected int counter = 0; private Activity[] successors; … … … public void frontLoad (int time) { earlyStart = Math.max (earlyStart, time); if ((counter += 1) >= predecessors.length) { int fin = getEarlyFinish(); for (int i=0; i<successors.length; i++) { successors[i].frontLoad(fin+1); } } } … … … } public class Activity { protected String name; protected int duration; protected int earlyStart; protected int counter = 0; private Activity[] successors; … … … public void frontLoad (int time ) { earlyStart = Math.max (earlyStart, time); if ((counter += 1) >= predecessors.length) { int fin = getEarlyFinish(); for (int i=0; i<successors.length; i++) { successors[i].frontLoad(fin+1); } OO-NIK 2003 ©2002 Trygve Reenskaug
21
Activity UML class model
OO-NIK 2002 Activity UML class model 4/16/2017 4:19 AM Activity successors int duration; int earlyStart; int counter; * void frontLoad (int time); int getEarlyFinish(); * OO-NIK 2003 ©2002 Trygve Reenskaug
22
Activity UML class hierarchy model
OO-NIK 2002 Activity UML class hierarchy model 4/16/2017 4:19 AM Activity duration: int earlyStart: int counter: int NormalActivity resource: NormalResource / getEarlyFinish(): int frontLoad (int time): void getEarlyFinish(): int CraneActivity resource: CraneResource load: int / getEarlyFinish(): int 0..* 0..* successors Inheritance overrated: Too large surface area Cannot change superclasses, Delegation/components better, give better control. OO-NIK 2003 ©2002 Trygve Reenskaug
23
The essence of frontloading Communication
OO-NIK 2002 The essence of frontloading Communication 4/16/2017 4:19 AM Pred Act Succ 1: fL(t1) 2: fL(t2) * We change our perspective from classes to objects; from sets to individuals. This permits us to study patterns of interacting objects: What are the objects, what are their responsibilities, and how do their collaborate to achieve the system functionality. The role represents the object’s position in the structure. We see that instances of the Activity class play different roles: Predecessor, Activity, and Successor. Instances of the Project class are also Predecessors, in this way a Project can start the frontloading operation. The Project also plays the Successor role so that it can receive the final scheduling messages. We achieve a separation of concern; a collaboration describes the objects involved in one or more functions, describing the objects involved only and focusing on the relevant object properties. OO-NIK 2003 ©2002 Trygve Reenskaug
24
The essence of frontloading Communication Diagram
OO-NIK 2002 The essence of frontloading Communication Diagram 4/16/2017 4:19 AM Pred Act Succ 1: fL(t1) 2: fL(t2) * We change our perspective from classes to objects; from sets to individuals. This permits us to study patterns of interacting objects: What are the objects, what are their responsibilities, and how do their collaborate to achieve the system functionality. The role represents the object’s position in the structure. We see that instances of the Activity class play different roles: Predecessor, Activity, and Successor. Instances of the Project class are also Predecessors, in this way a Project can start the frontloading operation. The Project also plays the Successor role so that it can receive the final scheduling messages. We achieve a separation of concern; a collaboration describes the objects involved in one or more functions, describing the objects involved only and focusing on the relevant object properties. OO-NIK 2003 ©2002 Trygve Reenskaug
25
Specialization of Collaboration Frontloading with resources
OO-NIK 2002 Specialization of Collaboration Frontloading with resources 4/16/2017 4:19 AM 1: fL(t1) 2: fL(t2) Pred Act / Activity Succ * * 1 1.1: alloc() 1.2: reserv() * We change our perspective from classes to objects; from sets to individuals. This permits us to study patterns of interacting objects: What are the objects, what are their responsibilities, and how do their collaborate to achieve the system functionality. The role represents the object’s position in the structure. We see that instances of the Activity class play different roles: Predecessor, Activity, and Successor. Instances of the Project class are also Predecessors, in this way a Project can start the frontloading operation. The Project also plays the Successor role so that it can receive the final scheduling messages. We achieve a separation of concern; a collaboration describes the objects involved in one or more functions, describing the objects involved only and focusing on the relevant object properties. Res OO-NIK 2003 ©2002 Trygve Reenskaug
26
Interfaces in the Basic scheduling collaboration
OO-NIK 2002 Interfaces in the Basic scheduling collaboration 4/16/2017 4:19 AM The interfaces specify minimal requirements to receiving objects Pred fL(t1) Act fL(t2) Succ «Interface» FrontloadIntf frontLoad(t) We change our perspective from classes to objects; from sets to individuals. This permits us to study patterns of interacting objects: What are the objects, what are their responsibilities, and how do their collaborate to achieve the system functionality. The role represents the object’s position in the structure. We see that instances of the Activity class play different roles: Predecessor, Activity, and Successor. Instances of the Project class are also Predecessors, in this way a Project can start the frontloading operation. The Project also plays the Successor role so that it can receive the final scheduling messages. We achieve a separation of concern; a collaboration describes the objects involved in one or more functions, describing the objects involved only and focusing on the relevant object properties. OO-NIK 2003 ©2002 Trygve Reenskaug
27
UML 2.0 (Now being finalized)
OO-NIK 2002 UML 2.0 (Now being finalized) 4/16/2017 4:19 AM Objects Simula I Multi Process C Algol-60 Augment Lisp E-R Simula 67 Smalltalk Role Modeling C++ UML 1.x Squeak Java UML 2.0 IS21c-Information Systems for the 21st Century OO-NIK 2003 ©2002 Trygve Reenskaug
28
UML 2.0 Proposal: Components, Parts, Ports, Links
From partners' presentation to OMG Nov 2001 (With permission) OO-NIK 2003
29
? UML 3.0 ? An Executing System Environment
OO-NIK 2002 ? UML 3.0 ? An Executing System Environment 4/16/2017 4:19 AM Objects Simula I Multi Process C Algol-60 Augment Lisp E-R Simula 67 Smalltalk Role Modeling C++ UML 1.x Squeak Java UML 2.0 IS21c-Information Systems for the 21st Century OO-NIK 2003 ©2002 Trygve Reenskaug
30
We create system models to master our environment
OO-NIK 2002 We create system models to master our environment 4/16/2017 4:19 AM User's model of the application utility - cause and effect Architect's model of the running system objects - containment - roles - responsibilities behavior - interactions - state machines - actions Coder's model of the code classes - features - inheritance - packages - deployment User's model of the application utility - cause and effect Architect's model of the running system objects - containment - roles - responsibilities behavior - interactions - state machines - actions Coder's model of the code classes - features - inheritance - packages - deployment OO-NIK 2003 ©2002 Trygve Reenskaug
31
OO-NIK 2003
32
OO-NIK 2003
33
OO-NIK 2003
34
OO-NIK 2003
35
Thank You More info at OO-NIK 2003
36
OO-NIK 2002 4/16/2017 4:19 AM More details …. Unified Modeling Language (UML). Object Management Group. Version 2.0, Final Adopted specification Roles and artifacts in cognitive psychology: Steven Pinker: How the Mind Works. Norton, New York ISBN The reference work on role modeling: Reenskaug, Wold, Lehne: Working With Objects. This book is out of print. A .pdf version kan be downloaded free from The theory of role modeling: Egil P. Andersen: Conceptual Modeling of Objects. A Role Modeling Approach. Dr Scient thesis. Dept. of Informatics, University of Oslo. 4 November ftp://ftp.nr.no/pub/egil/ConceptualModelingOO.ps.gz Richard Pawson and Robert Matthews: Naked Objects. See OO-NIK 2003 ©2002 Trygve Reenskaug
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.