Working with objects: Designing Distributed Systems for Reuse TASKON

advertisement
Working with objects:
Designing Distributed Systems for Reuse
Trygve Reenskaug, Odd Arild Lehne
©Taskon 1997
OOPSLA '97 tutorial # 26
Atlanta, Georgia, 5 October 1997
TASKON
Work Environments
Taskon, Gaustadalléen 21, N-0371 Oslo 3 Norway.
Tel. + (47) 22 95 86 31 Telefax: + (47) 22 60 44 27
1.
Working with objects
Designing Distributed Systems for Reuse
OOPSLA Tutorial # 26
Trygve Reenskaug, Odd Arild Lehne
Taskon, Oslo
odda@taskon.no
trygve@taskon.no
1.1
Motto:
There are two ways of constructing
a software design:
- One way is to make it so simple
that there are obviously no deficiencies
- and the other way is to make it so complicated
that there are no obvious deficiencies.
-- C. A. R. Hoare
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 1
1.2
Three dimensions
of software development
Process
and
Deliverables
User
Req.
Des.
Impl.
Real World
Objects
Implementation
Roles
Technology
(Concepts-Notation-Tools)
Organization
(Value Chain)
1.3
Incidental and planned reuse
Incidental reuse (ad hoc):
¤ search existing solutions for applicable
ideas, models, code, ...
Planned reuse (product development):
¤ Understand the business
¤ Understand the developers
¤ Understand applicable solutions
¤ Create reusable designs and code
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 2
1.4
Reusable component lifecycle
Build
experience
Capture
experience
Application
Programming,
Isolated
Applications:
- analyze
- design
- implement
Production
Engineering:
Create
Pool of
Reusable Assets
Reuse
experience
Application
Programming,
Family of
Applications:
- analyze
- design
- implement
Role Modeling technology
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 3
2.
Role Modeling
Focus On Object Collaboration
Build
experience
Capture
experience
Application
Programming,
Isolated
Applications:
- analyze
- design
- implement
Reuse
experience
Application
Programming,
Family of
Applications:
- analyze
- design
- implement
Production
Engineering:
Create
Pool of
Reusable Assets
Role Modeling technology
2.1
Four aspects of OO modeling
Interface modeling
The interface is
a what abstraction
What does this object look like?
Role modeling
The role is
the why abstraction
Why do we have
this object?
Object
Oriented
Modeling
Class modeling
The class is
the how abstraction
How is this object
implemented?
Data modeling
The entity is
another what abstraction
What does it mean?
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 4
2.1.1
Simple examples
interface Number {
Number add (Number num);
Number subtract (Number num);
Number multiply (Number num);
Number divide (Number num);
Interface modeling
Numerator
Collaboration
Fraction
Denominator
Number
Object
Oriented
Modeling
Data modeling
Inheritance
Integer
Real
function
Number
2.2
Main features of role modeling
¤ We only show relevant
----
objects
aspects
details
¤ We abstract object identity
to its position in the pattern
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 5
2.2.1
Model inheritance: Specialization
Base model: Fraction
Numerator
Fraction
Denominator
Voltage
Current
Resistance
Derived model: Ohms law
2.2.2
Separation of concern:
Three uses of synthesis
1.
Specialization
-- generalization
2.
Composition on
same level of abstraction
3.
Aggregation
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 6
2.2.3
Composition on
same level of abstraction
Numerator
Example
Fraction
4
7
Denominator
8
Top
Numerator
Top
Fraction
Sub
Numerator
Sub
Fraction
Sub
Denominator
2.2.4
Aggregation
Top
Numerator
Example
Top
Fraction
TopDenominator
Sub
Fraction
Working with objects:
Designing Distributed Systems for Reuse
4
Sub
Numerator
7
( )
8
Sub
Denominator
©Taskon 1997. Page 7
2.2.5
Important observations:
*
A model is created for a purpose.
*
A model is never complete.
*
We think in multiple models, always trying to choose the best model
for our purpose.
*
We tend to think in hierarchical models, even though the world is
rarely hierarchical.
2.3
Role Model Advantages
¤
¤
¤
¤
¤
Role models describe object patterns
Modeling distribution
Separation of Concern
Reuse through model inheritance
Seamless bridge to implementation
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 8
2.4
Role models describe object patterns
Controller
modifyModel
edit
Model
User
update
getInformation
View
present
2.4.1
Role Model Collaboration view notation
Icon, indicating
nature of role
System
role
Environment
role
Controller
Model
User
Port,
containing
interface to single
collaborator
Working with objects:
Designing Distributed Systems for Reuse
user
View
Port,
containing
interface to multiple
collaborator
©Taskon 1997. Page 9
2.4.2
Compare with class hierarchy
(VisualWorks class library)
Controller
- ControllerWithMenu
- - ListController
- StandardSystemController
...
View
- AutoScrollingView
- - ListView
- FractionalWidgetView
- LauncherView
- Scrollbar
...
Model
- Browser
- - Debugger
- Inspector
- - ContextInspector
- - DictionaryInspector
- PopUpMenu
...
2.4.3
Environment Collaboration view
Port (messages sent)
present
User
System
edit
Environment role
Working with objects:
Designing Distributed Systems for Reuse
Virtual role
(hides many)
©Taskon 1997. Page 10
2.4.4
Scenario view
User
Controller
View
Model
Message
interaction
modifyModel
modify()
Interaction
sequence
update()
getInformation()
present()
2.4.5
Role modeling
focuses on object patterns
Object B
Object A
Port
Message
OUT-B
IN
IN
Message
OUT-C
Methods
Methods
OUT-C
Object C
Variables
Variables
IN
Identity
Encapsulation
Polymorphism
Working with objects:
Designing Distributed Systems for Reuse
Message
Methods
Variables
©Taskon 1997. Page 11
2.5
Modeling distribution
Client
Windowing
System
Server
Application
DataBase
(a) Two-tier, Fat Server
Windowing
System
Application
DataBase
(b) Two-tier, Fat Client
Windowing
System
TaskOriented
Tool
Domain
Logic
DataBase
(b) Four-tier, Tool and Service
2.5.1
Determine distribution architecture
Iterate
Select possible communication architecture
¤ Evaluate communication requirements
¤ Choose communication method
- e.g., on demand
- e.g., caching
¤ Estimate communication costs (time, money)
Implement solution
¤ Subclass frameworks
¤ Specialize code
¤ Optimize code
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 12
2.6
Separation of Concern
A TextView object plays many roles
VisualPart
role
Windowing
role model
View
role
MVC
role model
TextView
role
TextEditor
role model
class TextView instance
2.7
Reuse through model inheritance
Controller
User
Model
View
Inherit
dynamic properties:
- Use cases
- Message flows
- Data flows
- Finite State Machines
Working with objects:
Designing Distributed Systems for Reuse
Inherit
static properties:
- Semantics
- Responsibility
- Attributes
- Base classes
Text
Controller
Text
Store
User
Text
View
©Taskon 1997. Page 13
2.8
Seamless bridge to implementation
interface ViewModel {
void update ();
// Model has changed, refresh
}
interface ViewController {
text select (); }
Controller
User
Model
View
abstract class View implements
ViewController, ViewModel
{···}
2.8.1
Method views
Inside object perspective
MVC
View
update()
TextEditor
/* Retrieve contents from
model. */
/* Redisplay contents. */
/* abstract method */
Text
View
User
Text
Store
update()
/* Retrieve text from model.
*/
/* Redisplay text. */
text.displayOn ()
Working with objects:
Designing Distributed Systems for Reuse
getText()
presentToUser
©Taskon 1997. Page 14
2.8.2
Mapping concepts
from OOram to implementation
Roles
--> Interfaces
--> Classes
Ports
--> Member variables & other references
--> Interfaces
Messages
--> Methods
Model inheritance
--> Class ensemble inheritance
2.8.3
Program code
Class perspective
abstract class View implements ViewController, ViewModel {
Model model;
ControllerView controller;
abstract void select (···) ;
abstract void update (···) ;
// Model has changed, refresh
···
}
class TextView extends View
implements TextViewController TextViewText {
Text textCache;
void update () {
//Retrieve text from model.
textCache = model.getText();
//Redisplay text.
this.display();
}
}
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 15
2.8.4
Semantic model - Object System
composed_of
Object
System
implemented by
composed_of
Object
implemented by
plays
Role
Model
responds
to and uses
consists of
Role
(Why)
uses
Working with objects:
Designing Distributed Systems for Reuse
Interface
(What)
implements
Program
consists of
Class
(How)
©Taskon 1997. Page 16
3.
The first isolated application
Card access control system (CAC)
Build
experience
Capture
experience
Application
Programming,
Isolated
Applications:
- analyze
- design
- implement
Production
Engineering:
Create
Pool of
Reusable Assets
Reuse
experience
Application
Programming,
Family of
Applications:
- analyze
- design
- implement
Role Modeling technology
3.1
An Access Control problem
Area of concern
An office complex has
a number of office areas
separated by automatic doors.
We want to limit the access of
different persons through
a system of machine-readable
identity cards.
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 17
3.2
User interfaces
Prototype Program
3.3
Process Steps
¤ Define Area Of Concern
¤ Describe system seen from environment
¤ Consider system architecture
¤ Consider separation of concern
For each sub-system:
- Describe system seen from environment
- Describe system roles and collaborations
¤ Synthesize system from sub-systems
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 18
3.3.1
System seen from environment
Environment collaboration view
Person
System
Manager
System
Door
3.3.2
System seen from environment
Stimulus-Response view
Stimulus message
Response
Comment
Person.identification (from);
Door.open ();
// time delay
Door.close();
Person accepted
Person.reject ();
Person rejected
AlarmHandler
Door left open
.doorOpenAlarm();
SystemManager
Access data base
.addPersonWithAccess (); updated
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 19
3.3.3
System Architecture
A Choice
Person
Local
Station
Door
System
Manager
Central
Station
3.3.4
Separation of Concern
Management
Validation
On activities
(Role modeling)
Person
On objects
(Data modeling)
Door
Local
Station
Local Objects
On classes
(Class modeling)
Input
Working with objects:
Designing Distributed Systems for Reuse
Device
System
Manager
Central Objects
Person
Object
Central
station
Output
Input/Output
Card Reader
Keyboard
Display
Door
©Taskon 1997. Page 20
3.3.5
Consider Separation of concern
Hints for separation of concern:
¤ Separate on stimulus objects
¤ Separate on stimulus messages
Stimulus message
Response
Comment
Person.identification (from);
Door.open ();
// time delay
Door.close();
Person accepted
Person.reject ();
Person rejected
(VAL)
AlarmHandler
Door left open
.doorOpenAlarm();
SystemManager
Access data base
.addPersonWithAccess (); updated
(MS)
3.3.6
Revised plan for system development
Card only access control system (CA)
- System seen from environment
- Separation of concern
Management subsystem (MS)
- Environment
- Inter object views
- Inside object views
Validation subsystem (VAL)
- Environment
- Inter object views
- Inside object views
synthesis
Card only access control system (CA)
- System Implementation
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 21
3.4
Validation subsystem (VAL)
Card only access control system (CA)
- System seen from environment
- Separation of concern
Validation subsystem (VAL)
- Environment
- Inter object views
- Inside object views
Management subsystem (MS)
- Environment
- Inter object views
- Inside object views
synthesis
Card only access control system (CA)
- System Implementation
3.4.1
Validation Environment
CO
CardReader
CO
Controller
CO
Validator
SD
CO
Door
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 22
3.4.2
VAL Normal access scenario
CO
CardReader
CO
Door
CO
Controller
CO
Validator
check()
validate()
openDoor()
closeDoor()
3.4.3
VAL Open door alarm scenario
CO
CardReader
CO
Door
CO
Controller
CO
Validator
check()
validate()
openDoor()
closeDoor()
alarm()
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 23
3.4.4
Validation sub-system
Controller details
CO
CardReader
CO
Controller
CO
Validator
SD
CO
Door
Delay
class
Delay
3.4.5
Validation
Normal access scenario
Controller details
CO
CardReader
CO
Door
CO
Controller
Delay
Delay
class
CO
Validator
check()
validate()
openDoor()
forSeconds()
wait()
closeDoor()
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 24
3.4.6
Inside object perspective
Controller state diagram
putName()
NotOK()
Idle
Closed
Validating
Closed
OK()
doorClosedOK()
doorClosedOK()
doorNotClosed()
Alarm
Open
timeout()
Closing
Open
3.4.7
Inside object perspective
A Controller Method
CO
Controller
check()
CO
Door
Delay
CO
Validator
Fsm
Accept identification string
from Person via
CardReader
Only if open door alarm:
Working with objects:
Designing Distributed Systems for Reuse
validate()
openDoor()
wait()
closeDoor()
alarm()
©Taskon 1997. Page 25
3.5
Management subsystem (MS)
Card only access control system (CA)
- System seen from environment
- Separation of concern
Validation subsystem (VAL)
- Environment
- Inter object views
- Inside object views
Management subsystem (MS)
- Environment
- Inter object views
- Inside object views
synthesis
Card only access control system (CA)
- System Implementation
3.5.1
Area of Concern
MS Design Model
An office complex has
a number of office areas
separated by automatic doors.
We shall design a subsystem
that permits a SystemManager
to manage people's
access privileges
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 26
3.5.2
Describe object structure
MS Design Model
Stimulus message
Response
SystemManager
Access data base
. addPersonWithAccess
System
Manager
updated
Management
Subsystem
3.6
Card access control system (CA)
Card only access control system (CA)
- System seen from environment
- Separation of concern
Validation subsystem (VAL)
- Environment
- Inter object views
- Inside object views
Management subsystem (MS)
- Environment
- Inter object views
- Inside object views
synthesis
Card only access control system (CA)
- System Implementation
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 27
3.6.1
Synthesize from subsystems
CA Design model
CO
CardReader
CO
Controller
CO
Validator
SD
CO
Door
Management
Subsystem
System
Manager
¤ Synthesis not required
¤ Implement single class for Validator+Management roles
3.6.2
The Validator type satisfies
COValidator and ManagementSubsystem
Roles
Validator
Type
CO
Controller
validate();
alarm();
System
Manager
addPerson();
removePerson();
¤ Synthesis not required
¤ Implement single class for Validator+Management roles
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 28
3.7
Summary
First isolated application
Card only access control system (CA)
- System seen from environment
- Separation of concern
Management subsystem (MS)
- Environment
- Inter object views
- Inside object views
Validation subsystem (VAL)
- Environment
- Inter object views
- Inside object views
synthesis
Card only access control system (CA)
- System Implementation
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 29
4.
The second isolated application
Keyboard only access control (KO)
Build
experience
Application
Programming,
Isolated
Applications:
- analyze
- design
- implement
Capture
experience
Production
Engineering:
Create
Pool of
Reusable Assets
Reuse
experience
Application
Programming,
Family of
Applications:
- analyze
- design
- implement
Role Modeling technology
4.1
Area of concern
Keyboard only access control (KO)
An office complex has
a number of office areas
separated by automatic doors.
We want to limit the access of
different persons through
a Keyboard Secret Code
system.
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 30
4.2
Incidental reuse
search existing solutions
for applicable
ideas, models, code, ...
4.3
Stimulus-Response view
Keyboard only access control (KO)
Stimulus message
Response
Comment
Person.identification (from);
Door.open ();
// time delay
Door.close();
Person accepted
Person.reject ();
Person rejected
AlarmHandler
Door left open
.doorOpenAlarm();
SystemManager
Access data base
.addPersonWithAccess (); updated
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 31
4.4
Collaboration View
Keyboard only access control (KO)
Different Device
Different Data
Different Test
KO
Keyboard
KO
Controller
KO
Validator
SD
KO
Door
Delay
class
Delay
4.5
Normal Access Scenario View
Keyboard only access control (KO)
KO
Keyboard
KO
Door
KO
Controller
KO
Validator
Delay
Delay
class
check()
validate()
openDoor()
forSeconds()
wait()
closeDoor()
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 32
5.
Creating reusable components
Build
experience
Application
Programming,
Isolated
Applications:
- analyze
- design
- implement
Capture
experience
Reuse
experience
Production
Engineering:
Create
Pool of
Reusable Assets
Application
Programming,
Family of
Applications:
- analyze
- design
- implement
Role Modeling technology
5.1
Large systems from small projects
Large system,
Small project
Large system,
Large project
Small system,
Small project
Working with objects:
Designing Distributed Systems for Reuse
ASSETS
OF
REUSABLE
COMPONENTS
©Taskon 1997. Page 33
5.2
The Taskon Fountain Model
for Planned Reuse
HAPPY
END USER
Forward
engineering
Reverse
engineering
Application
programming
Production
engineering
Pool of Reusable assets
5.3
Some reuse terminology - 1
Alexander:
A pattern is a description of a problem
with hints for its solution
ensuring coherence and humanity
Some OO methodologists:
An object pattern is a
structure of interacting objects
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 34
5.4
Some reuse terminology - 2
OOram Pattern:
An OOram pattern is a description
of a problem with a
Role Model describing its solution
OOram Framework:
A canned solution with role model
+ base classes for subclassing
5.5
Creating an OOram framework
¤ Identify consumers and consumer needs
¤ Perform cost-benefit analysis
¤ Perform reverse engineering
on existing applications
¤ Create new framework(s)
¤ Inform user community
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 35
5.6
Identify reusable activities:
CO Scenario view
CO
CardReader
CO
Door
CO
Controller
Delay
class
Delay
CO
Validator
check()
validate()
openDoor()
forSeconds()
wait()
closeDoor()
5.7
Isolate reusable parts
Inverse synthesis
CO
CardReader
CO
Door
CO
Controller
Delay
Delay
class
CO
Validator
InputDevice
check()
AC
Controller
AC
Validator
validate()
AC
Door
openDoor()
forSeconds()
Delay
class
wait()
Delay
Reusable Asset
closeDoor()
InputDevice
AC
Controller
AC
Door
AC
Validator
Delay
class
Delay
check()
What's left
validate()
openDoor()
CO
Card Reader
CO
Controller
CO
Validator
wait()
closeDoor()
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 36
5.8
Object Management Group (OMG):
Event Service (simplified)
CORBA
Event Channel
Event
Channel
Consumer
Admin
Supplier
Admin
Proxy
Supplier
Proxy
Consumer
Consumer
Supplier
Consumer
Supplier
5.8.1
Establish connections
Consumer
Proxy
Supplier
Consumer
Admin
Event
Channel
for_consumers()
obtain_supplier()
connect_consumer()
Establish consumer connection
Working with objects:
Designing Distributed Systems for Reuse
Event
Channel
Supplier
Admin
Proxy
Consumer
Supplier
for_suppliers()
obtain_push_consumer()
connect_supplier()
Establish supplier connection
©Taskon 1997. Page 37
5.8.2
Supplier Changed
Consumer
Proxy
Supplier
Consumer
Admin
Event
Channel
Supplier
Admin
Proxy
Consumer
Supplier
push()
push()
push()
push()
push()
push()
5.9
Access Control Frameworks
Card reader
device
Small System
Management
Large System
Management
High Security
Management
Comm.
frameworks
Keyboard
device
Voice
Recognition
etc. ...
etc. ...
Access Control
Logic
with
Door Control
Compose specific product
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 38
5.10
Key LocalStation control method
void identification (String identString, TypeSymbol typeSymbol) {
/* This is a generic method that collects all identifications
in Dictionary, passing it on for validation when complete. */
Boolean accessOK;
identDict.add (typeSymbol, identString);
if ((identDict.size = this.noOfInputs()); == true) {
accessOK = validator.validate(identDict);
identDict = new IdentityDictionary(); // Clear
if (accessOK) this.openAndCloseDoor();
}
}
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 39
6.
Card/Key Access Control System
(CK)
Build
experience
Capture
experience
Application
Programming,
Isolated
Applications:
- analyze
- design
- implement
Production
Engineering:
Create
Pool of
Reusable Assets
Reuse
experience
Application
Programming,
Family of
Applications:
- analyze
- design
- implement
Role Modeling technology
6.1
Area of Concern
CK Requirements
An office complex has
a number of office areas
separated by automatic doors.
We shall design a System that controls access to the
protected Zones
¤ identified by card during working hours
¤ identified by card and key code at other times
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 40
6.2
User interfaces
CK Prototype Program
6.3
Synthesize application
CK Design
Card reader
device
Small System
Management
Large System
Management
High Security
Management
Comm.
frameworks
Keyboard
device
Voice
Recognition
etc. ...
etc. ...
Access Control
Logic
with
Door Control
Compose specific product
Specialize
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 41
6.3.1
Synthesized Card/Key model
CK
Keyboard
CK
Controller
CK
CardReader
CK
Validator
CK
Door
Delay
class
Delay
6.3.2
Determine distribution architecture
Iterate
Select possible communication architecture
¤ Evaluate communication requirements
¤ Choose communication method
- e.g., on demand
- e.g., caching
¤ Estimate communication costs (time, money)
Implement solution
¤ Subclass frameworks
¤ Specialize code
¤ Optimize code
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 42
6.3.3
Some possible distributions
CO
CardReader
CO
Door
CO
Controller
Delay
class
Delay
CO
Validator
check()
validate()
openDoor()
forSeconds()
wait()
closeDoor()
Extreme
centralization
Replicated
database
Decentralized
6.3.4
Example:
Replicated database
CORBA
Event Service
Event
Channel
Consumer
Admin
Supplier
Admin
Door subsystem
Proxy
Supplier
Proxy
Consumer
CO
CardReader
CO
Validator
w/DB cache
CO
Controller
Central
access
database
CO
Door
Delay
class
Working with objects:
Designing Distributed Systems for Reuse
Delay
Central management
subsystem
©Taskon 1997. Page 43
6.4
Controller, initialization and checking
class Manager {
/* Initialize structure. */
manager (Manager aManager) {
super.manager (aManager);
acr = new ACCardReader();
acr.openInterface("windowSpec", this);
akr = new ACKeyboardReader();
akr.openInterface("windowSpec", this);
inputDevices = new OrderedCollection (acr, akr);
}
void identification (IdentSpec identString, TypeSymbol typeSymbol) {
/* Collect identifications in Dictionary, validate when complete. */
Boolean accessOK;
identDict (typeSymbol, identString);
if (((Time.hours > 8) and (Time.hours <= 16)
and (typeSymbol == "CardReader"))
or (identDict size() == 2)) {
accessOK = manager.validate(identDict);
if (accessOK) {
this.openAndCloseDoor();
}
}
}
}
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 44
7.
Conclusion
¤
¤
¤
¤
¤
Role models describe object patterns
Modeling distribution
Separation of Concern
Reuse through model inheritance
Seamless bridge to implementation
7.1
Role models describe object patterns
Controller
modifyModel
edit
Model
User
update
getInformation
present
Working with objects:
Designing Distributed Systems for Reuse
View
©Taskon 1997. Page 45
7.2
Separation of Concern
Object pattern composition
VisualPart
role
Windowing
role model
View
role
MVC
role model
TextView
role
TextEditor
role model
class TextView instance
7.3
Modeling distribution
Client
Windowing
System
Server
Application
DataBase
(a) Two-tier, Fat Server
Windowing
System
Application
DataBase
(b) Two-tier, Fat Client
Windowing
System
TaskOriented
Tool
Domain
Logic
DataBase
(b) Four-tier, Tool and Service
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 46
7.4
Reuse through model inheritance
Card reader
device
Small System
Management
Large System
Management
High Security
Management
Comm.
frameworks
Keyboard
device
Voice
Recognition
etc. ...
etc. ...
Access Control
Logic
with
Door Control
Compose specific product
Specialize
7.5
Seamless bridge to implementation
Roles
--> Interfaces
--> Classes
Ports
--> Member variables & other references
--> Interfaces
Messages
--> Methods
Model inheritance
--> Class ensemble inheritance
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 47
7.6
More information
Management processes:
Goldberg and Rubin: "Succeeding with objects".
Addison-Wesley 1995. ISBN 0-201-62878-3
Modeling method:
T. Reenskaug, P. Wold, O.A. Lehne: "Working With Objects"
Manning/Prentice Hall 1996.
ISBN 0-13-452930-8
Patterns:
Gamma, Helm, Johnson, Vlissides: "Design Patterns".
Addison-Wesley 1994. ISBN 0-201-63361-2
Distribution:
ODP: Open Distributed Processing
ISO/IEC DIS 10746-2 Foundations. ISO/IEC DIS 10746-3 Architecture.
ISO 1995, 1996
OOram tools can be downloaded from:
http://www.sn.no/taskon/
Working with objects:
Designing Distributed Systems for Reuse
©Taskon 1997. Page 48
1. Working with objects
1.1
1.2
1.3
1.4
TABLE OF CONTENTS
Motto:
Three dimensions
of software development
Incidental and planned reuse
Reusable component lifecycle
1
2
2
3
2. Role Modeling
Focus On Object Collaboration
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
4
Four aspects of OO modeling
2.1.1 Simple examples
Main features of role modeling
2.2.1 Model inheritance: Specialization
2.2.2 Separation of concern:
Three uses of synthesis
2.2.3 Composition on
same level of abstraction
2.2.4 Aggregation
2.2.5 Important observations:
Role Model Advantages
Role models describe object patterns
2.4.1 Role Model Collaboration view notation
2.4.2 Compare with class hierarchy
(VisualWorks class library)
2.4.3 Environment Collaboration view
2.4.4 Scenario view
2.4.5 Role modeling
focuses on object patterns
Modeling distribution
2.5.1 Determine distribution architecture
Separation of Concern
A TextView object plays many roles
Reuse through model inheritance
Seamless bridge to implementation
2.8.1 Method views
Inside object perspective
2.8.2 Mapping concepts
from OOram to implementation
2.8.3 Program code
Class perspective
2.8.4 Semantic model - Object System
3. The first isolated application
Card access control system (CAC)
3.1
3.2
3.3
3.4
1
4
5
5
6
6
7
7
8
8
9
9
10
10
11
11
12
12
13
13
14
14
15
15
16
17
An Access Control problem
Area of concern
User interfaces
Prototype Program
Process Steps
3.3.1 System seen from environment
Environment collaboration view
3.3.2 System seen from environment
Stimulus-Response view
3.3.3 System Architecture
A Choice
3.3.4 Separation of Concern
3.3.5 Consider Separation of concern
3.3.6 Revised plan for system development
Validation subsystem (VAL)
17
18
18
19
19
20
20
21
21
22
Working with objects: Designing Distributed Systems for Reuse
<i>
3.4.1
3.4.2
3.4.3
3.4.4
3.5
3.6
3.7
Validation Environment
VAL Normal access scenario
VAL Open door alarm scenario
Validation sub-system
Controller details
3.4.5 Validation
Normal access scenario
Controller details
3.4.6 Inside object perspective
Controller state diagram
3.4.7 Inside object perspective
A Controller Method
Management subsystem (MS)
3.5.1 Area of Concern
MS Design Model
3.5.2 Describe object structure
MS Design Model
Card access control system (CA)
3.6.1 Synthesize from subsystems
CA Design model
3.6.2 The Validator type satisfies
COValidator and ManagementSubsystem
Roles
Summary
First isolated application
4. The second isolated application
Keyboard only access control (KO)
4.1
4.2
4.3
4.4
4.5
Area of concern
Keyboard only access control (KO)
Incidental reuse
Stimulus-Response view
Keyboard only access control (KO)
Collaboration View
Keyboard only access control (KO)
Normal Access Scenario View
Keyboard only access control (KO)
5. Creating reusable components
5.1
5.2
Large systems from small projects
The Taskon Fountain Model
for Planned Reuse
5.3 Some reuse terminology - 1
5.4 Some reuse terminology - 2
5.5 Creating an OOram framework
5.6 Identify reusable activities:
CO Scenario view
5.7 Isolate reusable parts
Inverse synthesis
5.8 Object Management Group (OMG):
Event Service (simplified)
5.8.1 Establish connections
5.8.2 Supplier Changed
5.9 Access Control Frameworks
5.10 Key LocalStation control method
6. Card/Key Access Control System
(CK)
6.1
6.2
Area of Concern
CK Requirements
User interfaces
CK Prototype Program
22
23
23
24
24
25
25
26
26
27
27
28
28
29
30
30
31
31
32
32
33
33
34
34
35
35
36
36
37
37
38
38
39
40
40
41
Working with objects: Designing Distributed Systems for Reuse <ii>
6.3
6.4
Synthesize application
CK Design
6.3.1 Synthesized Card/Key model
6.3.2 Determine distribution architecture
6.3.3 Some possible distributions
6.3.4 Example:
Replicated database
Controller, initialization and checking
7. Conclusion
7.1
7.2
7.3
7.4
7.5
7.6
Role models describe object patterns
Separation of Concern
Object pattern composition
Modeling distribution
Reuse through model inheritance
Seamless bridge to implementation
More information
41
42
42
43
43
44
45
45
46
46
47
47
48
Working with objects: Designing Distributed Systems for Reuse <iii>
Download