Working With Objects
Working With Objects
Trygve Reenskaug
with P. Wold and O.A. Lehne
"Working with objects" is now out of print. There is still some interest,
and we therefore make this version available on the web.
This is a .pdf version of the last draft before publication. It has not had the
benfit of the copy editor's corrections and improvements, but the substance
correspond closely to the printed book.
We hope to improve the presentation by and by, but publish it as its is
anyway.
-- C. A. R. Hoare
Chapter 1
Preface
Goals
Real software for The main theme of this book is to describe complex phenomena as
real users structures of interacting objects. Object technology is applicable to a
wide range of phenomena on many different levels. Examples are
work procedures on the enterprise level; large-scale applications on
the systems level; and small, technical details on the program design
level.
Motivation
A number of important books on object-oriented analysis and design
have been published in recent years. The most influential are
probably [Cox 87], [Wirfs-Brock 90], [Booch 94], [Rumbaugh 91], and
[Jacobson 92]. All these methodologies are based on the object as
the common building block and on the class as a common
abstraction on the objects.
be merged into a single one, and that the concepts and notation of
the composite methodology could be standardized. We feel that such
standardization will be premature. Objects and classes represent two
different levels of abstraction; each is suited to the expression of
certain properties. Static properties and relations are best expressed
in terms of classes. Examples are attributes and relations; most
notably for expressing the inheritance relation. Dynamic properties
are best expressed in terms of objects. Examples are message
interactions (scenarios), use cases, and data flows.
Audience
Familiarity with We assume that you are familiar with how computers and computer
computers assumed programming influence modern information processing, but do not
assume familiarity with a particular programming language or
operating system. Most of the book is written for the manager and
person of business who is searching for new and better ways to
produce software, for the consultant who wants to use objects to
design new business organizations, and for the system creator who
wants to understand how to exploit the full power of object
orientation. A few chapters are clearly marked as being directed to
the expert computer programmer.
Gradual transition to The software industry is still in its infancy, and it will take many years
full industrialization to establish an effective industrial infrastructure. We therefore
required recommend a gradual transition from the miserable present to the
glorious future. The winners will be the companies with a clear vision,
an effective strategy, and the stamina needed to transform their
operations from the general job shop to the industrial enterprise.
Establishing a software fa
(Chapters 10, 11, and 12)
Organizing for software produc
(Chapter 10)
Creating reusable components
(Chapter 5)
Combining role models through synthe
(Chapter 3)
Role model analysis and design
(Chapter) 2
Figure 1.1 Stages in
the application of the Object-oriented implementation
OOram method
Taskon invites It is our hope that this book will cause the wide spread adoption of
cooperation the OOram method. Taskon markets OOram processes, tools and
consultancy services for a number of application areas. We invite
consultants to build special methodologies based on our products;
we invite other vendors to create competing products; we invite
potential competitors to cooperate with us to ensure interoperability
between the products to the benefit of all.
Background
The book is based on continuous experience with objects since 1975
and practical experience in the borderland between software
engineering research and the production of software for computer
aided design, production control, management information systems,
and telecommunications since 1960. In all our work, the goal has
been to create industrial strength software for real users. The
software engineering methodologies and tools have been created in
response to our own needs and to the needs of our partners, and the
success criterion has been that they enabled us to support our clients
more effectively.
Object orientation is Our experience has clearly shown that object orientation is a
a powerful paradigm powerful paradigm which is applicable to a wide range of problem
areas. We have used it to design improved organizations in oil
companies; to describe basic, reusable services in a distributed
environment; to design client-server systems; and to specify and
implement business information systems.
Large systems, small Our most exciting experiences are with systematic reuse and an
projects industrial approach to software production. This enables us to
produce large systems in small projects, which we believe is the key
to the effective production of quality software.
Acknowledgments
The senior author has written most of the words you find in this book,
and when the pronoun "I" is used, it refers to the senior author. Per
Wold has been an essential partner, posing important questions and
by suggesting appropriate answers throughout the creation process.
Odd Arild Lehne has brought his extensive teaching and consulting
experience to bear on the book's structure, examples, and case
studies.
Jørn Andersen, Lasse Bjerde, Jon Ola Hove, Eirik Næss-Ulset, and
Carl Petter Swensson have been members of the Taskon book
committee. The patience and perseverance they have shown by
reading and rereading a steady stream of drafts and their help in
shaping the form and contents of the various chapters of the book
cannot be overestimated.
I had the good fortune to spend a year as visiting scientist with Alan
Kay, Adele Goldberg and the Smalltalk group at the Xerox Palo Alto
Research Center (PARC) in 1978/79. This was a wonderful
experience which completely changed my life, and it is impossible to
fully express my gratitude for the help and inspiration I received. I
particularly want to thank Adele for the support and interesting
discussions that lead to the creation of the first version of the Model-
View-Controller; this was probably the world's first reusable, object-
oriented framework. After this visit, we got a license to port Smalltalk-
78 to local equipment in Norway. This port was excellently performed
by Bruce Horn, who was then a student at PARC. My colleagues and
I are eternally grateful to Bruce and Xerox for giving us early
experience with the world's most exciting programming environment.
We are also very grateful to Bruce for permitting us to publish his
work on user interface design which you will find in chapter 7.3.2.
oriented analysis and design, and for providing important insights into
the world of distributed computing. We are also grateful to Espen
Frimann Koren, Magnus Rygh, and John Lakos for their preparation
and discussion of the programming examples in C++. Stein Krogdahl
has helped create the the OOram language presented in Appendix A,
but does not want to be responsible for this first version of the
language.
Chapter 2
The main ideas
This chapter gives an overview of object orientation as it is exploited
by the OOram method and of our general ideas about organizing
software production in value chains.
In a nutshell
In the software engineering community, a methodology usually
denotes an approach to accomplish a task. We find it convenient to
study methodologies in three dimensions: a technology dimension
describing the concepts, notation, and tools; a process dimension
describing the steps to be performed (mainly in parallel) together with
the deliverables from each step; and an organization dimension
describing the organization for effective software development.
The software crisis The "software crisis" was first officially recognized at the NATO
Conference on Software Engineering in Garmisch, Germany in 1968.
The conference identified the problem and started a discussion about
its solution. Much has been achieved in the intervening period, but
requirements have grown at least as fast as our ability to satisfy
them. Today, more than twenty-five years and many "solutions" after
the Garmisch conference, we still have a software crisis and we are
still searching for better solutions.
Object-oriented The latest solution to catch the fancy of system developers is the
methods are the technology based on the object paradigm. The first object-oriented
latest "solution" programming language, Simula, was developed in Norway in the
sixities. The field got a tremendous boost when the Smalltalk
language and development system became available in the early
eighties. The introduction of the C++ programming language made
object orientation generally acceptable to the systems programming
community. (FOOTNOTE: See [Birth 73], [Gold 83]), and [Strou 86])
Object technology has moved from the exotic to the feasible. It is now
rapidly moving from the feasible into the mainstream of systems
development.
A powerful paradigm The reason for the popularity of objects is easy to see. We have
merging many earlier earlier been using a number of different modeling paradigms to
concepts describe different aspects of our systems. The data-centered
approaches, e.g., Entity-Relation modeling, were excellent for
modeling the static properties of information; but they were weak for
modeling functionality. The behavior-centered approaches, e.g.,
functional decomposition or finite state machines, were great for
modeling the dynamics of the system; but they were weak on the
modeling of data.
The OOram method Within the software community, a methodology is taken to mean an
is a frame of approach to accomplishing a task. (See box.) We do not believe that
reference we will ever find an ideal methodology that will serve all purposes
equally well. On the contrary, we believe that a methodology not only
has to be optimized for its goals; it should also be tailored to suit the
culture, competence and preferences of its people. It is therefore not
possible to create an overall methodology which covers all needs.
But we do give guidelines, examples, and case studies that may be
helpful when you create your own solutions to your problems in
software creation; in model and software reuse; or in setting up an
organization for the large-scale provision of customized software.
Implement-
Real World Objects Roles ation
Reuse Technology
Technology
(Concepts-Notation-Tools)
The OOram method A wide range of methodologies for a wide range of problems can be
widely applicable based on the OOram method. In the later chapters of this book, we
will describe how OOram supports different methodologies covering
the technical, organizational, and process dimensions. Our main
concern will be the technical dimension because it is common to all
methodologies and a prerequisite to our proposed solutions for
different processes and organizations.
The OOram method The OOram method traces its history to the early seventies. One of
based on 20 years of its first applications was an object-oriented shipyard production
experience. control system [Ree 77]. The Smalltalk Model-View-Controller
paradigm is another application of the OOram ideas; the senior
author developed the first version in association with Adele Goldberg
at Xerox Palo Alto Research Center (PARC) in 1979/80.
Driving force is the The driving force behind the development of the OOram method has
need for professional been our own need for professional software engineering
software methodologies. Concepts, notations, and tools have been developed
engineering. concurrently, because modeling concepts and notation are maximally
effective when they can be supported by current workstation
technology. The success criteria are:
OOram is practical, These success criteria are strongly utilitarian, leverage provided by
sound and useful tools is as important as the theoretical soundness of the technology.
with or without tools In particular:
3. Methods and tools must scale. Practical programs are often several
orders of magnitude larger and more complex than typical textbook
examples. Scaleability and practicability are critical to the success of
software engineering methods and tools. The OOram method and tools
have been created to help real people solve real problems. The goal of
this book is to share our experiences with you in the hope that they will
help you solve your problems in your environment.
In a nutshell
This dimension covers the concepts that form the basis of the work;
the notation used for documentation; and the tools. Figure 1.1
illustrates the main ideas: We select a bounded part of the real world
as a phenomenon to be the subject of our study. We choose to
model the phenomenon as a structure of objects in an object model;
where we distinguish between system objects and environment
objects. Patterns of objects in the object model are abstracted into
role models. A role model describes how a structure of objects
achieves a given area of concern by playing appropriate roles.
Finally, classes are defined in the implementation so that their
instances play a specified set of roles.
Our first object Object technology is pervasive, it can be used for almost anything.
application: An We first applied it to modeling ship design processes on the
enterprise model for enterprise level, (FOOTNOTE: [Ree 73].) when we introduced
ship design coordinated computer support for the different stages in the design
process. Controlling computer-based information transfer between
project stages and company divisions proved to be a serious
problem, and we used objects to model the flow of information and
the dependencies between divisions.
Our second object We next applied objects to shipyard scheduling and control.
application: Shipyard (FOOTNOTE: [Ree 77]) The yard was a heavy user of an activity
scheduling planning system, but it also needed a number of specialized systems
for scheduling dockside jobs, for scheduling the use of the big crane,
and for scheduling a panel assembly line. Our idea was to replace all
of their disparate systems with a single, object-oriented scheduling
and control system. We represented the ship as an object, its parts
as objects, the construction jobs were represented as objects. We
also represented the yard, its production facilities such as dockside
facilities, the big crane and the panel assembly line as objects. The
objects are illustrated in figure 1.2.
OOram technology The concepts and notation of the OOram technology is common to
common to all all OOram methodologies. A specific methodology will use a selected
OOram subset, and any selection will be consistent and workable. We will
methodologies here give a brief taste of its main features. You will find the complete
description of the OOram technology in the main body of the book.
The description is like a large salad bar; it is up to you to select the
dishes you want and to ignore those that you do not like or need.
Object representing
the shipyard
shipyard scheduling
and control operation
The total system consists of a very large number of objects, and the
object interaction processes needed to create and maintain a
schedule will be very complex. We clearly need some form of
abstraction so that we can focus on one portion of the total problem
at the time.
Job-A Job-F
5 (3) 8 20 (4) 24
Job-C Job-E
8 (5) 13 13 (7) 20
Completion time
Figure 2.3 An activity
Duration
network
Start time
A job can start when The frontloading algorithm states that all jobs are characterized by
all predecessors are their duration, their predecessor jobs and their successor jobs. A job
completed can start as soon as all its predecessors are completed; and no
successor can start before this job is completed.
The start job, Job-A, can start in week 5; it takes 3 weeks and is
completed in week 8. Job-B can start when Job-A is completed; it
takes 4 weeks and completes in week 12. Job-D can start when both
Job-B and Job-C are completed; its starts in week 13, takes 3 weeks,
and completes in week 16. The project is completed when the end
job, Job-F, completes in week 24.
Job-B Job-D
8 (4) 12 13 (3) 16
Job-A
5 (3) 8
Successor
Predecessor Job
early_start
early_completion duration
early_completion
Figure 2.4 Identifying
an object pattern
CompletionTime messages
Object patterns The class abstraction does not help us understand the essence of
abstracted into role the network in figure 1.3 All Jobs could in fact be instances of the
models same class. It is better to identify a pattern of objects which together
capture an interesting phenomenon. In figure 1.4, we have focused
on Job-E and isolated the object pattern consisting of Job-E, its
predecessors (just one, Job-C in this case), and its successors (Job-
F).
CompletionTime
CompletionTime
Figure 2.6 Message
scenario illustrating
frontloading activity
If we open the Job role, we can study what takes place when it
receives CompletionTime messages. This is illustrated in the method
view of figure 1.7 We see that the method is triggered when the Job
role receives the CompletionTime message. The method computes
its own early_completion when all predecessors are ready, and the
method finally reports the Job's completion time to its Successors.
/Job /Successor
CompletionTime
<Determine
early_completion>
Divide and conquer Divide and conquer is an important concept in all modeling practices.
In the previous section, we created a role model for an interesting
phenomenon, namely network frontloading.
The frontloading algorithm is just one of the many concerns that are
relevant to shipyard scheduling and control. Another area of concern
is the allocation of resources to the different jobs. A possible role
model is shown in figure 1.8. The corresponding scenario is shown in
figure 1.9; where the Job asks the Resource to allocate it, and the
Resource answers the reserved time period.
Job
planned_start
default_duration
planned_completion
reso
job
Resource
Job Resource
BOX: Synthesis
The antonym of analysis is synthesis, and we use the term role
model synthesis to denote the construction of a derived model from
one or more base models in a controlled manner:
Job Resource
Role Role Resource allocation
Role Model
Job Successor
Predecessor Role Role
Role Network frontloading
Figure 2.10 Synthesis Role Model
specifies that objects
play several roles in a Job-C Job-E Job-F a Resource
coordinated manner
reso
Resource
job allocation
model
Resource
Job
job
Resource
Figure 2.11 Derived
scheduling model
synthesized from two
base models
Methods synthesize The dependencies between synthesized role models are expressed
behavior in the methods of the objects. The behavior of an object when
receiving a message in the context of a role in one role model may
be modified because it is also playing some other role. In figure 1.12,
the method for computing early completion time has been modified
from just adding the duration to asking the resource for allocation.
CompletionTime
Safe synthesis In the ideal case, the correct functioning of a base model will
automatically be retained in a derived model after synthesis. Such
safe synthesis is very valuable, since it permits the reuse of a
correct role model with a minimum of hassle. Indeed, if we think of a
role model that is solely created by the safe synthesis from a number
of correct base models, we would create it only if we needed it for
explanation purposes.
Unsafe synthesis In unsafe synthesis, the derived model has to be analyzed in total
before we can assume it to be correct. You might believe that unsafe
synthesis is something to be avoided like the plague, but we find it
useful when we analyze some limited phenomenon in order to
understand it and communicate our findings. (Even if synthesizing
the resource model into a wider context were unsafe, doing so could
still help us create a derived model to understand the phenomenon.
But we would have to recheck the complete derived model). In
general, we permit unsafe synthesis when we analyze a relatively
limited area of concern. Safe synthesis is required when we want to
create models that can be reused in a general context.
In a nutshell
This section has been written for computer programmers who are
familiar with an object-oriented programming language.
Nonprogrammers may safely skip it.
The essence of an In all our work with objects over the past 20 years, we have found
object system is not that a programming language is ideally suited to express a detailed
easily seen from the definition of the system under consideration. We have likewise found
code that a programming language is useless for expressing an overview
of the system; for describing the structure of objects and their
interaction. So there is nothing resembling code in the production
control system of [Ree 77], only attempts at expressing the static and
dynamic interdependencies between objects.
A single class The objects of figure 1.3 play one or two roles: job A plays the
implements all three Predecessor role; role F plays the Successor role; and all the other
roles objects play all three roles.
Object specification Since objects are meaningless when seen in isolation, we prefer to
models describe object types in the context of their collaborators. An object
specification model is the role model of a structure of objects that
we have implemented or intend to implement. A role in an object
specification model is called an object type, which is a specification
of a set of objects with identical externally observable properties. An
implementation of an object type is called a class in conformance
with common object-oriented programming terminology.
Basic OOram Different classes can implement the same type. The inheritance
concepts relationships between these classes are implementation issues and
immaterial in the context of types. It may be appropriate to implement
two classes in different branches of the class inheritance hierarchy
for the same type. In many cases, we find it convenient to create
derived classes for code sharing purposes even if the corresponding
objects have dissimilar types. Objects of the same type can, and
often do, play several roles. For example, an object can be member
of a list and also the currently selected object. Therefore, many-to-
many relationships exist between objects, roles, types and classes;
this is illustrated in figure 1.13:
specifies
instantiates
Single and multiple All object-oriented programming languages support some form of
inheritance inheritance. (Languages missing this feature are usually called
object based languages.) Some commonly used languages such as
Smalltalk only permit single inheritance; i.e., a class may only have
a single superclass. Other popular languages such as C++ support
multiple inheritance; i.e., a class may be derived from several base
classes.
Class inheritance Figure 1.14 illustrates how some of the models in the role model
structure may be synthesis structure are promoted to object specifications and
mapped on the role implemented as a corresponding set of coordinated classes. Object
model synthesis Specification 2 inherits from Object Specification 1, this indicates that
structure Class Set 2 may profitably be derived from Class Set 1.
Implemented by
Object Specification 1 Class Set 1
Role Model 2
Role Model 1
OOram reuse The OOram method exploits object technology to support the
controlled reuse of proven components. This facilitates the creation
of information environments tailored to the needs of the particular
actors, reduces production costs and lead time, increases system
reliability, and protects critical resources with mandatory access
through proven components.
Reusable The single most highly promoted advantage of the object paradigm is
components imply its support for reuse, but this is also the area of the deepest
repeat business disappointments.
Successful reuse Both the creation and the application of reusable components
involves all three depend upon appropriate solutions along all three dimensions of
dimensions figure 1.1 for their success.
A pattern tells the In the early seventies, the architect Alexander (FOOTNOTE:
reader how to solve [Alexander 79]) proposed patterns as an interesting way for
a problem communicating important ideas among professionals. An enthusiastic
group of computer professionals have adapted these ideas to our
field, and a book on Design Patterns has been published
(FOOTNOTE: [GaHeJoVli 95]).
A framework is a Some professionals are using the term pattern in a different meaning;
canned solution they take it to mean an archetypical structure of collaborating objects,
very similar to what Booch has called a mechanism and what we
have formalized into the role model abstraction. We use the term
pattern in the original sense to denote a guide to the solution of a
problem; and we use the term object pattern to denote an
archetypical structure of objects. We give object pattern a precise
meaning by defining it as an instance of a role model.
A graph pattern Most of the details are not specific to the activity network; they are
tells us how to common to a broad group of structures called Directed, Acyclic
design a network Graphs (DAGs). An appropriate pattern would give us access to
accumulated experience with these structures: it would identify the
objects, give all important algorithms, and provide practical hints as
to the best solutions under different circumstances.
The component user Consider that we should meet the activity planning problem for the
is fortunate first time. We study the problem and try to identify key processes and
key actors. We study examples such as figure 1.3 to better
understand the phenomenon. We tentatively create a role model
such as the model shown in the views of figure 1.5 through 1.7. But
how do we know that we have chosen appropriate roles? How do we
know that we haven't overlooked some essential part of the problem?
The answer is that we can hope for the best and suspect the worst,
but we just cannot know. We must expect to revise our ideas several
times as we study the problem and analyze its possible solutions.
Owner
nod
owne
Figure 2.15
Collaboration view of a Pred node pred Node succ node Succ
reusable Directed
Acyclic Graph
DAG
(Directed Acyclic Graph)
Owner
model
nod
owne
Frontloading model
Schedule
nod
owne
Costs accumulate in the first four phases. The cost of the resulting
assets is written off against the value created in the fifth and final
phase.
The OMT models The Object Modeling Technique, OMT, was developed by James
can be expressed as Rumbaugh and others at General Electric Research and
OOram views Development Center (FOOTNOTE: [Rumbaugh 91]). OMT supports
three basic models: The object model, the dynamic model, and the
functional model.
The OMT object model describes the object types and their
relationships. It is an extended Entity-Relationship model with
classes that can contain both attributes and operations. It is possible
to describe object instances with instantiation relationship to classes.
Associations between classes can be of different cardinalities and
can have attributes.
The Booch models The Booch method has its basis in object-oriented design from the
can be expressed as Ada world. However, the second edition of the book (FOOTNOTE:
OOram views [Booch 94]) is adapted to C++. The Booch method is the most
comprehensive method with respect to the modeling of language-
oriented design features such as parameterisized classes and public,
protected, and private access.
As was the case for OMT, the Booch state diagram is based on the
Harel statecharts. The OOram finite state diagrams cover roughly the
same information, with the caveat that the OOram state diagram is
strictly object oriented with all events being mapped as message
interactions and all actions as (partial) method invocations.
The OOSE models The OOSE methodology has its origin in work with
can be expressed as telecommunication applications and SDL. The initial ideas for object-
OOram views oriented adaption of the methodology was presented by Ivar
Jacobson in 1986 and -87. The OOSE methodology (FOOTNOTE:
[Jacobson 92]) is a scaled down version of the full methodology
which is called ObjectOry.
The RDD models Responsibility Driven Design, RDD, is one of the few published
can be expressed as methodologies with a pure object-oriented origin (FOOTNOTE [Wirfs-
OOram views Brock 90]). It is based on experiences from object-oriented
programming in Smalltalk done at Tektronix Labs, Software
Productivity Technologies, in the period from 1983 to 1989 -- while
Tektronix was the only vendor of specialized Smalltalk-based
workstations.
Like RDD, the OOram method has a pure object-oriented origin. All
concepts described in the RDD method are fully supported in the
OOram method. The difference is that the roles take the place of the
classes, and that roles are always considered in the context of their
collaborators in the role model.
OOram models can The powerful relational model is well known in the database
replace E-R models, community. In this model, data are represented as records in tables.
but we need good (Or more precisely: data are represented as tuples in relations.)
reasons to do so Relational data models are often designed in terms of entity-
relationship (E-R) diagrams (FOOTNOTE: [Chen 76], [Elmasri 94]).
Most of the information shown in an E-R diagram can be shown in an
OOram collaboration view.
We once did a small study to identify the benefits of the OOram role
model over the traditional E-R model. We had access to the data
Our conclusion from this small and informal study was that an
OOram role model can indeed take the place of an Entity-
Relationship model, but that we should only do so if we need the
added behavioral power of objects.
Object identity One of the important characteristics of objects is that an object has
essential for identity. An object retains its identity throughout its lifetime and
describing dynamic regardless of changes to its data contents. Furthermore, there has
behavior never been and will never be another object with the same identity.
The OOram role The OOram role modeling concepts bring all the different modeling
modeling concepts concepts together into a coherent whole. The role model is a precise
bring it all together description of an object pattern where its objects are abstracted into
the roles they play in the context of the pattern. Roles are
archetypical objects, so the role model can combine data-centered
and function-centered descriptions.
Roles have class-like Like a class, a role is a description of a set of objects. But there is a
properties crucial difference: The class describes the set of objects that exhibit
common characteristics. The role describes the set of objects which
occupy the same position in a pattern of objects. We can describe
the semantics of the roles and their relation in the context of the role
model; we can describe the attributes that must be exhibited by all
objects playing the roles; we can describe how the total responsibility
is allocated to objects playing the different roles; and we can describe
the sets of messages a role may send to another role.
Roles have object Like objects, roles have identity so that we can reason about their
properties cooperative behavior. We use scenarios to describe typical
sequences of message flows. Process diagrams show how data
flows between roles. Finite state diagrams show how each role
changes its state in response to messages received from other roles.
OOram inheritance There is no point in using inheritance to derive a class with added
tells the complete functionality if we do not at the same time derive another class which
story because it uses this added functionality. Role model inheritance not only
applies to complete exhibits the inheritance relationships between individual classes; they
models explain how the whole story told by a role model is retold by the roles
of the derived model. So the OOram inheritance is done in the
context of role models: a role model can inherit another role model
and thus build on its functionality.
OOram technology There are important practical consequences of the role model
facilitates systematic coherence. A complex reality can be represented as a complex
reuse object structure and described as a number of much simpler role
models. General phenomena can be described as general role
models, these role models can be reused as building blocks for the
creation of application system models. If the general role models are
implemented as sets of coordinated classes, these frameworks can
be reused in a safe and controlled manner in the design and
implementation of application programs.
OOram technology The technology for systematic reuse provided by OOram role
facilitates more modeling makes it possible to organize application system
effective development in novel ways. Extensive and systematic reuse lets us
organization create large applications in small projects. A prerequisite is that
suitable reusable components are available: systematic reuse
requires investment in reusable assets.
In a nutshell
A work process describes the steps that need to be performed in
order to reach a given goal. The steps are usually described as if
they were performed sequentially, while in reality they are performed
in an opportunistic sequence and often in parallel. Documentation
and other deliverables are the concrete results of the work process. It
is often useful to pretend that the deliverables are the results of a
rational work process because this makes them easier to read and
understand.
The processes are The work processes on all three levels are iterative and the
opportunistic and deliverables evolutionary. The goal is to minimize the risk by focusing
iterative the most critical parts in the early iterations.
Many managers dream of the ultimate work process that will ensure
satisfactory solutions from every project. We believe that this dream
is not only futile; it can even be harmful.
The documentation Documentation is by its nature linear and must be strictly structured.
is sequential Software development processes are by their nature creative and
exploratory, and cannot be forced into the straightjacket of a fixed
sequence of steps. In an insightful article, [Parnas 86] states that
many have sought a software process that allows a program to be
derived systematically from a precise statement of requirements.
Their paper proposes that although we will not succeed in designing
a real product that way, we can produce documentation that makes it
appear as if the software was designed by such a process.
Eight steps for How should you go about describing a phenomenon in a role model?
developing a role In the general case, we suggest the following eight steps for creating
model a role model. Each step results in a deliverable, which is a view on
the role model. The relative importance of these views depend on the
purpose of the model.
The steps are performed iteratively until the role model is adequately
defined. Steps (4) and (5) are performed in parallel. It is often easier
to see what needs to be done than to identify the actors, but both need
to be specified in an object-oriented model.
(1) Determine the Area of Concern
(2) Understand the problem and identify the nature of the objects
(3) Determine Environment roles and Stimulus/Response
(4) Identify and understand the roles
(5) Determine the message sequences
(6) Determine the collaboration structure
(7) Determine Interfaces
(8) Determine the role behavior
With the OOram method, you can describe your analysis and design
in a single role model or in a number of related models. There are
general process guidelines for creating the individual models, and for
breaking complex situations into smaller models that "are so simple
that there are obviously no deficiencies".
System
user
model
System
requirements
model
System
design
model
System
implementation
System
of objects
Figure 2.17 Typical
descriptions on
different levels of
abstraction
The process is It is not our intention that figure 1.17 shall suggest a classical
opportunistic and waterfall process. The figure shows the main models and the
iterative relationships between them. The process will be opportunistic,
incremental, and [Link] four system descriptions represent four
different levels of abstraction. The documentation deliverable will
often be organized top-down. The actual process will proceed from
top to bottom; from bottom to top; and from the middle outwards. We
call it the yo-yo approach to system development.
Everything changes! It is popular to claim that in our modern society, change is the only
constant factor. Enterprises have to be able to adapt to an ever
changing environment.
It is misleading in the sense that everything just cannot change all the
time. So the challenge to the evolving enterprise is to identify what
can be kept stable and what has to be kept fluid. The stable parts
form an infrastructure on which it can build a light and rapidly
changing superstructure.
END USER
Fountain
of
production
Collection
Forward engineering of
Producing revenue Experience
Reverse engineering
Investing in
reusable assets
2.4 Organization
In a nutshell
Reuse is currently applied almost exclusively to software. This
section is of general interest, however, because several of the
OOram reuse opportunities are applicable to all kinds of object-
oriented models. Reuse is currently almost exclusively applied to
software, but we have also applied reuse technology to the design of
organizations with great success.
We must change The premise of this book is that we will never be able to produce high
from a job shop to an quality software efficiently in the general software job shop, just as a
industrial approach blacksmith will never be able to produce a high quality car in his
to software smithy. We expect an effective car factory to turn out cars and cars
production only. We should also expect an effective software production facility
to turn out a particular family of software only.
The value chain In a mature software industry, many different human actors will work
together to provide end users with sophisticated functionality. We
introduce the idea of a multilayered value chain, where the people in
each layer build on the results from the layers below it and deliver
results to the layer above them. The actors on each level have their
own unique responsibilities, spheres of competence and success
criteria.
It is important to cast the value chain so that the actors on each level
can focus on their main business and not be burdened with details
that have been solved on the layer below them.
An industrial The tasks needed to produce software depend on the nature of that
software production software, and we expect that different classes of products will need
facility must be different organizations for their effective production. We will explore
designed to suit the different product categories in order to understand their similarities
nature of its products and differences such as a facility for the production of Intelligent
Network services for the communications industry and a facility for
the production of customized information environments for
professionals in commerce and industry. In each case, we will see
that we need a reference model which describes the product in
general terms and which shows how we have chosen to divide the
total work into manageable pieces so that each piece can be created
by a team with clearly identified skills and interests.
Chapter 3
Role Modeling
This chapter discusses the creation of object-oriented models of a
wide range of phenomena. The process is called role model analysis,
the breaking down of a whole into a system of interacting
components.
System
user
model
System
design
model
System
Figure 3.1 Typical implementation
descriptions on
different levels of
abstraction
In a nutshell:
We create a myriad of mental models to help us understand
phenomena of interest and master them. A model is an artifact
created for a purpose; it cannot be right or wrong, only more or less
useful for its purpose. The choice of phenomena and the questions
we ask about them depend on our interests, the modeling paradigms
we are comfortable with, and the tools we use for expressing our
thoughts. If we want to precisely communicate our ideas to a
colleague, our modeling paradigm and notation must be similar to our
colleague's paradigm and notation. If we want to communicate with a
computer, our modeling paradigm must be consistent with the
applicable computer language. The more expert we are in a
particular modeling paradigm, the harder it may be to ask questions
and appreciate answers that fall outside that paradigm.
Our mind's It seems to be a deep rooted characteristic of the human mind that
interpreter makes we continuously try to organize and explain our impressions of the
sense of our world around us. The brain scientist Michael S. Gazzaniga
environment (FOOTNOTE: [Gazz 88]) says that there seems to be an interpreter
in the brain which tries to make sense out of all our varied
experiences. Dreams may, for example, be explained by the mental
interpreter trying to attach meaning to random events. We say that
our mind creates a mental model of the world around us which we
use to explain how it works and to predict the future; a model we use
to master our surroundings.
Mental mod
Real-World
Phenomenon
Figure 2.2 illustrates that our understanding of the real world is based
upon mental models which we create and manipulate within our
minds, and which we try to make similar to the real world in some
sense.
Our shared business While most of our mental models are intuitive and largely
models needs be subconscious, the essence of both science and business is the
explicit and based on creation of explicit models, called manifest models, which we can
shared concepts and share and discuss, see figure 2.3.
representations
Mental model
Manifest
Real-World Model
Phenomenon
Human Manifest models are really just data: patterns of ink on paper or bits
communication is inside computers. The interpretation is in the mind of the beholder,
distorted different people may (and will) interpret the same manifest model in
different ways as illustrated in figure 2.4.
Language-A Language-B
Data
Meaning-A Meaning-B
Language-A Language-B
Computer system
filters,
Meaning-A transforms, Meaning-B
stores,
and moves
data
Shared models The paradigms, concepts and notation for a manifest model must be
essential for shared by the participants to make communication and discussion
communication possible. The paradigms are usually implicit in a community of
experts, which make communication fast and efficient. The
paradigms are often subconscious. Conflicting models are rarely
detected and can lead to endless discussions -- such as, is analysis
everything preceding design, or is it the study of the current
situation? Every competent systems analyst knows an answer, but
different analysts give different answers depending on their
orientation.
BOX
In our context of system modeling, precise communication of model
information presupposes that all the communicants have a common
description language. The OOram method has precisely defined
concepts and notation. We suggest that you endeavor to learn and
use them as consistently as possible, and that you complain bitterly
to the authors if you find any inconsistencies or other imperfections.
In a nutshell:
The object has three properties which makes it a simple, yet powerful
model building block. It has state, so that it can model memory. It has
behavior, so that it can model dynamic processes. And it is
encapsulated, so that and object can hide complexity.
Object Orientation is Object orientation is but one of the many possible paradigms that can
a powerful paradigm be used as a basis for thinking about systems. It is currently receiving
a great deal of attention, because it seems to be useful in many
different situations and for many different purposes. It has been used
successfully to model human systems, such as business
organizations; technical systems, such as aircraft control systems;
and many different kinds of computer-based systems.
One of the reasons for the popularity of object orientation may be that
it merges many earlier paradigms such as the information models
used by database designers, the behavior models dear to the hearts
of communications engineers, the functional decomposition models
used by many computer programmers, and the process models used
in the analysis of organizations and integrated computer systems.
We will later see that with object orientation, it is possible to express
the information contained in all these different models within a single,
seamless description. (But object orientation does not replace
continuous models such as differential equations).
System and object A system is a part of the real world which we choose to regard as a
whole, separated from the rest of the world during some period of
consideration; a whole that we choose to consider as containing a
collection of objects, each object characterized by a selected set of
associated attributes and by actions which may involve itself and
other objects.
Open systems have Open systems are systems that interact with their environment: For a
environment given system, the environment is the set of all objects outside the
system whose actions affect the system and also those objects
outside the system whose attributes are changed by the actions of
the system.
Mental model
Environment Model environm
System
System model
In figure 2.6, the system is bounded by a heavy line; real world parts
are shown as squares, objects are shown as rectangles; and an
environment object is shown with gray outline.
Many different Although the general properties of object orientation are shared by all
definitions of object practitioners, there are differences in the details. The differences
orientation in use usually boil down to differences in the semantics of the language
used to express the model. Our view of object orientation is
influenced by the semantics of the Smalltalk language in which
everything of interest is expressed in the terms of objects. Our view is
also consistent with the definitions given by the Object Management
Group [CORBA 91], an organization dedicated to the widespread
application of object orientation in government and industry.
An object is An object itself is initially thought of as a black box with an inside and
encapsulated an outside as shown in figure 2.7. Looking inside, we would see that
the object is capable of doing things and of storing information; it
contains methods (procedures) and data. But the object cannot do
anything by itself, and there is no way that we from its outside can
deduce its internal construction. This is called encapsulation. (Some
authors distinguish between encapsulation and information hiding,
we do not need this distinction and regard the two terms as being
synonymous).
An object has An object has an identity that it keeps throughout its life time; and
identity there will never be another object with just that identity anywhere in
the world.
An object can have An object can have object attributes that represent information
attributes associated with it. We choose the object attributes which we consider
relevant in our context.
Objects interact An object interacts with other objects by sending and receiving
through messages messages as illustrated in figure 2.8. Messages do not arise by
magic; every message has both a sender and a receiver.
messages
Messages sent A message received by an object triggers a method, and parts of this
spontaneously from method may be to send further messages. The avalanche of
environment objects messages flowing through the objects must start somewhere. Some
objects will spontaneously send a message without first having
received one. We call the initial message a stimulus message and
the resulting sequence of actions is called an activity. The object
that sends a stimulus message must clearly be in the system
environment.
Analysis and design Most life cycle models distinguish between analysis of an existing
organization along with its problems; the specification and design of a
system that shall solve these problems; and the implementation of
the new system. Different modeling paradigms have often been used
for the different stages; and there has been no guarantee that
information gathered in one stage has been faithfully carried over to
the next stage.
Ruth
(President)
Object identity The object identity property is evident in our example. A person can
be one of a pair of identical twins, he may change his name,
amputate arms and legs, install a new heart, have a face lift, even
change his sex -- the identity of the person remains the same. All the
atoms of a person's body are replaced several times during his
lifetime, thoughts and feelings change; and yet -- the person is the
same; there has never been and will never be another person with
the same identity. In our example, there are two persons named Bill.
They are modeled as different objects, so we know there are two
employees with the same name.
Object attributes We could choose to consider the following person object attributes:
name, job position, address, telephone number, salary, age, and
competence. The attributes can be simple, such as name; or
complex, such as competence.
Ruth
(President)
In a nutshell:
The role model is an abstraction on the object model where we
recognize a pattern of objects and describe it as a corresponding
pattern of roles.
The classification One popular abstraction of object orientation is the concept of class;
abstraction is not defining the attributes and behavior of a set of similar objects. The
very helpful for inheritance relation permits a derived class to be defined as an
understanding object extension and modification of a base class.
structures
Economist
Programmer
Technical Writer
Lawyer
Figure 3.11 A
specialization -
generalization
hierarchy of the
ExpenseAccount
objects
A role focuses on The notion of a class focuses on the capabilities of the objects; while
position and the notion of a role focuses on the position and responsibility of an
responsibility of object within the overall structure of objects. Training people is costly
object and time consuming, and we strive to give people general training
which makes them capable of filling a variety of positions.
Programming is also costly and time consuming, and we strive to
program objects that can serve in different positions in a variety of
object structures.
In role modeling we We want an architect's plan and leave it to the builder to exploit
always consider component commonality. Later on, we shall see that the powerful
objects in context notion of specialization is retained in the form of specializing patterns
of interacting roles through a process called synthesis. Right now we
will study individual role models and see how they represent
phenomena of interest.
The OOram In the OOram Role Model, we isolate interesting functions and study
technology focuses how they are realized in general patterns of interacting roles. Beck
on how interacting and Cunningham are quoted as saying: "... no object is an island"
roles achieve their [Helm 90]. A highbrow version of this is to refer to the classical Greek
goal philosopher Plato, who described the philosopher as "a man who
insists on seeing things together, who refuses to consider the parts
out of their relation to the whole whose parts they are; and who is
therefore the inexorable foe of crude and premature generalizations
from whichever department of investigation happens at the time to be
most in evidence."
The OOram Role The role model is the basic abstraction used in the OOram
Model technology. A role model is a description of a structure of
cooperating objects with their static and dynamic properties: what is
the subject of the object interaction, the relationships between the
objects, the messages that each object may send to its collaborators,
and the information processes?
System
Role Mode
Figure 2.12 illustrates how the role model describes a pattern in the
system of objects. The system and the role model are bounded by
heavy lines; objects are shown as rectangles; and environment
objects are shown with gray outline. Notice how role modeling is an
additional abstraction step from the modeling illustrated in figure 2.6.
Role model is an OOram Analysis is the breaking down of the whole problem area
object-oriented into separate areas of concern, and the description of each area in a
model of an object role model showing interesting views of the phenomenon of interest.
structure A phenomenon is described by a number of cooperating objects.
Sub-phenomena are specified by their area of concern; objects
describing a sub-phenomenon is organized in a pattern of objects, all
objects having the same position in the pattern are represented by a
role, we say they play the same role in the object structure. A role
has identity and is encapsulated; and it is an archetypical
representative of the objects occupying the corresponding positions
in the object system. We can therefore say that a role model is an
object-oriented model of an object structure.
Ruth
(President)
Bill
(Dispatcher)
Bookkeeper Traveler
Ann
(Consultant)
Figure 3.13 An object John Kim
pattern is an instance (Cashier) (Methodologist)
of a role model
Roles in Travel Important roles in our travel expense example could be Traveler,
Expense example Authorizer, Bookkeeper and Paymaster as illustrated in figure 2.13. A
role model describes these roles, their responsibilities and rights,
their static relationships and their dynamic behavior.
ENT ENT
au tr
Traveler Authorizer
bo
A line represents a collaboration
relationship between two roles.
A double small circle represents
that the adjacent role knows about
and may send messages to ENT ENT
any number of collaborator roles. pm
Bookkeeper Paymaster
Figure 2.14 is a role model collaboration view that shows the roles
and the message communication paths. The figure says that the
participants in the handling of a travel expense report are playing the
roles of Traveler, Authorizer, Bookkeeper and Paymaster. The
Traveler and the Authorizer know about each other and exchange
messages. The Paymaster does not know about the Bookkeeper and
cannot send messages to him, similarly the Bookkeeper does not
know about the Authorizer. This is true in the context of the current
area of concern. Other role models might show close interaction
between them.
Associated with the line from the Traveler role is a port, a small circle
that represents the messages that the Traveler role may send to the
Authorizer role in the context of this model. Other small circles are
similarly interpreted.
Role models may be A role model can be viewed from many different viewpoints and in
viewed in different many different ways, each view highlighting certain aspects and
ways hiding others. We can study the inside of individual roles; we can
study the messages passing between the roles; and we can study
the system as seen from its environment. We can take a data-
centered approach and study the roles, their semantic interpretation,
their responsibilities, and their attributes. We can take a process-
centered approach and study the message paths between the roles;
the messages permitted sent along each path; typical message
sequences; and the role methods that are triggered by these
messages.
travelPermissionRequest:
travelPermission:
expenseReport:
authorizedExpenseReport:
paymentRequest:
Figure 3.15 Travel
Expense procedure --
typical message
scenario
/ENT /ENT
Traveler Authorizer
travelPermission: (anINFTravelPermission)
<Traveler travels>
Divide and conquer Role model analysis is a powerful extension of the object orientation
paradigm because it permits us to identify different kinds of
phenomena and to study them in isolation without losing the benefits
of objects.
We will give two additional role model examples. The first example
models the transfer of files between two computers on the Internet. It
is simple in the sense that it only involves two objects, but it
illustrates how separation of concern can materially simplify the
models and highlight important aspects. The second example shows
how we can use role modeling to describe how several objects play
their roles in order to achieve some purpose.
Divide and conquer Systems consisting of relatively few objects may often be described
in a single role model, but many practical object structures will be too
large and complex to be comprehended as a single model. We then
identify different concerns, which are covered by the system, and
analyze each of them separately. We divide the whole into
manageable parts and conquer each part with an appropriate model.
If the whole is simply the sum of its parts, we have also conquered
the whole. If not, we may use OOram synthesis to create derived
models which describe the dependencies. OOram synthesis will be
the theme of chapter 3. For now, we will continue our studies of the
use of isolated role models.
The Internet as a We will use the Internet as an example of a large object structure.
huge structure of The Internet connects several million computers. Its is typical of the
objects distributed nature of Internet that nobody knows the exact number.
As seen from the Internet, the connected computers appear as
objects: they have identity, they are encapsulated, and only interact
by sending messages to each other.
The Internet is used for a wide variety of purposes. Some are well
known and some are only known within their user community. We
believe it is an early example of the information systems of the future;
it is not a designed system, but has evolved as many different people
have made their contributions. The whole is not known to anybody,
and would exceed our mental capacity even if we had access to all
relevant information. We can, however, select any activities we may
be interested in; identify the objects that take part in the activities;
idealize them into roles; and describe the activities to any desired
detail.
Concern: The FTP As an example, let us select the wellknown network File Transfer
Program, FTP. The interaction between the FTP participants is based
on the Arpanet standard File Transfer Protocol, which allows the
transfer of files between two remote computers. Two objects are
involved as indicated in the top model of figure 2.17. The first takes
the initiative and controls the activities; this object plays the Client
role. The other is a provider of services; this object plays the Server
role. Some objects (computers) are only able to play the Client role;
other objects are only able to play the Server role; and some objects
are able to play both roles. The abstraction from object to role
permits us to ignore these complications and create a "pure" model
where each role has a single purpose. The role model is illustrated in
figure 2.17 (a).
Client-Server Given the Client and Server roles, we can now study how they
activities perform various activities. In one activity, the Client identifies itself by
name and password to the Server so that the Server can establish
the appropriate privileges. Another activity permits the Client to
navigate in the Server's file directory hierarchy. A third activity
permits the Client to specify operations on the "current file directory".
The FTP standards for these activities do not interest us here. The
point is that we can describe each activity as an interaction process
involving the Client and Server roles. Each activity will start with a
stimulus message from the Client, and will result in a response in the
form of appropriate changes in object attributes or some final
termination message. A change directory stimulus message results in
a change in the Server's currentDirectory attribute. A list directory
stimulus message results in a termination message to the Client that
contains the list.
Concern: The main purpose of FTP is to transfer files between the connected
Transferring a file parties. Files may be transferred from the Client to the Server or from
the Server to the Client. We combine these two cases by defining file
transfer as being the transfer of a file from an object playing the
Source role to an object playing the Destination role. This is
illustrated in figure 2.17 (b).
The initiative for a file transfer is taken by the object playing the Client
role, and the choice of roles actually played at any given time by that
object depends on the direction of the desired transfer.
File transfer activity The transfer of a file causes a fairly complex interaction between
fairly complex Source and Destination. The Source has to split the file into
transferable chunks that have to be reassembled in correct sequence
in the Destination. The Source has to add redundant data to the
chunks so that the Destination can check that the chunk has been
transferred correctly. Protocols have to be established between
Source and Destination to control the flow of data and to ensure
retransmission of incorrect chunks. All this can be studied in the role
model independently of which objects play the roles of Client and
Server; and which objects play the roles of Source and Destination.
Separation of The above example illustrates two points about role modeling. The
concern a powerful first is that we need to see the involved objects if we want to describe
simplifying device how a structure of objects performs its duties. The second is that
separation of concern is a powerful way of separating a complex
situation into simple components. We could have created an object
model with two objects: one playing the roles of Client, Source and
Destination, the other playing the roles of Server, Source and
Destination. This derived model would be more complex and harder
to understand than the two simple models of figure 2.17, and the
combination of the two essentially separate functionalities would not
in any way add to the value of the model.
Concern: The The second example we have chosen is that a company wants to
purchase of goods buy something from a supplier. The company pays for the goods by
instructing its bank to transfer the amount to the supplier's bank and
to debit the supplier's account. The example is designed to illustrate
that it may be convenient and even essential to study several objects
together in order to give an adequate description of an activity.
Four roles The problem is simply modeled by four roles as shown in figure 2.18.
The company is represented by the Company role, the supplier by
the Supplier role, and the two banks by the PayerBank and the
PayeeBank.
Alternative mapping The simple model of figure 2.18 suggests that four objects could be
between roles and involved, each playing one of the roles. But this is only one of the
objects possible mappings between roles and objects. The company and the
supplier might use the same bank; the PayerBank and PayeeBank
roles would then be played by the same object. Or the company
could actually be a bank; the Company and PayerBank would then
be played by the same object. Many other mappings are conceivable.
The role model permits us to concentrate on the essence of the
phenomenon, disregarding the mapping to actual objects.
An object which
The bank of the
desires to supply
Supplier.
goods.
Payee
Supplier cli
Bank
cust paye
vendor paye
Payer
Company ban cli
Bank
An object which
Figure 3.18 The The bank of
desires to
collaborating roles purchase goods.
the Company.
OOram technology The Scenario of figure 2.19 shows a typical message sequence for a
supports many views purchasing activity.
Payer Payee
Company Supplier
Bank Bank
requestBid
bid
order
goodsAndInvoice
paymentOrder
transferOrder
debitAdvice
Figure 3.19 A Scenario
shows a typical
message sequence
The Company role can send the messages requestBid and order to
the Supplier. It can also send the message paymentOrder to the
PayerBank. The PayerBank can send transactionReceipt-messages
to the Company and the transferOrder-messages to the PayeeBank.
Finally, the PayeeBank can send transferReceipt-messages to the
PayerBank and debitAdvice-messages to the Supplier.
SupplierFromPayeeBankIntf
debitAdvice
Payee
Supplier cli
Bank
CompanyFromSupplierIntf PayerBankFromPayeeBankIntf
bid transferReceipt
goodsAndInvoice cust paye
SupplierFromCompanyIntf PayeeBankFromPayerBankIntf
order vendor paye transferOrder
requestBid
Payer
Company ban cli
Bank
Many views give Combined with the separation of concern exemplified in the previous
expressive power to section, the appropriate selection of views gives the analyst powerful
the analyst/designer means for reducing complex problems to a number of simple
descriptions.
In a nutshell
Work processes have to be tailored to the task at hand and the
people who are going to do the work. Further, there is no work
process that magically ensures a successful modeling operation;
quality results can only be produced by quality people. The
deliverables from a work process are more concrete, and we suggest
a list of deliverables that can be taken as a starting point.
Finding the objects is considered a hard problem for the novices, and
fairly straight forward for the experienced analysts. We suggest a few
hints to help finding the objects, but suggest that the most important
source is to be found in reusable components. Such components
package accumulated expert experience and provide excellent
starting points for both novices and experts.
Finding the objects The novice analysts frequently struggles with finding the objects or
roles. This is a symptom of a deeper problem, namely that the
analyst has not yet internalized the object paradigm.
Objects found by It is thus easy to find most of the objects up front, but there is really
combination of only one way to find all of them: study a similar system that has had
personal creativity the benefit of a long history of evolution and improvements. This is
and study of existing one of the most compelling reasons for applying reusable patterns
systems and frameworks; they provide mature solutions to known problems.
CRC cards support A good technique for finding objects and roles is to use Class-
working in groups Responsibility-Collaborator cards (CRC-cards) as the focus points of
group discussions. The CRC cards are adapted from Cunningham
and Beck. See for example [Wirfs-Brock 90].
The CRC cards are index cards, each card is divided into three areas
as shown in figure 2.21. One card is created for each role, and the
group discusses how the roles interact to achieve the response
specified for each stimulus. Individual group members should claim
1. CRC cards support the decomposition part of the design and help
assign responsibility to the constituent roles.
2. Objects collaborate through intention-revealing message sends.
3. An attractive characteristic of index cards is that they are concrete: they
can be owned, pointed at and moved about.
4. The technique gives the group the impression (illusion) of
"completeness" when they are done.
Name: Collaborators:
Authorizer Traveler
Bookkeeper
Responsibility:
Responsible for
relevance of trip
Figure 3.21 CRC and for available
example card for the budget
Authorizer role.
Notice that when a group works with CRC cards, they study the roles
and the messages simultaneously. The technique therefore tends to
be effective both for finding "good roles", and for finding simple, but
adequate, model behavior by enacting the Scenarios (even if the
dynamics of messages passing is not recorded on the cards). The
CRC technique supports role modeling directly, since both focus on
object responsibility and object interaction.
A structure of roles is The creation of a structure of collaborating roles is, in many ways,
similar to a work similar to creating an organization of people collaborating in
organization. performing some common task.
Max Weber's We have earlier mentioned Max Weber's dream of a rational work
'rational' work organization. The following literal excerpts from [Etzioni 64] form a
organization was beautiful description of this "perfect bureaucracy": logical, rational,
object-oriented extremely efficient, and extremely rigid. Applied to the computer
system, it is perfect. Applied to the human organization, it can
become a nightmare (my comments in parenthesis):
In a nutshell
OOram role model analysis helps the developer master object
structures of any size. The object structure may exist. The purpose is
then to understand it. Alternatively, the purpose may be to design a
new object structure. The objects are then imaginary. In both cases,
the OOram approach is to identify different concerns which are
represented in the object structure and to create idealized object
models, called role models, which focus on the selected area of
concern and ignores everything else.
External and internal We have defined objects as being encapsulated. This is illustrated in
observation figure 2.22. It means that we can observe some of its properties
when we observe it from outside the object; while other properties
can only be seen from inside.
Encapsulation hides
inside properties
Object
Methods
Instance variables
State
Messages
Attributes
1. Synchronous. Only one object can be active at any time, and the
sender's actions continue only after the receiver's actions are
completed. The receiver may return a result to the sender.
2. Synchronous deferred. The sender object must be ready to send a
message and the receiver object must be ready to receive it before it
can be transferred. The sender and receiver objects are synchronized
at the time of message transfer. The sender's actions continue after the
receiver has accepted the message. A return value could confirm the
receipt of the message.
3. Asynchronous. The sender can transmit a message at any time, and
the sender's actions continue immediately. The receiver manages a
queue of incoming messages, and may need to wait for an acceptable
message to arrive in the input queue. A return value to the sender could
confirm that the message has been put into the receiver's input queue.
The fancy names are unimportant, the ability to hide the details of an
operation inside an object is essential. For example, different
graphical objects can respond to a display-command according to
their individual characteristics; different bank account objects can
compute accumulated interest according to the nature of the account;
different TravelAuthorizer persons can follow different rules when
they determine their response to a travel permission request.
State The internal conditions of an object which affect the object's behavior
are abstracted into the object's possible states, where a state
determines which messages the object is ready to receive and how it
will process them. When the object receives a message, it performs
an action depending on the current state, and enters a next state
which may be different from the current state.
If the actions taken when the object receives a message are different
in different states, the corresponding method will be a composite with
different action branches for the different states.
Separation of The OOram role model supports separation of concern. A large and
concern complex phenomenon, which we think of as a large and complex
structure of interacting objects, may be split into a number of
subphenomena. Each subphenomenon is described by its own role
model.
For a given system of roles, the environment is the set of all roles
outside the system that send messages to the objects of the system,
and also those roles outside the system that receive messages from
the roles of the system.
Roles have all the properties of objects: They have identity and
attributes; they are encapsulated; they interact by message-passing;
and their actions are defined by their methods. Inheritance is
supported by a process called synthesis that will described in
chapter 3: Role model synthesis.
A role model may be We may observe the system of interacting roles from different
observed in different observation points. OOram supports three points of observation,
perspectives called perspectives:
The analyst can only When thinking about some interesting phenomenon, the OOram
observe views of the analyst creates an object model of the phenomenon in her head. This
underlying model model can only be captured on paper or a computer screen as one or
more views -- these views are different presentations of an
underlying OOram model. In the case of a paper report, the
underlying model is abstract in the sense that it has no explicit
representation. In the case of a computer-based system, the
underlying model can be represented in an object database. See
figure 2.23.
Mental object model
view OOram
Model
view
Ten different views Systems of interacting objects may be studied in different views, with
on the same model each view expressing certain aspects of the system of roles while
suppressing others. OOram analysis supports ten different views on
a role model:
Table 3.1
Applicability of the
views in the
different
perspectives
Important notes:
1. The views are different presentations of one and the same model for
the purposes of documentation and user interaction.
2. A subset of the views should be selected to suit a particular modeling
process. It is unlikely that anybody will ever need them all.
3. The views are not orthogonal. Their mutual consistency should
preferably be enforced automatically, but it is also possible to do so by
manual means.
Area of Concern The area of concern view (figure 2.24)is a free text describing the
view describes the phenomenon modeled by the role model. The text should indicate the
model as a whole purpose of the model and be sufficiently precise to enable a reader to
determine which phenomena are covered by the model, and which
phenomena are not covered. The description must be precise
because it will be used to determine which objects belong to the
system and which objects are outside it.
Figure 3.24 Area of
Concern example
This role model describes how an enterprise purchases goods and
pays for them.
The Collaboration view shows the roles and the message paths
between them. Our notation is shown in figure 2.27 and illustrated in
figure 2.28.
Payee
Vendor ban cl
Bank
SD
cus bnk
Role explanation
An object which
desires to supply
goods. ven bnk
Payer
Enterprise ban cl
Bank
Enterprise is an environment
role because it sends a
stimulus message. Enterprise
This port points to any
knows exactly
number of collaborators,
one PayerBank.
of which Enterprise
is a typical example.
Role symbols may Role symbols may be decorated to indicate the nature of the object.
be decorated Figure 2.29 illustrates some possibilities, but the analyst is free to
define her own symbols.
Virtual roles are Roles may arbitrarily be lumped into virtual roles for convenience. A
arbitrary clusters of virtual role is a role that represents a cluster of objects rather than a
concrete roles single object. Virtual roles are denoted by a super-ellipse with
shadow as shown in figure 2.30. Note that virtual roles are artifacts of
the presentation and do not exist in the underlying role model.
Figure 3.30 Virtual role Virtual A role symbol drawn with a sha
notation Role denotes an virtual role
ban
Enterprise
Virtual roles with their associated virtual ports must be resolved into
concrete roles. Figure 2.31 can, for example, be resolved into figure
2.28.
actions in the system that results from the stimulus. We propose that
Scenarios are admirably suited to describe use cases. A single
Scenario, as described here, will be sufficient for simple use cases,
and the aggregation and synthesis operations discussed in chapter 3
enable us to dissect a use case down to any desired detail.
Interactions: Actors:
bid
Time line
order
goodsAndInvoice
paymentOrder
transferOrder
creditAdvice
Interfaces define An interface view defines a set of messages that may be sent from
messages that may one role to another. Interfaces are usually specified textually, but may
be sent also be shown in an annotation in the collaboration view shown in
figure 2.34.
Payee
Vendor ban cl
EnterpriseFromVendorIntf Bank
bid SD
goodsAndInvoice
cus bnk
VendorFromEnterpriseIntf
bidRejected
ven bnk
order
requestBid
Payer
Enterprise ban cl
Bank
Textual form more We find that we can only use the graphical form of figure 2.35 in
useful simple cases such as in very high-level overviews, trade show
demonstrations and tutorials. Real world models are simply too
complex for the graphical presentation to fit on a computer screen or
a sheet of paper, and we prefer a textual form. As with the role list
view, the textual form of the interface view may be written informally
or in the formal OOram language. The full language syntax is
discussed in appendix A, we give a simple example of the formal
textual notation in figure 2.36 and an informal form in figure 2.37.
interface 'Vendor<Enterprise'
message synch 'requestBid'
explanation "Request bid for delivery of specified goods."
message synch 'order'
explanation "Order goods"
message synch 'bidRejected'
explanation "Reject bid"
interface 'Enterprise<Vendor'
message synch 'bid'
explanation "Submitting bid"
message synch 'goodsAndInvoice'
explanation "Sending goods together with invoice"
interface 'PayerBank<Enterprise'
message synch 'paymentOrder'
explanation "Order to transfer money"
interface 'Enterprise<PayerBank'
message synch 'transactionReceipt'
explanation "Acknowledging order to transfer money"
interface 'PayeeBank<PayerBank'
message synch 'transferOrder'
explanation "Order to transfer money"
interface 'PayerBank<PayeeBank'
message synch 'transferReceipt'
Figure 3.36 Textual explanation "Acknowledging order to transfer money"
specification of interface 'Vendor<PayeeBank'
interfaces in the message synch 'creditAdvice'
OOram language explanation "Advising that money has been received on behalf of vendor"
interface 'Vendor<Enterprise'
'requestBid' "Request bid for delivery of specified goods."
'order' "Order goods"
'bidRejected' "Reject bid"
interface 'Enterprise<Vendor'
'bid' "Submitting bid"
'goodsAndInvoice' "Sending goods together with invoice"
interface 'PayerBank<Enterprise'
'paymentOrder' "Order to transfer money"
interface 'Enterprise<PayerBank'
'transactionReceipt' "Acknowledging order to transfer money"
interface 'PayeeBank<PayerBank'
'transferOrder' "Order to transfer money"
Figure 3.37 Informal interface 'PayerBank<PayeeBank'
textual specification of 'transferReceipt' "Acknowledging order to transfer money"
interfaces interface 'Vendor<PayeeBank'
'creditAdvice' "Advising that money has been received on behalf of vendor"
Message
Focus role
receiver role
Message that
triggers method
/Payer
/Enterprise
Bank
goodsAndInvoice
Chapter 4
Role model synthesis
This chapter tells you how to achieve separation of concern while
retaining control with the overall system.
Some useful base Some useful base models are illustrated in figure 3.1.
models
User
base models
System
requirements
System base models
user
model
Design
System base models
requirements
models
Base
System classes
design
model
Derived
Figure 4.1 Models on classes
all levels may be
synthesized from
simpler base models
1. The System user model may be composed from more general base
models, which we may create as part of our current project or which we
may find in a library of reusable components.
2. The System requirements model may be composed from more
general base models, which we create as part of our current project or
which we find in a library of reusable components.
3. The System design model describes the system components and
their interaction. We would expect that a number of critical design
details may be found in a library of reusable design base models
(frameworks).
4. The System implementation is a specialization of reusable base
classes expressed in library frameworks.
In a nutshell
We illustrate the concept of synthesis through a concrete case. You
will see that you can master a complex phenomenon by dividing it
into manageable subproblems, and that you can retain control of the
whole with synthesis. We would like to challenge you to imagine how
you could employ this technology to model your own complex of
computer-based systems.
TravelExpense case The example we have chosen to illustrate the idea of synthesis is to
extension extend the TravelExpense enterprise (ENT) model with a model of
airline ticket booking. We laid a good foundation in section 2.3 when
we created a TravelExpense model. In this model, the purchasing of
airline tickets appeared as a small comment in the Method definition
of figure 2.16 on page 76??. We have several options when we now
want to expand the operation: <Traveler purchases the necessary
tickets>.
Extended
TravelExpense
(a) Extend TravelExpense model.
Derived
AirlineBooking
TravelExpense
(b) Synthesize AirlineBooking
into TravelExpense.
TravelExpense
Derived
TravelExpense
AirlineBooking
We choose The first alternative is perfectly viable in this case since even the
alternative 3 extended model will be quite simple and manageable. We reject this
alternative here because it does not illustrate the issues we want to
discuss.
This is often the best alternative. Consider that you have created a
model that gives a nice and clean solution to a certain problem. If you
then clutter your solution with all the details of error handling, you
have lost your nice and clean solution. It is much better to create a
separate model of your error handling mechanism, and use synthesis
to create a third model that combines the two while retaining the
original, clean models if needed.
Airline tickets are ordered by a booking clerk and paid directly to the
Figure 4.3 AB Area of travel agent. The traveler is to show the cost of the tickets on the
concern
expense report as an expense, and as an advance since the tickets
were not paid by the traveler.
There is one activity and thus one stimulus message: the ABTraveler
begins the activity by sending an orderTicket message. The normal
response, i.e., the final result of the activity, is that the traveler
receives the tickets and records the ticket costs for later use.
Figure 4.4 AB Stimulus Response Comments
Stimulus-response
view ABTraveler >> orderTicket ticketWithCost >> ABTraveler Ticket cost retained in
attribute of ABTraveler role
The essence of this model is the office procedure for handling tickets.
We describe it in the scenario of figure 3.5.
AB AB AB
AB AB
Booking Travel Book
Traveler Paymaster
Clerk Agent Keeper
orderTicket:
orderTicket:
invoice
invoice
ticketWithCost:
authorizedInvoice:
paymentRequest:
payment:
Figure 4.5 AB
AirlineBooking
Scenario
AB AB
AB
sec tr Booking bk Book
Traveler
Clerk Keeper
ta pm
cust
Figure 4.6 AB AB
AB
Travel ven
Collaboration view Agent
Paymaster
interface 'ABBookingClerk<ABTraveler'
message 'orderTicket:' explanation "Purchase ticket(s)."
param 'ticketSpecification' type 'String'
interface 'ABTraveler<ABBookingClerk'
message 'ticketWithCost:' explanation "Transmitting the ticket(s)
together with cost information."
param 'package' type 'String'
interface 'ABTravelAgent<ABBookingClerk'
message 'orderTicket:' explanation "Reserve specified passages
and issue ticket(s)."
param 'ticketSpecification' type 'String'
interface 'ABBookingClerk<ABTravelAgent'
message 'ticket:' explanation "Transmittal of ticket(s)."
param 'aTicket' type 'String'
message 'invoice:' explanation "Transmittal of invoice."
param 'anInvoice' type 'String'
interface 'ABBookKeeper<ABBookingClerk'
message 'authorizedInvoice:' explanation "Pay this authorized
ticket invoice."
param 'anInvoice' type 'String'
interface 'ABPaymaster<ABBookKeeper'
message 'paymentRequest:' explanation "Pay this invoice."
param 'anInvoice' type 'String'
Figure 4.7 AB interface 'ABTravelAgent<ABPaymaster'
message interfaces
message 'payment:' explanation "Transmittal of payment."
param 'aCheque' type 'String'
Let objects play We now compose a derived model from the AirlineBooking (AB) and
multiple roles TravelExpense (TE) models by synthesis. We call the new model
DerivedTravelExpense (DTE).
collaboration view
The environment roles are still the Traveler who wants to travel, and
the Paymaster who must arrange for the remuneration of the Traveler
. The system itself is represented by a single, virtual role as shown in
figure 3.9.
The synthesis relation specifies that the derived role shall play the
base role: The derived role shall fulfill the base role responsibilities
and is granted its privileges: the DTE-Traveler plays the role of TE-
Traveler; the DTE-Authorizer plays the role of TE-Authorizer, etc.
We similarly bind each role of the AB model onto a role in the DTE
model. We had to add the DTE-BookingClerk and the DTE-
TravelAgent to match the corresponding roles in the AB model, but
could reuse existing DTE roles to match the remaining AirlineBooking
roles. The DTE-Traveler, DTE-Bookkeeper, and the DTE-Paymaster
now play two other roles and must conform to both specifications.
TE TE
au tr
Traveler Authorizer
bo
TE TE
TE Bookkeeper
pm
Paymaster
TravelExpense
DTE DTE
au tr
Traveler Authorizer
sec bo
tr
DTE DTE
DTE
Booking bk Book pm
Paymaster
Clerk Keeper
ta ven
cust
DTE
DTE Travel
Agent
DerivedTravelExpense
AB AB
AB
sec tr Booking bk Book
Traveler
Clerk Keeper
ta pm
cust
AB
Figure 4.11 DTE AB Travel ven
AB
Paymaster
synthesis collaboration Agent
diagram AirlineBooking
Tabular synthesis Even in this very simple example, the graphical synthesis
notation more useful collaboration view is cluttered and hard to read. The compact tabular
presentation view of figure 3.12 is usually better for professional
system documentation.
Derived model Base model Base model
DTE TE AB
DTE-Traveler TE-Traveler AB-Traveler
DTE-Authorizer TE-Authorizer
DTE-Bookkeeper TE-Bookkeeper AB-Bookkeeper
DTE-BookingClerk AB-BookingClerk
Figure 4.12 DTE
Synthesis Table DTE-TravelAgent AB-TravelAgent
DTE-Paymaster TE-Paymaster AB-Paymaster
There is one row in the table for each role in the derived model. The
first column contains the names of the derived roles. There is one
additional column for each base model showing the corresponding
base role. Model consistency is preserved by mapping each role of
the base models onto a role in the derived model. The derived model
may contain roles which are not mapped from any base model role;
this is not shown in the current example.
AirlineBooking A scenario view of the derived model activity is shown in figure 3.13.
activity spliced into It shows how the AirlineBooking activity from figure 3.5 is merged into
ExpenseAccount the TravelExpense activity of figure 2.15 on page 75??.
action
The key to this merger is in the method of figure 2.16 that is triggered
by the travelPermission-message. This method is split into two parts
in the derived model: the first part, shown in figure 3.14, is triggered
by the old travelPermission-message and ends by sending the
AirlineBooking stimulus message. The second part, shown in figure
3.15, is triggered by the termination of the AirlineBooking activity and
completes the actions performed by the Traveler.
travelPermissionRequest:
InsertedAirlineBooking
travelPermission:
activity
orderTicket:
orderTicket:
ticket:
invoice:
ticketWithCost:
authorizedInvoice:
paymentRequest:
payment:
expenseReport:
authorizedExpenseReport:
paymentRequest:
/DTE
/DTE
Booking
Traveler
Clerk
travelPermission: (anINFTravelPermission)
/DTE /DTE
Traveler Authorizer
<Traveler travels>
In a nutshell
We always seem to extend the scope of our systems, and even the
object models are frequently too complex to be comprehended by our
limited brain capacity. The OOram technology provides abstractions
that help us to divide and conquer, enabling us to handle complex
phenomena in a controlled manner. We analyze different parts of a
phenomenon to create simple role models, and understand each of
these models separately.
We may create As we have stressed earlier, our first approach to a new problem is to
solution islands focus on its essential aspects and postpone all the trivial parts to later
stages in the development. The principle of minimizing risk
(FOOTNOTE: See section 4.3) suggests that we start with the parts
we expect will be the hardest to get right, and continue with other
parts as the harder ones get resolved. We might begin by sketching
out the work flow in the organization, or creating a high-level model of
the information requirements, or making a small user interface
prototype, or studying high-level state machine models showing
essential states and transitions in critical processes.
We need many Whatever our work process, we will end up with many different
models models describing different aspects of the problem and its solution.
There will be overview models on a high level of abstraction, and low
level models showing the details of a bounded part of the problem.
We do not want to extend an overview model with more and more
details until we get a huge model containing everything; we want to
retain the overview model and to supplant it with auxiliary
descriptions of the various details.
We need seamless All our different models show different aspects of the same overall
model phenomenon; they are strongly linked to this common phenomenon.
interdependencies The models are not orthogonal, but are highly dependent because
the same objects often appears in several models. We support the
ideas of traceability and seamless descriptions, so that whenever we
observe some information in one model, we will be able to link it to
any other description of the same thing -- whether in a different
model on the same level of abstraction; or in another model on a
different abstraction level.
Subclassing used for Inheritance is used in object-oriented programming for two different
concept building and purposes: concept building and code sharing.
for code sharing
When concept building, we subclass a given superclass because the
concept represented by the subclass is a specialization of the
concept represented by the superclass. Instances of the subclass will
have all the attributes of the superclass and understand all the
messages understood by the superclass in addition to possible
attributes and messages defined in the subclass.
Synthesis only used We could similarly synthesize an OOram base model into a derived
for concept building model because the base model contained useful constructs. But the
purpose of OOram models is to enhance our understanding of a
phenomenon, and we insist that synthesis is used for the synthesis of
concepts.
Role modeling and An object model is a simulation of the phenomenon it represents; its
synthesis apply objects enact the phenomenon. It is common sense that if we want to
common sense to isolate certain aspects of the phenomenon, we correspondingly
objects isolate the relevant aspects of the objects which enact them, and we
describe their role in the context of the studied aspects.
OOram models The separation of concern and object playing multiple roles by
describe systems of synthesis makes it possible to describe systems of any size with
any size OOram role models.
Finding the models We end this introduction to synthesis with the $64,000 question: How
do we find the models, i.e., how do we determine that we should
factor out a base model or merge several models into a larger one?
There are no hard and fast rules, but we will endeavor to give a few
loosely formulated guidelines. Behind these guidelines is the
fortunate fact that this is an area where the good systems analyst can
demonstrate his or her excellence.
Many different model A model may depend on other models in many different ways.
relationships Generalization-specialization is an important model relationship:
one model describes a general phenomenon, while other models
describe its specializations. A general model could, for example,
describe how we make important decisions in our organization. Two
different specializations of this model could describe how we create a
budget or how we establish a major project. (FOOTNOTE: The
creation of different kinds of reusable components will be discussed
in chapter 5: Creating reusable components.)
OOram synthesis The Webster dictionary defines synthesis: "synthesis 1a: the
composition or combination of parts or elements so as to form a
whole c: the combination of often diverse conceptions into a coherent
whole" [Webster 77].
We say that the base model is synthesized into the derived model.
This is achieved by synthesizing every base role in the base model
into a corresponding derived role in the derived model.
The idea of objects playing multiple roles has a clear parallel in the
theory of organizations: a person typically plays multiple roles such
as a subordinate in a department, a member of a project, a traveler in
the context of travel expenses.
Objects play multiple Consider the file transfer protocol example of figure 2.17 on page
roles 78??. The figure describes two models: a Client-Server model and a
Source-Destination model.
Source
rsp int
Destination File transmit derived model
Client Server
Destination
rsp int
Source File retrieve derived model
Client Server
Send/receive
rsp int
Send/receive File send/receive derived model
Client Server
Base models may be A base model may be repeatedly synthesized into a derived model.
applied repeatedly Figure 3.19 shows a role model for a tree structure. The base model
marked (a) describes a basic tree consisting of a Mother role and a
Child role. A Child has one and only one Mother, while a Mother can
have any number of Child objects, even none.
The Mother may ask her Child to execute a block of code recursively,
either executing the code before traversing the subtree (
preorderTraverse) or after (postorderTraverse). The Mother may also
ask her Child for all tree leaves (getLeaves). The Daughter may ask
her Mother for the root of the tree, in this case it is the Mother herself.
Figure 3.19 (b) shows a three level tree with roles Root, Node and
Leaf. This is a derived role model; it was created by synthesizing the
basic tree model twice. First, the Root and Node roles are specified
to play the Mother and Child roles respectively. Second, the Node
and Leaf roles are specified to play the Mother and Child roles. A
Root object will now play the Mother role; a Node object will play both
the Child and the Mother role; and a Leaf object will play the
Daughter role.
We see that the interfaces of the derived model are simply inherited
from the base model, and it is not necessary to repeat the
specification in the derived model. Further, if the base model had
been implemented as the classes Mother1 and Child1, the
implementation of the derived model could exploit this by deriving its
classes from the base classes.
Root ChildFromMotherIntf
getLeaves
postorderTraverse:
dw preorderTraverse:
Mother
ChildFromMotherIntf
MotherFromChildIntf
getLeaves
void getRoot ()
postorderTraverse: up
preorderTraverse: dw
Node ChildFromMotherIntf
MotherFromChildIntf
getLeaves
getRoot
up postorderTraverse:
dw preorderTraverse:
Child
up MotherFromChildIntf
void getRoot ()
Leaf
Synthesis applies to Synthesis is an operation on role models, not single roles. The
whole role models argument is that if we extend the services offered of one object, we
must also extend some other object to make it utilize the new
functionality. We do not know the exact nature of these objects; but
we do know that they will play the appropriate roles. So when we
specify that Root plays the role of Mother, we immediately ask: Who
plays the corresponding role of Child? Figure 3.19 shows two
synthesis operations, not four.
Two-dimensional The ideas of role model analysis and role model synthesis give us
modeling two independent dimensions in the description of systems of
interacting objects. This is illustrated abstractly in figure 3.20.
Vertical Integration
(Synthesis):
Message
triggers Method
which sends (stimulus) Message
or changes Attribute
Horizontal integration
Figure 4.20 Two- (Analysis):
dimensional modeling Collaborator interaction
within Role Model.
Static correctness It is fairly easy to create an OOram tool that conserves static
can be retained correctness through a synthesis operation. Specifically:
automatically
1. All roles in a base model are mapped onto corresponding roles in the
derived model.
2. The attributes of the base roles are retained as attributes of the
corresponding derived roles.
3. All ports in a base model are mapped onto corresponding ports in the
derived model. The cardinalities of the ports in the derived model must
be consistent with the cardinalities of the corresponding ports in the
base model: the minimum cardinality of a derived port may be equal to
or greater than the minimum cardinality of the corresponding base port,
and the maximum cardinality of a derived port may be equal to or less
than the maximum cardinality of the corresponding base port.
4. All interfaces defining the messages that are permitted to be sent from
a base port are retained as identical interfaces defining messages that
are permitted to be sent from the corresponding derived port (except for
possible renaming of messages).
Due diligence Dynamic correctness means that the base model message
required to retain sequencing specifications are retained in the derived model. We
dynamic correctness have defined the notions of a method as the action taken by a role in
response to a received message, and an activity as the sequence of
actions taken by a structure of roles in response to a stimulus
message. The dynamic correctness of a role model is closely linked
to the dynamic correctness of its activities, and the preservation of
dynamic correctness through a synthesis operation means the
preservation of the integrity of the activities.
Base model Figure 2.3 on page 57?? illustrated how a manifest model in some
semantics shall be way is a representation of a mental model. We cannot automatically
retained in all check that this representation is correct; correspondence can only be
derived models checked through mental processes. For example, consider that we
have a general Tree model with a Root role collaborating with any
number of Leaf roles. Further, assume that we want to model a
mother - child relationship, and decide to derive the Mother-Child
model from the Tree base model. We can formally check that the
Mother-Child model has the properties of the Tree model, but we
cannot formally check that either model corresponds to our mental
ideas of mothers and children.
Safe and unsafe Static correctness guarantees that we only send messages through a
synthesis port that are defined in one of its interfaces. But it does not prevent
us from specifying a method in the context of one of the object's roles
that sends an arbitrary message associated with another of its roles.
We may, therefore, break into the middle of a base activity and play
havoc with any argument about its dynamic correctness, and the time
sequences of messages observed in a derived model may violate the
base model activity specifications. This may be acceptable. It could
be that we want to specify a new activity in the derived model that
merely uses some of the base model functionality. We call it unsafe
synthesis, since we have to recheck the dynamic correctness of the
derived model. The antonym is safe synthesis. This is synthesis
where we can trust that the dynamic correctness of the base model is
retained in the derived model.
Safe synthesis Else Nordhagen and Egil Andersen of the Department of Informatics
at the University of Oslo are both exploring different formal
foundations for role modeling. Parts of their work are concerned with
describing the synthesis of dynamic behavior, which is a deep
research topic. It will be premature to report their results here, so we
refer to their preliminary publications(FOOTNOTE: [E. Andersen 92],
[Nordhagen 89], [Nordhagen 95]).
Safe synthesis The essence of safe synthesis is that the integrity of the base model
preserves integrity of activities must be retained in the derived models. The activity must
base activity be started by its stimulus message and then permitted to run its
course without interference to its completion. The key to the success
of safe synthesis is that it does not matter what other activities the
objects perform before, during, or after a base model activity, as long
as they do not interfere with it in any way.
Environment roles Summing up, all base model roles are mapped onto derived model
may become system roles in the synthesis operation.
roles in derived
model In safe synthesis, the integrities of the base model activities are
retained in the derived model. This means that a base model activity
can only be triggered by its stimulus message. This stimulus
message can either become a stimulus message in the derived
model; or it can be sent from one of the methods in the derived
model.
Let us return for a moment to figure 2.3 on page 57??. Like any other
model, a hierarchical model can neither be right nor wrong, just more
or less useful for a given purpose. The distinction between root and
stem is useful if I want to cook carrots for dinner. It could be useless
if I want to study the flow of nutrients through the plant, and I had
better select a more appropriate model highlighting the vascular
system.
There are two criteria that should alert you to the possibility of
factoring out sub-phenomena from a model on any level. One is that
the model gets overly complex. We prefer models to have
somewhere between 5 and 9 roles; it will then fit nicely in our short
term memory and on a computer screen. Another criterion is that if
the model displays repeated patterns of similar structures, these
patterns should be described in separate models and removed from
the main model.
X
Part system Part system
Figure 4.21
Considering certain (a) Encapsulated aggregation (b) Embedded aggregation.
roles to be parts of (Invisible parts) (Visible parts)
another role
Aggregate roles are shown as gray, while other roles of the outer system are
shown as white, and other part roles are shown as black.
Encapsulation hides A role in the outer system may completely encapsulate the roles of
the parts within a the part system. The part roles are then invisible in the external
single role perspective of the outer system. This is called encapsulated
aggregation; there is one shared object as can be seen from the
object model of figure 3.21 (a) and the corresponding role models of
figure 3.22 (a).
We see that the object marked 'X' plays two roles: it is a system role
of the outer system and an environment role of the part system. We
could use synthesis to create a derived model covering both, but this
composite would be quite complex. We only create it in the rare
cases where it gives us important new insights. We usually prefer
keeping the two models separate, using the safe synthesis construct
activity aggregation to combine them in the implementation.
Embedding makes Some of the part roles may be visible to some of the roles of the
parts visible to outer system. The objects corresponding to these outer roles then
several roles in the play environment roles in the part system. Embedded aggregation
outer system is the name we give to this open kind of aggregation; the outer
system can see several of the objects in the embedded system as
illustrated in the object model of figure 3.21 (b) and the
corresponding role models of figure 3.22 (b).
X
Part role model Part role mod
Figure 4.22
Representing
aggregates as (a) Encapsulated aggregation (b) Embedded aggregation
structures of
collaborating objects
Any role to object In our illustration, we have assumed that each role maps on to a
mapping permissible separate object. The separation of concern between role models
permits any mapping, however. The roles of the outer role model and
the roles of the part role model may be mapped on to common
objects in any way we please. The overall system will still behave as
specified as long as we follow the rules of safe synthesis and
preserve activity independence.
Virtual roles hide A number of roles may be grouped and presented as if they were a
details single role -- without this single role representing an object in the
object structure. This is called virtual aggregation and is illustrated in
figure 3.23.
virtual role
Figure 4.23 Virtual
roles a cluster of roles
as a single aggregate
Client-server Many words have been written and many pictures flashed on
architecture overhead projectors to describe the notion of a client-server system
architecture. Clients are typically personal computers or workstations
running the user's software, while the servers are background
computers linked to the clients through communication channels and
managing shared data with their associated programs. We recognize
the client-server architecture as an essentially object-oriented
architecture; role modeling is ideally suited for describing both the
client and the server parts, and encapsulated aggregation is the
composition construct which will safely combine the two and permit
us to change focus between the client and the server as needed.
Attributes and A role model describes how objects interact to achieve some
parameters purpose. The subject of their interaction is represented as message
represent the subject parameters and object attributes.
of object interaction
roles in the current role model are represented as ports, and other
attributes are either nonobject values or role references to another
role model.
Messages carry the parameter values from one role to another, and it
is only possible to send messages to a parameter role from one of
the current roles. This current role must either have a port
referencing the parameter; or the parameter role must be
encapsulated within the current role as illustrated in figure 3.24 (a).
Current role
X
Figure 4.24
Representing an
attribute or a Subject role model
parameter as an
encapsulated role
model
The current role model may sooner or later want to send a message
to trigger an activity in the parameter model. This message must be a
stimulus message to keep the synthesis safe. Its sending role must,
therefore, be an environment role in the parameter model.
It is important to realize that the objects of the current role model and
the objects of the parameter role model all exist in the same world of
interacting objects. The distinction between the role models is an
artifact of our choice of role model abstractions and is a result of our
separation of concern. The object marked 'X' in figure 3.24 plays two
roles: one in the Current role model and one in the Subject role
model. The two role models are integrated through the methods of
object 'X' sending stimulus messages to the subject role model, and
the role models are otherwise independent.
Object-subject The parameter and attribute relationships link a model with its
relationship very universe of discourse. We will use it in the case study in chapter 7:
general Development of a business information system to link a model of a
human organization to a model of its information base, but the
concept is recursive and can be applied on as many levels as you
can keep track of.
Book
Traveler au tr Manager bo
Keeper
ta pm
ravelAgentFromABBookingClerkIntf
orderTicket:
cust
Figure 4.25 Simple
Travel
synthesis example Agent
ven Paymaster
TravelExpense
AirlineBooking
stimulus
Traveler BookingClerk Bookkeeper Paymaster TravelAgent
DerivedTravelExpense
TravelExpense
stimulus
Traveler Authorizer Bookkeeper Paymaster
AirlineBooking
DerivedTravelExpense
TravelExpense
DerivedTravelExpense
In a nutshell
We here give a technical description of the synthesis operation as
seen in each of the OOram views.
Synthesis affects all The OOram technology offers a large number of different views on
views and the role models as described in chapter 2.5 on page 90??. All the
perspectives views are somehow affected by the synthesis operation, and we will
discuss each of them in the following sections.
We focus on Safe As discussed in chapter 3.2, the static and semantic correctness of
Synthesis the base models can be carried over to the derived model
automatically. We suggested two constructs that preserve the
dynamic correctness of the base models. These two constructs,
called activity superposition and activity aggregation, will be the focus
of this chapter.
Three inheritance There are three different views showing the inheritance (export --
views import) relationships between role models:
1. The Synthesis view shows any number of role models and the
inheritance relationships between them without giving any internal
details.
2. An Inheritance Collaboration view shows two or more role models
and the inheritance relationships between their roles.
3. An Inheritance Table gives the same information in tabular form.
4. An OOram language inheritance specification gives the same
information in textual form.
Synthesis view In a synthesis view, role models are shown as rectangles. Base
model -- derived model relationships are shown as bordered arrows.
Derived models are shown to the right of the corresponding base
models as illustrated in figure 3.29. Figure 3.30 shows some of the
the role models used in this chapter together with their synthesis
relationships.
BaseModel1
Derived
Model
BaseModel2
Figure 4.29 Synthesis
view notation
Base models Synthesis relations Derived model
TravelExpense DerivedTravelExpen
AirlineBooking SimplifiedTravelExpe
RST
UVW
XY
Inheritance The notation for individual role models follows the notation given in
Collaboration view section 2.5 on page 90??. The inheritance collaboration view
shows several, related role models. All base model roles are mapped
to the corresponding derived model role by a bordered arrow as
illustrated in figure 3.31.
Base model
RST R t r T
s s
Base model
XY
Derived model
UVW
U t r W X
s y y
r x x
V Y
Figure 4.31 Example
Inheritance
Collaboration view
An inheritance table is shown in table 3.1. It has one row for each
role in the derived model. The first column shows the roles of the
derived model, while the other columns show the corresponding roles
in the base models. Note that all the roles of the base models must
be accounted for in the derived model, but the reverse need not be
true.
Derived model Base model Base model
UVW RST XY
Role U R
Role V S Y
Role W T X
Table 4.1
Example
Inheritance Table
Manual composition The synthesis operation is a very general operation and may support
of Area of Concern many different relationships between the derived and its base
models, but the phenomena described by the base models will
always, in some sense, be parts of the phenomenon described by the
derived model. The Area of Concern of the derived model will,
therefore, explicitly or implicitly encompass the Areas of Concern for
the base models.
The synthesis of the areas of concern for our two safe synthesis
constructs are as follows:
1. Activity Superposition. The derived model's area of concern includes
the area of concern of its base models. For example, we could have
two different TravelExpense models for national and international travel.
We could use synthesis to derive a model that covered both cases.
2. Activity Aggregation. A base model elaborates an action (method) in the
derived model. As an example, consider that our AirlineBooking model
elaborates one of the Traveler role's actions in the TravelExpense
model. The area of concern of the detail base model may be invisible in
the area of concern of the derived model.
Retain or explain A stimulus message from an environment role in the base model may
base model stimuli be handled in one or both of the following ways in the derived model:
A b a B c b C
D e d E f e F
A b a B c b C
Figure 4.34
Aggregation D e d E f e F
environment view
Formal collaboration There are no formal relationships between the responsibilities of the
view dependencies roles of the derived model and the roles of the base models, but the
between synthesized analyst should ensure that they are consistent. The general
models restrictions on roles, ports and cardinalities mentioned previously
also hold for the collaboration views:
1. All roles in the base models are mapped onto roles in the derived
model.
2. The attributes of the base model roles are included in the attributes of
the corresponding derived model roles.
3. The collaborators of the derived model roles will include the
collaborators of the corresponding base model roles.
4. All ports in the base models are mapped onto corresponding ports in
the derived model. The cardinalities of the ports in the derived model
must be consistent with the cardinalities of the corresponding ports in
the base model. Specifically, the minimum cardinality of a port in the
derived model must be equal to or greater than the minimum cardinality
of the corresponding ports in the base models, and the maximum
cardinality of a port in the derived model must be equal to or less than
the maximum cardinality of the corresponding ports in the base models.
Notation The graphical notation for the Inheritance Collaboration view was
described in figure 3.31. The Inheritance table in table 3.1 is used to
describe the inheritance relationships in most practical work; the
collaboration view of the derived model then looks just like any other
collaboration view.
The base model system roles have been mapped onto a common
role in the derived model, but they could have been mapped onto
different roles.
A b a B c b C
D e d E f e F
Figure 4.35
Superposition SuAD e d SuBE c e SuCF
collaboration view
A b a B c b C
AgE
Figure 4.36
Aggregation D e d E f e F
collaboration view
A B C
ab1:
bc2:
Figure 4.37 ABC (aC)
Scenario
D E F
de1:
(aF)
ef1:
Figure 4.38 DEF (aF)
Scenario
ab1:
bc2:
de1:
ef1:
Figure 4.39 Scenario
superposition
The DEF stimulus message is sent from within the derived model
method for message ab1: in role AgH. The DEF activity is thus
completely embedded in this method.
ab1:
de1:
Aggregated DEF activity.
ef1:
bc2:
All base model The interfaces associated with a port in the derived model include all
interfaces included interfaces associated with the corresponding ports in the base
models.
Base model Base model interfaces are immutable in the derived model:
interfaces immutable messages may neither be added nor removed. It is possible to
rename the derived interfaces and messages; but this adds to the
confusion and is avoided if possible. (The exception is when there
are name conflicts between base models which are synthesized into
a common, derived model).
Messages can only New messages can only be added to interfaces which are defined in
be added in new the derived model.
interfaces
Imported interface It is usually not necessary to repeat the specification of the imported
documentation interfaces in the documentation of the derived model, but they may
optional be included if this improves readability.
Default: Base When a base role is synthesized into a derived role, all its
method becomes collaborators and the corresponding message interfaces are
derived method synthesized correspondingly. The derived role has to provide a
method for every message understood by the base role. The default
is to retain the base role methods; the behavior of the derived model
will then correspond to the behavior of the base model.
Unsafe method The derived role may redefine one or more methods, causing the
override possible derived model to behave differently from the base model. In principle,
the derived method can do anything. It can for example send any
message on any port regardless of where that message was
originally defined. This leads to unsafe synthesis, where our
understanding of the base model behavior does not help us
understand the behavior of the derived model.
Chapter 5
Bridge to implementation
This chapter has been written for computer programmers. It tells you
how to create an implementation with the functionality specified in
one or more role models.
Introduction to implementation
Object modeling from a programmer's point of view
A simple class inheritance example
Why we need high level descriptions
The relationship between a role model and its implementation
Implementing the roles
Implementing the ports and interfaces
Implementing the methods and actions
The implementation process
Choice of programming language
In a nutshell
We have earlier stressed the value of divide and conquer. Objects
play many roles and our descriptions are materially simplified when
we focus on one function at the time. We now get to the stage where
we have created the role models and want to combine them in an
implementation. This is also the time for filling in the details. In the
role models, we reason about overall functionality. We are now
allowed to focus on one class at the time and get its details right.
System
user
model
System
requirements
model
System
design
model
System
implementation
Figure 5.1 Typical (programs)
models on different
levels of abstraction
Transition between The art of computer programming is outside the scope of this book.
design and Our interest focuses on the transition between the abstract design
implementation descriptions and the implementation, with special emphasis on how
we can maintain the consistency between the different levels of
description as illustrated in figure 4.1.
Simple solution to A simple problem can be solved with simple means. If we want to
simple problem build a birdhouse, we take a few pieces of wood and nail them
together. If we need to count how many times differen characters
occur in a text file, we write a simple program to do the counting.
Horizontal The main difficulty with hierarchical decomposition is that there are
decomposition splits so many problems that are not amenable to it. On the human level,
complex problem we have studied an object pattern that describes the handling of
into several simpler travel expense accounts. Other models would be needed to describe
ones the myriad of other functions in an enterprise. A few examples are
design, production, budgeting, accounting, and materials
management.
One program -- The OOram program design philosophy follows similar lines. We
many models create different role models for important aspects of the problem. The
program objects play multiple roles from these models, and we fill in
role model dependencies and other details in the program
implementation.
Bridge from role In the remainder of this chapter, we will discuss how to create a
model to program that satisfies the specifications in one or more role models.
implementation But first a few words about object oriented programming and the
reasons for creating higher level models.
Procedure In figure 4.3, the Client must carefully match operations and data.
orientation means The programmer can do this by importing the type definitions into her
that the client must program.
know the types of its
data
import Type A
data
operations
data
Client
data
data
Object orientation In figure 4.4, each data storage area is augmented with a pointer to
means that the data the data type. Different data can therefore react differently to the
know their type same operation according to the information stored in the data type.
Type A
data
operations
data
Client
data
data
Procedure oriented As an example, we will show how we can write a program to draw the
program for drawing simple house facade shown in figure 4.5. We will outline programs in
a house facade the procedure oriented language FORTRAN and in the object-
oriented languages C++ and Smalltalk. If your expertise is in some
other language, you may benefit from the advice that we were given
at a seminar by Gerald Weinberg. we found it hard to read programs
in an unfamiliar language because we unconsciously focused on the
parts we did not understand. Weinberg's advice was that we
consciously should ignore the unfamiliar parts and focus on the parts
we understood. This made the going much easier.
class Figure {
public:
virtual ~Figure() {};
virtual void draw() const = 0;
protected:
Figure(const Point& topLeft, const Point& bottomRight);
private:
Figure(const Figure&); // Avoid copy
Figure& operator=(const Figure&); // Avoid assignment
Point topLeftPoint;
Point bottomRightPoint;
};
Figure::Figure(const Point& topLeft, const Point& bottomRight) :
topLeftPoint(topLeft),
bottomRightPoint(bottomRight)
{}
class Wall : public Figure {
public:
Wall(const Point& topLeft, const Point& bottomRight);
virtual void draw() const;
};
Wall::Wall(const Point& topLeft, const Point& bottomRight) :
Figure(topLeft, bottomRight)
{}
void Wall::draw() const
{
...
}
class Window : public Figure {
public:
Window(const Point& topLeft, const Point& bottomRight);
virtual void draw() const;
};
Window::Window(const Point& topLeft, const Point& bottomRight) :
Figure(topLeft, bottomRight)
{}
void Window::draw() const
{
...
}
class Door : public Figure {
public:
Door(const Point& topLeft, const Point& bottomRight);
virtual void draw() const;
};
Door::Door(const Point& topLeft, const Point& bottomRight) :
Figure(topLeft, bottomRight)
{}
void Door::draw() const
{
...
}
class Facade {
public:
Facade() {}
void draw();
void add(Figure* f);
private:
List<Figure*> list;
};
void Facade::add(Figure* f)
{ [Link](f); }
void Facade::draw()
{
for(ListIter<Figure*> it(list); [Link](); [Link]())
[Link]()->draw();
}
The object specification defines the attributes, the class defines the
instance variables as the designer's choice of internal
representation. Some instance variables contain pointers to the
object's collaborators; other instance variables represent its
attributes. The class also defines a method for each message that
the object must understand. The method is the code describing the
actions to be taken by the object when it receives the corresponding
message.
Example: Modeling a As an example, we will define a class for objects representing points
point in a two-dimensional coordinate system. The point object should
know its coordinates in both the Cartesian and the polar coordinate
systems, so we give it four attributes: x, y, radius (R), and angle (T
for theta). We define messages to set and read these attributes:
The Point class We first define Point as an abstract class, which is a class that
should not be instantiated:
class Point {
public:
virtual ~Point() {};
protected:
Point() {}; // Abstract class
private:
Point(const Point&); // Avoid copy
Point& operator=(const Point&); // Avoid assignment
};
The PolarPoint class We define the class PolarPoint in a similar way. All methods involving
polar coordinates are now simple, while the methods involving
Cartesian coordinates are more complex:
^t cos * r.
getY
^t sin * r.
setR: rVal setAngle: angVal
r := rVal.
t := angVal.
getR
^r.
getAng
^t.
The power of object- These simple examples illustrate some of the illustrious points about
oriented object-oriented programming:
programming
A program is defined Why should we ever want to create higher level models of an object-
by its executable oriented program? The binary executable code is the only
code representation that gives a precise definition of what the program will
actually do under all possible circumstances. The source code
contains the equivalent information -- assuming that the compilers,
and loaders do what we expect them to do. But we have also added
embellishments that have no effect on program execution:
Comments are added and program entities are given names that
convey meaning to a human reader, but that have no effect on
program execution. Most of us still prefer to study the program in its
source code form, even if we are occasionally mislead by improper
comments and entity names.
Office procedures are very similar: the office procedures are defined
by the procedure texts and there are no high level descriptions. We
will later show that higher level, object-oriented descriptions of office
procedures give important benefits, but we will now restrict our
arguments to computer programs.
The binary While we try to create a program structure which clearly separates
executable code different concerns into distinct classes and methods, we still end up
mixes all system with having to satisfy several requirements in the same unit. Consider
functions a method that changes the state of a persistent object. The primary
function of this method is to change the state. In addition, it must
raise an exception if the specified change is inappropriate. It must
update all dependent objects such as visual presentations on the
screen. It must ensure that the new state of the object is reflected in
its persistent form (e.g., on disk). If the state change is part of a
transaction that is canceled, it may have to undo it.
Why high level Why should we ever want to create high level models of an object-
models? oriented program? If the code is simple and readable, we need
nothing else. In practice, the program code is not as simple and
readable as we could wish, and we have four excellent reasons for
wanting to create higher level models:
Simple models are All four considerations have proven to be important in our practical
easy to change work. Making changes to an isolated role model is trivial, as is
making changes to the details of an isolated method. But due to the
ripple effect, changing a role model which depends on other role
models is harder. In general we can say that the work involved in
making a change depends on the number and nature of its
dependent parts, be they state diagrams, method definitions or
dependent models. Large systems need another abstraction layer to
keep things simple. We advocate a clear, modular architecture for
this purpose, and keep low level modules stable while the high level
modules are being developed. (FOOTNOTE: We will describe
OOram modules in chapter 6.5)
Simple models may Our experience has also provided counter-examples to these
hide ugly details observations. Simple role models are excellent for providing the
answers to critical questions, but we may fail to find the most critical
questions. Our understanding of the issues may be incomplete,
problems we deem to be important evaporate under close scrutiny,
and problems we believed to be trivial turn out to be real mind
boggles. We therefore need to go the whole way and describe the
solution as a program before we can be sure that our original
questions were the right ones. In the normal life cycle with a design
stage separated from an implementation stage, deficiencies in the
design which are discovered during implementation cause costly
rework.
We only permit In figure 4.6, the top line symbolizes all programs that a given
systems we computer may perform. These programs are generated by
understand systematically loading the computer's memory with each possible bit
pattern, and then, in turn, ask the computer to start executing from
each possible starting point. The number of different programs that
can be executed by our own personal computer is on the order of 10
raised to the power of many million, a truly staggering figure. Most of
these programs will come to an abrupt halt; some of them will never
terminate. To the computer, they are all legal programs. What most
of them have in common is that they do nothing that we, as humans,
regard as useful or even meaningful.
The middle line in the figure illustrates the almost infinitesimal subset
of these programs that do something that we find meaningful.
Jackson's insight was that even these programs are not acceptable,
because the functioning of most of them will be outside the grasp of
the human mind. Jackson's thesis was that of all the meaningful
programs, we should limit ourselves to the small portion of them that
we can understand. This is illustrated as the bottom line of the figure.
Jackson: "For any given problem, there is one and only one correct
solution. The tragedy of computing is that there are so many other
solutions which also work."
Simplicity is a goal Our first line of defense is to create programs that are within the
grasp of the human mind; programs that are "so simple that there are
obviously no deficiencies". We believe that such programs should be
our ideal. No other representation can beat the simple program text
for precision, clarity and completeness.
The need for high level representations arise when the problem is too
In a nutshell
The OOram role model describes the static and dynamic properties
of a pattern of collaborating objects. The program classes specify the
exact static and dynamic properties of their instances. Both
descriptions define the objects, and there is a clear relationship
between them. We will see that it is easy to transform the information
in the role model into corresponding information in the classes.
Any role model can An OOram role model can be promoted to an object specification
be implemented model, where the roles are promoted to object specifications. The
object specification roles are shown in heavy outline as illustrated in
figure 4.7. A virtual role has to be resolved into concrete roles before
being promoted, since a virtual role represents a cluster of objects
rather than a single object.
OOram concepts Role models specify the static and dynamic properties of object
mapped on to the patterns, and thus object-oriented programs. The concepts of the role
programming models map on to the concepts of the programming language. We
language indicated possible mappings in the Main Ideas, and repeat it in table
4.1 for your convenience. The map is meant to help a programmer
understand the OOram terms; but the terms are not equivalent since
the OOram method focuses on roles and a programming language
focuses on classes.
Send/receive Send/receive
Figure 5.8 File Client
rsp dst
Server
send/receive object
specification model
Many classes may We may choose to program different classes that implement the
implement the same same object specification. The classes may have different
role space/speed tradeoffs, or different functionality, even if their
instances play the same role in the current role model. An example is
that we could implement a dummy class for the Client role which can
later be replaced by a selection of different product implementations
for simple and sophisticated end user file manipulation systems.
A class may We want to stress that the OOram method does not insist that we
implement many create a complete set of derived models and object specifications.
roles On the contrary, the OOram method specifies that we only create the
models needed for our understanding of the system, and that models
and source code together constitute the system documentation.
Most well-defined models should be sufficiently independent to
render a formal synthesis operation superfluous. The implementor
implements the classes directly from the several base models so that
the class instances will play all the required roles.
Another example is the two base models for the FTP file transfer.
These models can be promoted to object specifications as shown in
figure 4.9, leaving it to the implementor to make his two classes play
the roles of (Client, Source, Destination) and (Server, Source,
Destination) respectively.
specification models
specifying the FTP file
transfer service
We name classes Our naming convention is that role names are alphabetic, and
with numeric suffix classes are given the names of the primary role followed by a
numeric suffix. The class for the Client role could be named Client1,
and the class for the Server role could be Server1. We thus follow the
naming conventions for classes in our programming language when
we name our roles.
The object specifications of figure 4.8 and 4.9 both lead to the
following class definitions:
// Class: SendReceiveClient1
class SendReceiveServer1;
class SendReceiveClient1 {
public:
SendReceiveClient1();
~SendReceiveClient1();
private:
SendReceiveClient1(const SendReceiveClient1&); // Avoid copy
SendReceiveClient1& operator = (const SendReceiveClient1&); // Avoid
assignment
SendReceiveServer1* server;
}; // end of SendReceiveClient1
// Class: SendReceiveServer1
class SendReceiveServer1 {
public:
SendReceiveServer1();
~SendReceiveServer1();
private:
SendReceiveServer1(const SendReceiveServer1&); // Avoid copy
SendReceiveServer1& operator=(const SendReceiveServer1&); // Avoid
assignment
SendReceiveClient1* client;
}; // end of SendReceiveServer1
Similarly in Smalltalk:
Synthesis can be A class may be derived from a base class, and a group of classes
mapped on to class may be derived from a group of base classes.
inheritance
An object specification model can be derived from a base object
specification model. This is an open invitation to let the derived
classes be derived from the corresponding base classes. We could,
for example, define base classes for the Client and Server roles and
augment them with send/receive functionality in the subclasses. In
Smalltalk:
// Class: Client2
class Client2 {
public:
Client2();
~Client2();
private:
Client2(const Client2&); // Avoid copy
Client2& operator=(const Client2&); // Avoid assignment
}; // end of Client2
// Class: Source2
class Source2 {
public:
Source2();
~Source2();
private:
Source2(const Source2&); // Avoid copy
Source2& operator=(const Source2&); // Avoid assignment
}; // end of Source2
// Class: Destination
class Destination {
public:
Destination();
~Destination();
private:
Inheritance
A port describes a A Port is an abstraction of a variable. The default is to map the port to
variable an instance variable, but it may be mapped into any kind of variable.
In Smalltalk, it could be a global, instance, class, or temporary
variable; in C++ it could be private or public.
The default name of the variable is the name of the port. We usually
follow the naming conventions for variables in our programming
language when we name our ports.
Such program details are immaterial for the role models at the
analysis level. They can be described in design level role models or
they can be left to the discretion of the implementor.
The role model The important principle is that while a role model may give a
should never lie simplified view of the program, it should be given a true
representation of the collaboration structure in the context of its area
of concern. There must be a port for every message sent, you cannot
say that a particular port is unimportant because it only lasts for a few
microseconds. We either need it, and then it should be shown. Or we
do not need it, and then we should not send messages along it.
OOram controls the An OOram interface is a named collection of messages that may be
messages sent sent from one role to another. The popular programming languages
such as Smalltalk and C++ define all messages that are to be
understood by the instances of a class; they do not check that the
messages originate from an authorized sender. The reason for the
mismatch is that we in OOram focus on patterns of collaborating
objects, while the popular languages focus on the capabilities of
individual classes.
BFromAIntf
void messAB1 ()
void messAB2 ()
Checking It would be nice if the compiler could check that our implementation
implementation actually conforms to the object specification.
conformance
In Smalltalk, we can implement the named interfaces as Smalltalk
protocols. A Smalltalk compiler does not enforce the OOram
specifications since it does not support static type checking. The type
system of statically typed languages does not readily support our
notion of giving different message privileges to different collaborators,
see box. Neither Smalltalk nor C++ guarantee that a value has been
assigned to a variable before it is used. (Some Smalltalk compilers
do a partial check.)
The first level is an integral part of the message interface view, and
the remaining levels are seen in the Method specification view
described in section 2.5.2 on page 102?? Figure 2.38 on page 104??
is an example of a method specified as pseudocode.
In a nutshell
The yo-yo approach to computer programming is an opportunistic,
risk-reducing strategy. As usual, we do not believe in snake oil, and
recommend that you develop your own implementation process that
is uniquely adapted to you own requirements.
Your implementation Like all other work processes, you will have to tailor your
processes must be implementation processes to your specific applications and your own
tailored to your work situation. Your previous experience with systems development
needs in general and object-oriented development in particular, is of crucial
importance, as are the facilities available to you and the kinds of
systems you want to develop. This section may give you a useful
starting point if you are relatively new to object orientation.
OOram supports The OOram perspectives and views are designed to support a wide
many different work variety of work processes and implementation styles. The large
processes variety of perspectives and views support many different
abstractions, and the freedom to choose the detailed syntax and
message semantics support different programming styles.
Top-down approach The idea of top-down development was introduced in the sixties.
powerful, but the [Oxford 86] gives the following description: "An approach to program
devil may be in the development in which progress is made by defining required
details elements in terms of more basic elements,..." The trouble with the
top-down approach is that the devil is often found in the details: the
early assumptions prove to be inadequate and the top-level design
has to be modified.
We find the same problems when we teach object orientation and the
OOram method to programmers. It is hard to relate to abstract
concepts, and the only way to make them real is to actually write
The principle of Our current approach is what we call the yo-yo approach, which is a
minimizing risk combination of the top-down and bottom-up approaches according to
the principle of minimizing risk. We identify the part of the problem
that we consider will be the hardest to get right, and experiment with
possible solutions. When we feel that we have mastered this part, we
identify the next part which we consider will be the hardest, and so
on. This principle of minimizing risk corresponds in many ways to the
principles advocated in [Boehm 88], where you will find many more
details.
Identify critical The nature of the critical part will vary from case to case. We may not
uncertainty know which functionality the users will actually need. It is then a good
idea to start with the user interfaces, and support them with dummy
data representations. The users get hands-on experience with the
proposed system at a very early stage and can provide valuable
feedback.
Cross the The yo-yo approach implies that we want to be able to cross a bridge
implementation between OOram models and implementation in both directions: we
bridge in both may have created a design and want to implement it, or we may have
directions created a prototype implementation and want to extract the design
information from it. Good processes with their associated tools
should support both directions.
Keep an eye on the We are programmers at heart, and we rarely find that we fail to notice
total problem! woolly details. The danger is rather that we keep too narrow a scope
for our work. We guard against system integration problems by
creating the top level program as early as possible -- inserting
dummy methods for the details. We then fill in programs for the
critical parts as they are created. In this way, we have an operational
program from a very early stage which we keep improving until it is
ready for delivery. Whenever possible, end users are involved in the
prototype testing, so that they can get maximal influence on the final
product.
Beware of mental We are constantly trying to be conscious of our own mental blocks.
blocks! We may, for example, work on the high level aspects of a distributed
system, and find that our thoughts keep wandering off to the problem
of program-to-program communication. We then digress and work
with a small distributed program until we have removed the block.
Once the problem is cleared, we can continue the high level
considerations and base them on a solid foundation.
Identify essential There is one caveat to the principle of minimizing risk: Most
functionality! development projects have a deadline on time and resources. It is
indeed a sad situation if essential functionality is still missing when
the ax falls and the project has to be terminated.
Beware of escalating There are great benefits to be gained if we manage to stimulate the
specifications! creativity of the users and everybody else around us: it improves the
final product and its acceptance; it is stimulating; and it is great fun.
But beware of escalating specifications! Some functionality may have
to be postponed to a later project, or the scope of the current project
may have to be expanded to take the users' increased appetite into
account.
Postpone program As a general rule, we do not cross bridges until we get to them. We
optimization! try to make the system architecture expandable, and we regard the
users' expressed requirements as examples rather than the whole
story. But we keep the code consistent with the architecture and as
simple as possible. We do not complicate it to provide hooks for
extensions. The following guidelines are inspired by the excellent
book by Kernighan and Plauger [KerPla 74] on programming style,
which should be required reading for all programmers. The guidelines
not only apply to programming, but to all levels of analysis and
design:
1. Make it right. Our first concern is to create a program that reflects the
user requirements.
2. Make it clear. Our second concern is to make the program simple -- "so
simple that there are obviously no deficiencies". The first program
versions are often dirty: The division of responsibility between the
objects is not optimal; the same logic is repeated in several locations
and can be replaced by a single occurrence in the right location. We
use reverse engineering to extract the design from a running program.
We then clean up the design before re-implementing a cleaner version
of the program.
3. Make it fail-safe. The encapsulation property makes it fairly easy to
protect objects from all kinds of abuse from their collaborators. If we
take this principle too far, we end up with schizophrenic objects that
spend most of their time checking each other. It is a good idea to draw
boundaries around groups of objects; we call them fire walls. We
carefully check all messages passing a boundary and trust all
messages flowing within it. The role model is a convenient unit for fire
wall protection. All stimulus messages are treated with suspicion, while
all internal interactions are assumed to be in order.
4. Instrument the programs. Measure before making "efficiency" changes.
There is no point in optimizing code that has but a small contribution to
the overall running time of the program. We find that our intuition about
where the program spends its time is unreliable. We postpone making
efficiency changes until the program execution time proves to be a
problem, and then only after careful and detailed performance
measurements. (This applies to code details. It is usually more
important to design an efficient architecture than to optimize the code.)
The iterative To sum up, the development process can start with a prototype
development implementation or with an abstract analysis. In either case, the
process process is iterative, moving between the abstract and the concrete
until the system is complete (or until the available time and budget
have been exhausted.)
Start here
OOram role modeling
for formal analysis and design
Forward engineering
Reverse engineering
OOram Object Specification
Forward engineering
Implementation
(1) Make it right Start here
(2) Make it clear for quick early results
(3) Make it fast
Prototyping,
Exploratory programming
Exploratory Notice the bottom loop in the above process. Modern programming
programming is environments with source code browsers and incremental
powerful compilation makes exploratory programming really attractive,
because we can express our ideas directly in programming language
and test them immediately. Exploratory programming is particularly
powerful for the Make it right-phase. In one session where we
monitored our work, we created a first prototype in just under three
hours. The measured average cycle time (think-edit-compile-test)
was 2.5 minutes.
Create your own We do not expect that this process is quite right for you, but it may
process! give you ideas that could be useful when you create your own
process. You will also want to add further steps for product
implementation, testing, installation and maintenance. Do not expect
your first process to be the ideal one, but observe how you actually
work and improve the process description as you gain experience.
Exploratory Back in 1980, our group at the SINTEF-SI research institute had
programming may logged twenty years of FORTRAN software product development and
play havoc with considered itself pretty professional. We followed a waterfall life cycle
software reliability model and used techniques such as careful design and peer reviews
to produce reliable code. We believed, as we still believe, in Dijkstra's
dictum that the only way to produce software without errors is to
avoid introducing them in the first place; the number of errors
remaining in the programs is likely to be proportional to the number of
errors found and removed during testing. In one monitored case we
did in 1976, we found no errors in two out of three subroutines during
unit testing, and no errors at all during system testing. (It was a 2,000
line preprocessor for object based FORTRAN programming.)
Development of real Our message to users and management is that a nice looking
software takes real prototype or demonstration program can be created in no time, but it
time takes real time to create a real program. An early prototype looks
good to users and management, and it is sometimes hard to
persuade them that the main part of the work remains to be done.
We are still searching for software metrics which can make this main
part visible, so that it will be properly appreciated by managers and
clients. (This section is written for programmers, but you may want to
show this paragraph to your manager!)
Egoless teamwork Our view on the ideal system development team has been strongly
influenced by Gerald Weinberg's epoch-making book on The
Psychology of Computer Programming [Weinb 71]. The success or
failure of a team member is closely linked to the success or failure of
the team: we all succeed or we all fail. Ruth cannot claim that the
project's failure was caused by Stupid Sam; she should have
discovered the difficulties and taken corrective action in time. Open
communication channels, mutual respect and acceptance of
individual strengths and weaknesses are essential properties of a
good team.
Process depends on We tend to get suspicious when we meet someone who has the
problem ultimate work process that will work with all kinds of people for all
kinds of problems. We find that our optimal work process depends on
the kind of problem we are going to solve, its position on a
sophistication scale from routine to research, the availability of
reusable components which are applicable to the problem, the time
available, the number and qualifications of people we are going to
work with, and a host of other factors. To us, industrial production of
software implies that all these factors are kept reasonably fixed to
permit the evolution of an optimal work process.
In a nutshell
There is no perfect programming language that is ideal for all
purposes. Yet many programmers feel very strongly about their
language and are personally affronted if somebody dare propose that
another language could be superior for some purpose.
Different Role models are used to model a wide range of phenomena both
implementation within computers and in the world around them. The appropriate
technologies for implementation technologies will depend on the nature of the
different phenomena phenomenon and the purpose of the implementation. The processes
used to create the human objects of a travel expense model are very
different from the processes used to create the computer-based
objects of an file transfer program. Even if we confine ourselves to
the creation of computer-based systems, the ideal implementation
process will depend on the problem and the selected programming
language.
We focus on In the real world, we have to use one of the standard programming
Smalltalk and C++ languages that have been developed without regard to any specific
modeling technology. The final choice of programming language may
be based on technical considerations; on total life-cycle costs; on
strategic considerations such as training requirements; or even on
apparent popularity.
The hard part of There are many C programmers in the world, and many people
learning object believe that it is easier for a C programmer to make the transition to
orientation is to object-oriented thinking through C++ than through Smalltalk. We
internalize the believe this to be a fallacy. The very similarities between C and C++
mental model, not to can make the essential paradigm shift harder because the
learn the language programmer is permitted to continue thinking along the old track. We
syntax believe that it is much better to make a clean break and create the
first object-oriented implementations in a pure object-oriented
language such as Smalltalk, even if the final products are to be
written in a hybrid language such as C++.
Static and dynamic C++ is a statically typed language. Variables are typed on the class
typing of the permissible objects, and the compiler ensures that the object
receiving a message will also have a method which can handle it.
The programmer can override this discipline with type casting, and
can then specify messages which cause catastrophic termination of
the program.
Typing system We have no doubt about the benefits of a typing system. It prevents a
beneficial certain class of runtime errors and enforces a precise documentation
of the variables. We are more doubtful about the wisdom of typing a
variable on the implementation (class) of the objects to which it
refers, because the implementation descriptions include all details
about the internal construction of the object. Typing on
implementation thus breaks the object encapsulation, and we lose
the valuable flexibility and generality that enable us to create objects
with identical external characteristics, but with different
implementations.
Abstract classes are While it is possible to use the notions of abstract or virtual classes to
artificial fake a type system in the statically typed languages, we would prefer
a language with an explicit type system that supported the OOram
notion of roles, collaborations, and interface definitions.
Garbage collection Some languages such as Smalltalk, Eiffel and Objective C have
automatic garbage collection. This means that objects are retained in
memory as long as they are reachable from the root of the object
structure. When the object is no longer reachable, its memory space
is automatically released and can be reused by other objects.
Do not violate the All complete programming languages are in some sense equivalent,
intentions of your and any computation may somehow be realized in any language.
programming Languages differ in how directly the programmer's ideas may be
language expressed. It has been said that a real programmer can write
FORTRAN in any language. Bjarne Stroustrup, the inventor of the
C++ language once said "C++ is not a very good Smalltalk; it was not
meant to be. Similarly, Smalltalk is not a very good C++; it was not
meant to be."
This means that if we use C++, we should adapt to the C++ way of
thinking. Similarly, if we use Smalltalk, we should adapt to the
Smalltalk way of thinking. One of the goals of the OOram method has
been to make its notions adaptable to the different programming
styles supported by the different programming languages, but its
actual use should be colored by the philosophy of the target
programming language.
Smalltalk higher Smalltalk is a higher level language than C++. A number of data
level than C++ representation and memory management issues have been
automated and made invisible to the programmer. This, combined
with its English-like syntax and uniform use of objects, has
empowered us to create user interfaces, system architectures, and
reusable programs which would otherwise have been outside our
intellectual grasp.
C more efficient than There is no such thing as a free lunch. Smalltalk has acquired a
Smalltalk reputation for being inefficient. There are several reasons for this
reputation. One is that Smalltalk pioneered sophisticated user
interfaces which consume vast amounts of computer power. Such
programs were bound to lose when they were compared to C
programs implementing traditional command-line interfaces.
Our arguments give C++ an edge for heavily used, stable systems.
Smalltalk is the preferred language for customized and adaptive
software installed in relatively small numbers. Smalltalk is also the
preferred language for custom-made software; as well as the
language of choice for the rapid creation of executable specifications
and for prototyping.
Chapter 6
Creating reusable components
This chapter is primarily written for suppliers of reusable components,
but will also help discerning consumers become better buyers. You
will find that object-oriented technology offers many opportunities for
reuse, and that some of them are more demanding as to maturity and
product stability than others. You will also find that reuse is no silver
bullet. There is a great potential, but your benefits are closely related
to your investment in care, competence, time, money, and
dedication.
In a nutshell
Reuse is hard, but well worth while because it enables us to create
big systems in small projects. Reusable components are products
created by a producer and applied by a number of consumers. The
success criterion for a reusable component is that it is actually being
used. The key to success is the effective communication between
producer and consumer.
Evolution easier than Large projects are notoriously hard to get right. They are difficult to
revolution plan and control; they are expensive in time and resources; and we
all know numerous disaster stories. In contrast, small projects are
simple to plan and control; are usually successful; and the possible
failures are cheap and easy to rectify.
But how can small projects produce big results? An important answer
is reuse. If 99% of the solution can be created from proven
components, a 100-month programming activity can be reduced to
just 1 month.
Many kinds of All successful business operations rely heavily on reuse. Our first
reusable things reaction when asked to solve a problem or produce a result is to
search our accumulated experience for applicable solutions. If we
need to produce a project proposal, we start from an old proposal for
a similar project. If we need to produce a new piece of code, we
search for proven solutions to similar problems. We all rely heavily on
such incidental reuse as a matter of course. Its benefits are
undisputable and its arch enemy is the Not Invented Here (NIH)
syndrome.
Planned reuse Business people do not like the arbitrariness of incidental reuse.
They want to formalize their experience and package it in such a way
that it can be reused reliably and consistently. They create business
procedures which describe proven ways of performing critical
operations; they standardize tools and techniques which will help
them reach their goals; they establish libraries of proven ideas,
models and program components. Experience may even be
embodied in a computer program: a project proposal can be
generated automatically from parameters provided by the user.
System
user
model
Library
of
System reusable components
requirements
model
System
design
model
System
implementation
System
of objects
Figure 6.1 There may
be reusable
components on all
levels of modeling
Reuse technologies Figure 5.1 illustrates that we can employ reusable components on all
applicable on all levels of abstraction; ranging from the System user model to the
levels System of objects running in a computer. Reusable components can
materially reduce the required effort on all levels, and it may even be
possible to avoid the design and implementation stages altogether.
Application
family
generation 2
Applying assets
Reusable
component
generation
Building assets
Application
family
generation 1
Applying assets
Reusable
component
generation
Building assets
Application
family
Figure 6.2 Alternate generation 0
use of applications and
improvement of
reusables
The success I have lost count of all the wonderful reusable components I have
criterion for a created over the years that either have been lost or reside quietly in
reusable component some out of the way library. Measured as entertainment, their
is that it is actually development was great fun. Measured as business propositions, their
being used! development was a dead loss because we have not recovered their
cost through their use.
This experience is bad news for the manager who is tired of being
dependent on his professional staff and who wants to formalize its
knowledge and competence so as to make software production into a
mechanical operation which can be performed by obedient slaves. It
is good news for the professional who likes to view himself as being
indispensable -- he is.
Formal methods can Formal methods cannot replace humans, but this does not mean that
support people, not they cannot be helpful. The reuse technologies we present in the
replace them following chapters are all useful for creating concrete representations
of ways to do things so that they can be reused by others. But I
would like to state loudly and clearly that we cannot replace human
cooperation, creativity and competence; only augment and help the
competent become more effective.
People build I believe the little stories in the boxes hold the key to why some
successful software reusable components are successful where other components fail. I
am a programmer at heart, and tend to act as if the creation of a
good reusable component is the hard part. It isn't. The hard part is to
create a component that people not only need, but that they will
actually want to use. The successful component is in harmony with
its consumers, their goals, working habits and competence.
Active and passive Linguists distinguish between a person's active and passive
competence vocabulary. My active vocabulary consists of the words I use. My
passive vocabulary consists of the words I understand when other
people use them, even if I do not use them myself. I believe it is
fruitful to similarly distinguish between a person's active and passive
competence. My active competence consists of all the things I know
how to do. My passive competence consists of all the things I
understand when I see other people' do them; even if I could not
easily do them myself.
Three layer We suggest that the following three layers may be useful: List of
documentation Instructions, Logical map, and Implementation description. We will
discuss them briefly below.
List of Instructions A List of Instructions tells the consumer the essence for applying
the component. It is like the road directions "Go South on 280 until
you hit the Page Mill Road exit. Turn left. Turn right at the first traffic
light, then first left. It is the first building on your left after the first
crossroads." These directions are great if they are right, if the
consumer has the expected background knowledge, if she wants to
go from somewhere up north, if she wants to go to the designated
destination, and if she doesn't try to be smart. But the consequences
could be catastrophic if she tries a slight variation, since she could
easily get hopelessly lost.
The List of Instructions should be sufficient for the consumer who has
the active competence to apply it. It is intended to jolt her memory,
not to teach new skills. Her passive competence should include a
logical map that gives context to the work and protect against
component misuse.
Specify constraints When the supplier gives the consumer freedom to reuse the
component in many different ways, there is a danger that the
consumer will use it incorrectly. The reusable component should
include a description of constraints, which may be either compulsory
or just warnings about possible dangers. It is preferable if the
constraints can be enforced by automatic tools, otherwise check lists
should be provided to help the consumer use the component
correctly. (FOOTNOTE: Quality assurance procedures based on the
ISO9000 standard [ISO9000] are heavy users of check lists. The lists
are filled in and signed by the developers and archived for future
reference.)
Logical map A Logical map is a high level description of the component and its
structure. It is like a road map which gives sufficient information to
enable an automobile driver to get her bearings, but where a great
deal of information is suppressed because it is considered irrelevant
or not timely.
The consumer will study the logical map if it isn't already part of her
passive competence. She will have to study it more carefully if she
needs to specialize the component. Her active competence will
include the logical map, and her passive competence will include the
implementation description so that she can specialize the component
in ways that were intended by its creators.
The OOram reuse Object-oriented technology has two properties which makes it
technologies especially suitable for creating reusable components: inheritance and
encapsulation. We exploit these properties in five distinct and
independent OOram technologies for component reuse:
6.2 Patterns
In a nutshell
How we describe object modeling know-how in terms of a pattern
language, and how this idea helps us build our concrete solutions on
the best available practices. A pattern is a fixed-format description of
how to solve a certain class of problems. A pattern language is a
collection of patterns. A concrete problem is solved by decomposing
it into subproblems and applying an appropriate pattern to solving
each of them. Pattern languages can be made for many different
disciplines, they originated for the purpose of capturing "the quality
without a name" in architecture. We apply patterns to capture and
document the essence of good object modeling practices.
Divide and conquer When we create object models of phenomena of interest to us, we
frequently find it useful to factor out general features and create more
abstract base models. This gives us the opportunity to partition the
solution into general and special models, and helps us understand
the phenomena on different levels of abstraction. (FOOTNOTE: We
discussed the technology of model separation and composition in
chapter 3: Role model synthesis.)
Package valuable Some role models capture the essence of a solution to a general
solutions class of problems. Such models may be applicable to a broad range
of specializations, and can profitably be packaged and added to the
reusable assets of the enterprise. An OOram pattern is a fixed-
format package consisting of a role model together with
documentation describing when and how it should be used. The
documentation can also specify constraints that ensure the correct
functioning of a concrete application.
Pattern
System
user
model
System
requirements
model
System
design
model
System
Figure 6.3 Patterns implementation
can be applied at all
levels of modeling
Patterns tell you how The object community uses the term pattern in two senses. Some
to solve problems people use it to denote a specific object pattern: "When several
classes cooperate closely on a given task, we say the classes form a
mechanism or pattern, with each pattern representing a dependency
cluster." [Soukup 94]. We use it in a more abstract sense, as a
description of how the reader can solve a problem. This use of the
term pattern originated with the architect Christopher Alexander, who
said that "Each pattern describes a problem which occurs over and
over again in our environment, and then describes the core of the
solution to that problem, in such a way that you can use this solution
a million times over, without doing it the same way twice." [Alexander
77]
Alexander's Pattern There are many similarities between the work done by an architect
Language to capture and the work done by a system designer, and we may have
"quality without a something to learn from the ways architects have attempted to solve
name" the communication problem.
Alexander's Alexander's books that form the inspiration for the patterns
disappointment movement date back to 1977 and 1978, and Alexander has later tried
his theories in practice. He has been sadly disappointed. The "quality
without a name" has proven to be more elusive than expected, and
he now finds that the creative process is as important as the patterns.
We refer you to Gabriel's excellent columns in the Journal of Object-
Oriented Programming for more details. [Gabriel 94a] is a summary
of the good news, and [Gabriel 94b] summarizes the bad news.
Pattern languages I must admit I am quite pleased that Alexander's original vision did
very useful, but no not materialize. It makes me uneasy when scientists try to isolate the
panacea soul and dissect it. I trust they will never succeed, and I base this
trust on the systems theorem that the whole is more than the sum of
its parts. I believe the "quality without a name" is intimately
associated with the whole: analyze it to find its constituent parts, and
it's gone. The pleasing practical consequence is that it still takes
people of quality to create products of quality. But the parts are also
valueable, and emerging libraries of patterns will help quality people
create better systems.
How to do it You can create a new pattern by the following operations (not
necessarily performed in this sequence):
Implementation Our patterns are implemented as a role model together with the
appropriate documentation. The role model will be described in the
documentation, but should preferably also be stored in the reuse
library in electronic form to simplify its synthesis into derived models.
Project portfolio One of our clients is a large enterprise that organizes its major
management investments as projects. Our client was a branch of this enterprise
responsible for defining and managing such projects.
The problems of our client was one level above this: how to decide
on a project and define its scope; how to select a contractor; how to
negotiate and enter a contract; and how to maintain control so that
the contractor really does the job allocated to him. To complicate
matters, our client was supervising a large number of projects
simultaneously.
Our task was to help our client improve and formalize the work
procedures, and to create and install effective computer support for
these procedures.
Further, the client did not want to model the who part onto named
individuals or positions in the organization, but to roles that people
play. Role modeling was, therefore, a natural choice.
Divide and conquer The discussions in the group were not all smooth and to the point.
The initial discussions were particularly confused; the members of
the group had clearly different perceptions about what was the
essence of the problem. (Which is the main advantage of working
with a group rather than with an individual.)
A model for making The decision-making process was recognized as being a very
important decisions general one. It was decided to create a separate model for decision-
making; and to derive the portfolio control model from it.
Pattern applicable to This pattern is applicable in all situation where the enterprise is to
major decisions make a major decision. A major decision is defined as a decision
where premises and consequences have to be studied in the
organization prior to the decision is made by the proper authority.
Solution The basic collaboration diagram is shown in figure 5.5. This diagram
shows one level in a hierarchical organization, it can be used to
compose a model with any number of levels. The core of the solution
is to harness the efforts of as many organizational levels as required:
Superior
sub
chief
Decision
staf chief Staff
Maker
sub
chief
Decision
Superior Subordinate Staff
Maker
studyProposal
decomposeProposal
proposalSet
studyProposal
studyResult
composeCommentary
composedProposal
studyResult
issueOrder
issueOrder
Figure 6.6 Decision
Maker: Typical
Scenario
I, the DecisionMaker, receive a proposal from my superior; my staff studies
it and splits it into more detailed proposals for my subordinates. When I get
their response, my staff merges their results so that I can send a
consolidated proposal to my superior. The decision is made and is
communicated down the command chain. (We have omitted the details of
the required staff work from this pattern.).
Application example: This DecisionMaker pattern can be specialized to cater for making
An organization for many different kinds of decisions. As an example, we will sketch out
oil production four solutions to different kinds of decision problems in an oil
production operation. We applied the Decision Maker model twice
and renamed the roles to get the head office decision model shown
in figure 5.7. We applied it once and renamed the roles to get the
general model for local operational decisions in figure 5.8. Certain
decisions need the advice of experts; the model in figure 5.9 takes
care of that. Finally, important decisions can only be made by the
home office, figure 5.10 shows the decision structure.
President
sub
chief
Area Area
staf chief
Manager Staff
sub
chief
Section Section
staf chief
Manager Staff
sub
chief
Platform
Manager
sub
chief
Operations Operations
staf chief
Manager Staff
sub
chief
Figure 6.8
InstrumentMan
Organization for
decisions that can be
made locally on an oil
production platform
Platform
Manager
sub
chief
Operations Operations
staf chief
Manager Staff
sub
chief
President
sub
chief
Area Area
chief staf
Staff Manager
plat
sub
area
chief
Platform
Manager
Section Section
chief staf
Staff Manager sub
sub chief
chief
Operations Operations
staf chief
Manager Staff
Department
Manager sub
chief
A powerful tool for The synthesis view of figure 5.11 shows the synthesis relationships
simplifying and between these models. Their details do not concern us here. The
unifying procedures point is that patterns permit us to factor out common features and
create a structure of reusable base models. The large body of
possibly unrelated procedures becomes unified and consistent. We
try to push the stable parts of our procedures up towards the base
models, while the variable aspects are pushed down towards the
derived models. If we do it right, we get an organization where it is
easy to create new procedures and modify old ones, because the
complex parts of the procedures are in the stable models, while the
variable parts are in small and simple derivations.
Decision Maker
Specialist Organization
In a nutshell
This chapter is written for programmers, and you may safely skip it if
you are not interested in programming.
A framework is a Safe role model synthesis provides a nice and powerful way of
problem solution specifying and using reusable class structures. A framework is an
Object Specification model, which is created for the express purpose
of being generally reusable through synthesis; together with a
corresponding cluster of classes, which has been designed for
subclassing. The framework is a packaged product that solves a
specific problem; it includes instructions for when to use it and how to
use it safely.
System
user
model
OOram
System Framework
requirements
model
System
design
model
System
implementation
System
of objects
Figure 6.12 OOram
frameworks support
design and
implementation
Frameworks support Figure 5.12 illustrates that OOram frameworks provide the
design and application programmer with solutions for the design and
implementation implementation stages. System design is simplified because the
programmer can build on proven solutions by synthesizing the
appropriate role models into her design. System implementation is
simplified because the programmer can build her programs by
inheriting from the corresponding base classes.
Supplier's Consumer's
responsibility responsibility
isIn isIn
isImplementedBy isImplementedBy
implements implements
Figure 6.13 Semantic baseClass
Framework Derived
relationships between Class derivedClass Class
Framework concepts.
Improving We have learned the hard way that deriving our own software from
frameworks is a two- somebody else's framework is a two-edged sword. We have
edged sword achieved the expected gain in productivity and quality in our initial
development, but we have also experienced chaotic situations when
the framework provider improved the framework classes in new
releases. The surface area between the frameworks and our derived
classes was large and undefined, and it was very hard to determine
the consequences of framework changes.
Specify and reduce Brad Cox [Cox 87] defines the surface area of a component as all
surface area the things that must be understood and properly dealt with for one
component to function correctly in combination with another
component. Examples are class names; data names; message
names and parameter types; time sequence constraints; garbage
collection requirements; protection domains; and concurrency
considerations.
and carefully define the surface area between the framework and its
derivatives. The surface area of a good framework should be kept as
small as possible. The framework provider is obliged to keep the
surface unchanged, but is free to improve any of the hidden parts.
Similarly, the framework consumer can only modify designated,
visible parts of the framework. These are two of the main motivations
for our insistence that an OOram framework must be much more
than a collection of classes; it must include firm rules for its proper
use. The optimum solution depends on the circumstances and the
tools available: if the supplier can make it impossible to violate the
rules; or if there is an automatic rule checker; or if rule conformance
is a manual operation. The main thing is that the rules are clearly
expressed and that the consumer abides by them.
Further details in the Chapter 9 presents a case study that illustrates the creation of a
case study major framework.
Chapter 7
Additional role modeling concepts and notation
This chapter is intended as a reference chapter to be read on a "need
to know" basis. Its sections can be read in any sequence.
Some central role model views were presented in chapter 2.5, we will
here describe some additional ones:
1. The Semantic view describes the meaning we associate with the roles
and their relationships.
2. The Process view describes the flow of data between the roles and the
processing of the data in these roles.
3. The State Diagram view describes the legal states of a role and the
messages that trigger transition from one state to another.
4. The Role List view gives an overview of the roles, their names,
purpose, and attributes.
5. The OOram Module encapsulates a number of models and controls
high-level export and import of models.
Additional role modeling concepts and notation ©2001 The authors. Page 206
February 8, 2001 10:20 7.1 Semantic view
In a nutshell
The semantic view describes the meaning we associate with the
roles and their relationships. We rarely need the semantic view, since
the collaboration view usually contains sufficient information.
1. Entity. An entity represents the set of all instances of the same thing,
idea or concept that we want to think about. An important attribute of an
entity is a description of the meaning we attach to the entity instances.
Entities are commonly denoted with a rectangle in E-R diagrams.
2. Relation. The entities of a problem domain are somehow related to
each other. A relation is a representation of the meaning we attach to
the relationship between entities. A relation is bi-directional. It describes
what a first entity is in relation to a second, as well as what the second
is in relation to the first. A relation is commonly denoted with a line
connecting the entities. The line may be decorated with texts describing
the relationships. Four different kinds of relations are commonly
recognized:
¤ Aggregation. The two directions of the aggregation relation are
commonly called consists-of and part-of.
¤ Use relation. The two directions of the use relation are commonly
called uses and used-by.
¤ Subtype relation. The two directions of the subtype relation are
commonly called is-a and kind-of.
¤ Association. The two directions of the association are given names
to describe the nature of the relationship.
Additional role modeling concepts and notation ©2001 The authors. Page 207
February 8, 2001 10:20 7.1 Semantic view
Relation
Exactly one The symbols are drawn close to the source role.
They are annotated with a text describing the
Zero or one meaning of the relation in the direction of
Figure 7.1 Semantic One or more the arrowhead.
view notation
Zero or more
The semantic view The Semantic view is designed to capture the Entity-Relation kind of
describes the information for a system of interacting roles. We describe the
meaning of the roles concepts that the analyst associates with the roles and the relations
and their relations between them. The notation is shown in figure 6.1. Figure 6.2 is a
semantic view of the Purchasing model of chapter 2.3.2 on page
79??.
Additional role modeling concepts and notation ©2001 The authors. Page 208
February 8, 2001 10:20 7.1 Semantic view
is client of
Vendor
Bank cooperates w
Roles are like objects in that they have identity. If we should interpret
figure 6.3 as a semantic view, it would mean that the Enterprise and
the Vendor are both clients of the same Bank. Notice that figure 6.2
does not say they must be different; the same Bank object could play
both roles.
The E-R model is on a higher abstraction level than the role model,
and the E-R diagrams can be more compact than the corresponding
semantic views. We need the concrete aspects of the role model
because we want to reason about its behavior. In our example, we
want to be able to analyze the model to convince ourselves that the
Vendor who delivers the goods will also be the Vendor who receives
payment. We can make this kind of arguments on the role level, but
not on the type (or Entity) level. (FOOTNOTE: This problem is often
called the equivalence of path problem in the E-R community)
Collaboration view There is a strong correspondence between the semantic view and
and semantic view -- the collaboration view. The semantic view describes how we think
different meaning! about the concepts and their relationships. The collaboration view
shows how the objects collaborate in order to provide a faithful
representation of our thoughts. A Relation represents a conceptual
relationship, and a port represents the object's knowledge about one
or more collaborators. The diagrams will have similar topologies,
except that all relations need not be represented as message paths if
there are no messages flowing between the associated objects.
Further, the cardinalities of the ports may be more restricted than the
cardinalities of the relations, since an object may not need to know all
the associated objects at any given time.
Additional role modeling concepts and notation ©2001 The authors. Page 209
February 8, 2001 10:20 7.1 Semantic view
Structural The synthesis operation does not lead to semantic relations between
relationship between the base model and the derived model. The reason is that there is no
base and derived formal relationship between the meaning a human observer
semantic views associates with the roles and relations in a derived model and the
meaning he or she associates with the roles and relations of the base
models. It is the responsibility of the analyst to ensure that they are
semantically consistent.
No new notation The notation for the semantic view of the derived model is the same
as the general notation described above. Inheritance relations may
be added as shown in figure 3.31 on page 138??, but this is rarely of
interest.
Additional role modeling concepts and notation ©2001 The authors. Page 210
February 8, 2001 10:20 7.2 Process view
In a nutshell
A Process view describes the flow of data between roles and the
processing of these data in the roles. We find the process view
particularly useful for describing the flow of data and work procedures
in human organizations.
Constraints/Directions
Controls
Additional role modeling concepts and notation ©2001 The authors. Page 211
February 8, 2001 10:20 7.2 Process view
Mapping IDEF0 and The IDEF0 concepts can be mapped nicely onto the concepts of
OOram concepts OOram:
1. IDEF0 Mechanisms are the actors that perform actions. In our object
model, all actions are performed by an object. The actor must,
therefore, be an object. This is represented by a role in our model.
2. The IDEF0 Input constitutes the input data to the object. The only way
to carry data to an object is through a message, and the input data
must be carried as message parameters or return values. Several
inputs could be grouped as parameters to the same message, if they
have the same sender, the same receiver, and are sent at the same
time. There are no unsolicited messages in our object model. Initial
data are represented as the parameters of a stimulus message from an
environment role.
3. An IDEF0 process is defined as a series of operations contributing to a
specific purpose. The corresponding OOram concept is the execution of
a method.
4. IDEF0 Control is a trigger releasing an action. In our object model, the
actions are only released when the object receives a message. The
action is defined by a method, and a trigger is a message. This
message can only be received after all necessary data has been
received, and it could be the last data-carrying message. The data
carried by the other data carrying messages must be stored in the
object's attributes to be ready when the trigger message arrives.
(Asynchronous data carrying messages could be stored in the object's
input queue until the trigger message arrives.) The choice of solution is
not part of the process view; it could be described in a state diagram
view or it could be postponed to the implementation stage.
5. Output - data or "products" are produced by, or result from, an action.
The output from one object must be input to another, and must be
transmitted from the data source as a message. This message will be
received by some other object as described under Input above.
The OOram process The notation for a Process view is shown in figure 6.5. Roles are
view shown as super-ellipses, actions as rectangles, data as
parallelograms, and data flow as arrows.
A role,
responsible for performing all actions in same column
Additional role modeling concepts and notation ©2001 The authors. Page 212
February 8, 2001 10:20 7.2 Process view
The use of the process view is illustrated in figure 6.6. Since objects
are the only possible actors in an object-oriented system, every
action has to be associated with a role. The role responsible for an
action is indicated by its column. The responsibility for the data being
transferred is undefined.
Payer Payee
Enterprise Vendor
Bank Bank
<Establish request
need> for
<Prepare bid
request>
<Select bid>
order
<Prepare order>
<Process order>
goods <Prepare
and goods>
invoice <Prepare
invoice>
<Process order>
transfer
<Prepare
order
transfer>
<Credit
credit account>
advice <Prepare
advice>
Additional role modeling concepts and notation ©2001 The authors. Page 213
February 8, 2001 10:20 7.2 Process view
Composite actions Most process analysis methods support composite actions, which are
supported actions that are later decomposed into a number of smaller actions
with data flowing between them. This is easily supported by the
process view with one caveat: if the composite action is performed by
several roles, a corresponding virtual role must be defined to
maintain the one-to-one relationship between process actors and
roles. The decomposed process view will begin with a single action
and end with another action, both being parts of the composite
actions.
Data Stores are Conventional data flow analysis represents data stores as special
special objects elements. The only way to store data in our object model is as object
attributes. We must, therefore, represent a data store as a role in a
column in the diagram. The data store object receives and transmits
data through messages, the data stored at any time may be derived
from the data store's input data. Data store objects will normally be
persistent, their contents will survive individual program executions.
Processes inherited The essence of safe synthesis is that the base model activities are
in safe synthesis preserved in the derived model. In these cases, the processes of the
base model are preserved in the derived model. We have suggested
two safe synthesis constructs where the destiny of a process after a
synthesis operation corresponds to the destiny of the stimulus
message that starts it:
Additional role modeling concepts and notation ©2001 The authors. Page 214
February 8, 2001 10:20 7.2 Process view
Desire travel
to Permission
travel Request:
travel
<Determine OK>
Permission:
<Check> payment
<Bookkeeping> Request:
AB AB AB
AB AB
Booking Travel Book
Traveler Paymaster
Clerk Agent Keeper
Order Travel
tickets specification
Order Travel
tickets specification
Tickets Process
tickets Authorized
and cost
and invoice invoice
information
Process
invoice
Payment
request
Note cost
Payment Send
for later use
payment
Figure 7.8 AB Process
AirlineBooking Process payment
Additional role modeling concepts and notation ©2001 The authors. Page 215
February 8, 2001 10:20 7.2 Process view
Prepare Travel
permission
travel.
request Inserted AirlineBooking activity
spliced into ExpenseAccount
Travel Issue method
permission permission.
Travel
Order tickets.
specification
Travel
Order tickets.
specification
Tickets Process
and cost tickets
information Authorized and invoice.
invoice
Remuner-
Process
ation
invoice.
request
Send
Note ticket cost. payment.
Travel. Expense
Prepare expense account Payment
account.
Process Remuner-
expense ation
account. request
Arrange for
Figure 7.9 addition to
Additional role modeling concepts and notation ©2001 The authors. Page 216
February 8, 2001 10:20 7.3 State Diagram view
In a nutshell
The State Diagram view describes the legal states of a role and the
messages that trigger transition from one state to another.
State Diagrams We zoom in to focus on an individual role or object, and study its
belong to internal behavior in the form of a state diagram. The overall pattern of
perspective collaborating roles in the role model has disappeared; all we see are
the messages received from the object's environment. The sending
of these messages is out of sight.
Use state diagrams The volume of the description increases dramatically with the
sparingly and late in introduction of state diagrams, and you should only use them if you
the process. really need them and then only at a late stage in the design process.
The state diagrams are omitted if the design can be made so simple
that the problem can be postponed to the implementation stage. The
main advantage is that the volume of the models is drastically
reduced so that they are easier to create, easier to check, and easier
to modify.
Additional role modeling concepts and notation ©2001 The authors. Page 217
February 8, 2001 10:20 7.3 State Diagram view
State diagram view In conventional state diagrams, actions are triggered by signals. The
only possible signals in our object model are the receipt of
messages, and actions are defined as methods. There can be at
most one state diagram for each role. It describes the possible
states of the role, the messages that are acceptable in each state,
the action taken as a result of each message, and the next state
attained after the action is completed. The OOram notation is shown
in figure 6.10.
Collaboration View
Payee
Vendor ban cl
Bank
SD
cus bnk
Transition
(set of current state, message, requestBid
action, nextState) Name of message
creditAdvice bidRejected
order Avait
Avait
Bid
Payment
Result
Figure 7.12 Vendor
state diagram
Additional role modeling concepts and notation ©2001 The authors. Page 218
February 8, 2001 10:20 7.3 State Diagram view
Compose the We shall now discuss how we can preserve a successful state
derived state diagram through a safe synthesis operation. Note that we restrict
diagram in safe our arguments to sequential message semantics. The safe synthesis
synthesis of state diagrams for parallel processes is a research topic; but we
expect that the preservation of the activity integrity will hold the key to
success.
General synthesis The state diagram of a derived role will in some sense be a product
leads to state space of the state diagrams of its base roles. If a base role, M, has states
explosion m1, m2 and m3; and another base role, N, has states n1 and n2; the
derived role may have the states m1n1, m1n2, m2n1, m2n2, m3n1
and m3n2. This is illustrated in figure 6.13.
Initial state
m1 Initial state
n1 n2
m2 m3 State Diagram for role N
Initial state
m1n1
m2n1 m3n1
m1n2
Activity superposition Our two safe synthesis constructs are much simpler. We start with
activity superposition. We notice that the base model activities are to
be retained as independent activities in the derived model; and that
at most one activity can be performed at the time. The effect is that
the initial state of all derived roles will be the combination of the base
model initial states, and rest of the base model state diagrams will
appear as separate structures with no transitions between them. This
is illustrated in figure 6.14 for role MN, which is derived from roles M
and N.
Additional role modeling concepts and notation ©2001 The authors. Page 219
February 8, 2001 10:20 7.3 State Diagram view
Initial state
m1 Initial state
n1 n2
m2 m3 State Diagram for role N
Superposition
Initial state
m1n1
m2n1 m3n1
Figure 7.14 Activity m1n2
superposition
Composite State Diagram for derived role MN
The state diagrams for all derived roles are formed by joining the base
model state diagrams at their initial state and nowhere else.
Activity aggregation In activity aggregation, the activity of one base model is triggered as
a sub-activity in one of the methods of another model. Figure 6.15
illustrates an example when the state diagram of role N is
encapsulated within a single state in the state diagram for role M.
Initial state
m1 Initial state
n1 n2
m2 m3 State Diagram for role N
Aggregation
Initial state
m1n1
m2n1 m3n1
Additional role modeling concepts and notation ©2001 The authors. Page 220
February 8, 2001 10:20 7.3 State Diagram view
Notice that the state diagrams of all other derived roles are copies of
their respective base model state diagrams. The interdependence
between base model state diagrams is only allowed in the triggering
role.
Additional role modeling concepts and notation ©2001 The authors. Page 221
February 8, 2001 10:20 7.4 Role List view
In a nutshell
The Role List view gives an overview of the roles, their names,
purpose, and attributes.
Many data items The role list view is used to give an overview of the roles and to show
associated with roles some of their properties, you should select the ones that are useful in
your context:
1. role name, the role's unique identifier within the role model
2. explanation, giving the meaning that the analyst associates with the role
and its responsibility in the community of roles in the role model.
3. attributes. For each attribute you may specify:
¤ attribute name, the attribute's unique identifier within the role
¤ explanation, giving a free text description of the attribute
¤ type, specifying the type of the attribute. This is often omitted, but is
particularly interesting if the attribute is a reference to a role in
another role model.
role 'Vendor'
explanation "An object which desires to supply goods."
attribute 'accounts'
explanation "To keep track of outstanding accounts with customers."
role 'Enterprise'
explanation "An object which desires to purchase goods."
Figure 7.16 role 'PayerBank'
Specification example explanation "The bank of the Enterprise."
written in the OOram role 'PayeeBank'
language explanation "The bank of the Vendor."
Formal language The form of the role list should be adapted to its purpose. If precision
defined, but informal is of paramount importance, write the specification in the OOram
report often easier to language as exemplified in figure 6.16 and discussed in depth in
read appendix A. If the purpose is to communicate your ideas to
colleagues and clients, an informal variant as exemplified in figure
6.17 may be better.
Additional role modeling concepts and notation ©2001 The authors. Page 222
February 8, 2001 10:20 7.5 Modeling in the large: The OOram Module
In a nutshell
Working with a large number of interdependent models can be
confusing. Arbitrary synthesis relationships may lead to complex
structures that are hard to manage. OOram Modules provide a way
to group role models, hide details and declare certain models to be
visible and available for import into other modules.
Modeling in the large The development of a large system will often be distributed among
several teams who are separated in space or time. It is an
administrative goal to keep the dependencies between the teams as
small and simple as possible in order to reduce the need for
coordination and the danger of undetected inconsistencies.
As mentioned earlier, Brad Cox [Cox 87] defines the surface area as
everything that is visible at the interface between a supplier and a
consumer. This interface includes everything the consumer needs
two know and understand such as data element names and types,
function names, number of parameters and their types, restrictions
on time sequence of operations, concurrency and protection
domains. Techniques for reducing the surface area between
packages in the realm of programming is called programming-in-
the-large. We similarly define modeling-in-the-large as techniques
for packaging models and minimizing the surface area between
model packages.
A OOram Module is The synthesis operation establishes a dependency between the base
a package model and the derived model. Ad hoc synthesis between a large
number of models can easily lead to a chaotic structure that is hard
to create and even harder to modify. We want to group role models,
and encapsulate each group so that we can control the features that
shall be visible to other groups.
Additional role modeling concepts and notation ©2001 The authors. Page 223
February 8, 2001 10:20 7.5 Modeling in the large: The OOram Module
3. There are details in the models of the group that need not be visible to
the derived models outside the group. Encapsulation and information
hiding is then appropriate.
4. The exported models are reasonably stable.
Additional role modeling concepts and notation ©2001 The authors. Page 224
February 8, 2001 10:20 7.5 Modeling in the large: The OOram Module
Medium-sized When the programs grow so that their logic is not immediately
programs described apparent from the code, a logical layer is added where the systems
by role models are described by one or more role models.
Programming-in-the- For very large systems, the number of role models makes it hard to
large is another manage them and keep track of their interdependencies. We then
matter need a methodology that helps us separate the total system into
understandable parts and to manage their integration. We add the
rigor of a systematic design methodology to control the development
process and to document its results. We get a structure of related
modules, each containing a number of related models. Each model is
presented through a number of different and overlapping views. All
these modules, models and views must be made consistent in all
their details.
Additional role modeling concepts and notation ©2001 The authors. Page 225
February 8, 2001 10:20 7.5 Modeling in the large: The OOram Module
The good news The good news is that the discipline, modularity and precision
provided by a good analysis and design methodology makes it easier
to scale to real-sized projects. The structure that modularization
imposes on the design gives other people a chance to understand
what has been done and why it was done. Quality checks can be
applied at different levels of abstraction by independent auditors. The
logical descriptions makes it possible to apply automated tools to
check that the programs actually conform to the designer's intentions.
Different module Two modules may be related in three different ways as follows:
relations
Additional role modeling concepts and notation ©2001 The authors. Page 226
February 8, 2001 10:20 7.5 Modeling in the large: The OOram Module
TravelExpense
model Derived
Reimbursement
model TravelExpense
AirlineBooking model
model
Figure 7.19 Full
graphical module Models internal
Exported base model Derived models
notation to Accounting
Module architecture In chapter 12: A Value Chain for Intelligent Network Services, we will
case study present an extensive case study describing a possible commercial
organization for creating, deploying and using advanced
telecommunication services. The notion of modules is an important
part of its technological foundation, facilitating the transfer of
technology between different operators and protecting critical
resources which need to be controlled by the technology supplier.
Modules make Modules provide system organization and information hiding facilities
OOram technology that make it feasible to manage very large systems. A bank may
scale to very large create a Customer Module that exports certain models which its
systems customers can import into their own systems and thus integrate
banking with other operations. The Customer Module will also be part
of the bank's system architecture and be integrated with other
modules through a different set of export models.
Additional role modeling concepts and notation ©2001 The authors. Page 227
February 8, 2001 10:20 7.5 Modeling in the large: The OOram Module
Additional role modeling concepts and notation ©2001 The authors. Page 228
February 8, 2001 10:20
Chapter 8
Case study: Development of a business
information system
In a nutshell
Objects everywhere! We use objects to model the organization of the
enterprise and the computer system architecture. We use objects to
model the human work procedures and the symbiosis between
humans and their personal computers. We use objects to describe
the user interface.
Work process results Value is created when a person performs some useful task. This task
in value creation will be part of a work process that involves the person and possibly
other persons as indicated in figure 7.1.
task task
task task
Figure 8.1 A work
process consists of a
sequence of tasks task task
Case study: Development of a business information system ©2001 The authors. Page 229
February 8, 2001 10:20
Enterprise lev
Computer level
Architecture should A person does not work in isolation, and our symbiosis of person and
support cooperation information system could be repeated on all levels of the organization
on all levels such as the team, the department, and the division as illustrated in
figure 7.3. In this model, every organizational unit is modeled as an
object, which is implemented as a combination of humans and
computers. Interaction between the objects can take place on the
human level or the computer level as appropriate. This system
architecture could implement new and powerful ways of organizing
our business.
Case study: Development of a business information system ©2001 The authors. Page 230
February 8, 2001 10:20
A two dimensional We believe that the person oriented approach is valuable, and may
client-server indeed be the driving force behind the personal computer revolution.
architecture It is distinct from the traditional function oriented approach, but does
not replace it. One dimension is that a person needs to integrate all
his or her information processing facilities. The other dimension is
that a company needs integrated functions. For example, a company
needs integrated systems for computer-aided design, for materials
management, for project control, and for economic management. A
project manager performing the task of assigning people to the
project's activities needs a tool that provides simultaneous access to
the personnel function, the manpower loading function and the
project control function.
Tasks
Communication
The architecture The architecture of figure 7.4 supports many levels of integration as
supports many levels illustrated in figure 7.5.
of integration
Case study: Development of a business information system ©2001 The authors. Page 231
February 8, 2001 10:20
Between people
Through Tool
Communication
Between
Within Services
Figure 8.5 Levels of Service
Integration
Enterprise Outside world
Case study: Development of a business information system ©2001 The authors. Page 232
February 8, 2001 10:20
Enterprise
model
Task/ToolService
model
Information
Figure 8.6 Personal model
information
environments support
the members of the
organization in their
individual work and
their cooperation
Enterprise model
Case study: Development of a business information system ©2001 The authors. Page 233
February 8, 2001 10:20
Analysis and design We begin by modeling the current situation, and usually create the
are opportunistic Enterprise model and the Information model in parallel. We next
develop a corresponding pair of models for the desired, future
situation as illustrated in figure 7.8. Purists may want to keep the
current and the future models distinct; in practice, we often permit the
one to gradually evolve into the other. We continually iterate between
the future Enterprise and Information models because new ideas for
organizing the enterprise lead to new demands on the information,
and insights into possible information structures suggest
opportunities for improved organizations.
Scope
Current Current
Enterprise model Information model
Future Future
Enterprise model Information model
Future
Task/Tool/Service
Figure 8.8 A model
development process
Case study: Development of a business information system ©2001 The authors. Page 234
February 8, 2001 10:20
We will now create the three models for the travel expense example
introduced earlier. We will create an enterprise model, an information
model, and a task/tool/service model that focus on the needs of the
Authorizer role.
Case study: Development of a business information system ©2001 The authors. Page 235
February 8, 2001 10:20 8.1 Enterprise model
In a nutshell
We create an object model of an organization in the context of a
certain work procedure. The case we have chosen is a possible work
procedure for the management of travel expense accounts. This
problem was introduced in chapter 2. We now give it a more detailed
treatment.
Case study: Development of a business information system ©2001 The authors. Page 236
February 8, 2001 10:20 8.1 Enterprise model
2. Understand the problem and identify the nature of the objects. Identify
the user community and understand their requirements. Identify the
nature of the active participants; they could be concrete such as people
or equipment, or they could be abstract such as departments. In this
case, they are the people involved in the issue under consideration;
understand their duties and how they perform them.
3. Determine Environment roles and Stimulus/Response. Describe the
messages that are sent from environment roles and cause an activity in
the described system. Also describe the response, which is the overall
effect of the activity.
4. Identify and understand the roles. Separate and idealize the tasks and
responsibilities of the actors as the roles they play in the process.
5. Determine the work process. Create a model showing the tasks
performed by the actors and the corresponding Process.
6. Determine the Collaboration Structure. Show the roles in a structure of
collaborating objects.
7. Determine Interfaces. Determine the messages that each role may
send to each of its collaborators.
Our first step is to identify the bounds of our study. The area of
concern is a textual (prose) description. It may describe a broad
problem, such as the administrative procedures of an organization.
Or it may describe a narrow problem, such as the handling of travel
expense reports.
The area of concern is probably the most important step of all. Which
part of the complex world surrounding us do we want to consider,
and which aspects of this part do we consider sufficiently important to
merit inclusion in the model? If we choose too wide an area, the
model gets intractable (".. so complicated that there are no obvious
deficiencies"). If we make the area too small, we may get lost in the
large number of models needed to describe everything we are
interested in. (Programmers often like to compare an overly complex
program to a bowl of spaghetti, the object-oriented equivalent is
noodle soup.)
Case study: Development of a business information system ©2001 The authors. Page 237
February 8, 2001 10:20 8.1 Enterprise model
The next step is to identify the people we want to help. We call them
the actors. The actors may be the members of one or more
departments, or the people involved in certain operations. Our initial
selection of actors will be an intelligent guess. We may later find that
other actors have to be included and that some of the initial actors
may be ignored.
Who are the actors and what are their roles in our example? As a
starting point, we consider the company organization, which was
shown in figure 2.9 on page 66?? and is repeated in figure 7.10 for
your convenience. (We show the organization relationships as a
guide, even if they have little bearing on the current problem).
Case study: Development of a business information system ©2001 The authors. Page 238
February 8, 2001 10:20 8.1 Enterprise model
Ruth
(President)
We often find that the community of actors is too large for us to relate
to every one of them personally. We have to select a smaller number
of typical actors as representatives of the whole community. It is
important to include all kinds of actors in this smaller set. It is a grave
mistake to focus on the managers, or on those who are most forward
and outspoken, or on those who are enthusiastic for new ideas. If we
are to be of any help, we must understand our future users, their
goals and concerns, their competence and interests.
Be aware of people's In her insightful doctoral dissertation, Elanor Wynn [Wynn 79] found
different perceptions that there are basically three ways of finding out what happens in an
office: we may ask the managers; we may ask the workers; or we
may observe the work as it actually happens in the office. Each of
these approaches gives important insights, but they will all be
different. The manager and the workers will tell you how they
perceive the work; these perceptions will differ from person to
person. But some of the most important aspects of the work will be
so obvious to the participants that they will never think of mentioning
them. You must consciously search for such "obvious" aspects
through observation and through asking numerous questions.
Case study: Development of a business information system ©2001 The authors. Page 239
February 8, 2001 10:20 8.1 Enterprise model
Be aware of the It is also important to be alert to all aspects of the work processes.
"soft" aspects Wynn found that almost all communication between office workers
had several distinct, but interwoven aspects such as -- a work aspect
('order 5 boxes of copy paper'), a social aspect ('how is your cold?',
'why can't you learn to look up the reference number before you call
me?') , and a training aspect ('always remember to send a copy of
these invoices to Pete') . Introducing a new system for the work
aspect may play havoc with essential processes in the organization.
The head of a university computer center got fed up after observing
that there was always a large group of happy people around the
coffee machine, which was next to the printer. He removed the coffee
machine and had to hire three more advisors to help students solve
their problems [Weinb 71].
Be aware of your Be aware of the tendency many of us have to consider people stupid
own perceptions because they do not have our deep understanding of the concepts
and terminology of our specialty. At the bottom of such impressions
we frequently find our own complete ignorance of their competence,
concepts and terminology! Our goal is to be at one with the user
community so that we understand the details of their work and the
nature of their goals, ambitions, and cooperative culture. Empathy is
more important than precision; communication is more important than
following some fixed methodology. Looking back on figure 2.4 on
page 57??, we realize that the professional analyst is a person who
is able to learn the language of the users in order to communicate
with them and avoid misunderstandings. Communication is perfect
when the participants interpret the data in the same way. No harm is
done if we do not understand each other and know it -- we can then
continue the discussions until everything is clear. The real danger
arises when the participants interpret the data differently without
realizing it. We claim that misunderstanding is the mother of the most
gigantic failures in information systems development.
The success criterion of any project should be that the users get
exactly what they expected. It is easy to see that they have reason to
be upset if the project has been oversold and they get less than they
Case study: Development of a business information system ©2001 The authors. Page 240
February 8, 2001 10:20 8.1 Enterprise model
In our example, we identify all the people who are in any way
involved with the travel expense account process. We cannot do so
without considering the process, so the analysis must by its nature be
iterative. We identify some people and learn about their involvement
in the process. This points us to other people and other parts of the
process, and so on. A useful way of thinking about the individuals is
to consider them as information processing entities. Through
conversation and observation, we build our understanding of the
actors, their responsibilities, their collaborators and their information
processes as illustrated in figure 7.11. (But do not forget the other
aspects which we discussed above!)
Information needs
Actor
with tasks, goals Collaborators
and responsibilities
Figure 8.11 What we
need to understand Information results
about each actor
BOX
I did my first study of this kind in an engineering company. I spent a
couple of weeks interviewing various people, and collected a great
deal of data. Back in the office, I tried to create a Process diagram,
linking people through their information interchange. To my chagrin, I
discovered that almost none of the information people created was
ever used, and almost none of the information people used was ever
created. The thing was a complete mess, and my first thought was
that the company was a mess as well. On second thoughts I realized
that the company in fact produced complex and working designs, so
there had to be some other reason for the discrepancies. I found the
following (this was many years ago, and I am sure most companies
have cleaned up their act by now):
1. Synonyms. People from different disciplines used different
names for the same information.
Case study: Development of a business information system ©2001 The authors. Page 241
February 8, 2001 10:20 8.1 Enterprise model
BOX
My wife recently worked at creating a multidiscipline database for the
management of hydroelectric resources. To some, a dam was the
thing you put across a river to trap the water; to others it was a body
of water together with all the installations around it. The difficulty in
such cases is that we generally do not distinguish between term and
concept. People get very upset when their well established
terminology is "misused" by somebody else, and religious wars may
ensue if different interpretations of the terms are well-entrenched in
the terminology of both parties.
Ask one computer expert: "What is a system?" and you will get an
answer. Ask a group of experts, and you will get a discussion.
Case study: Development of a business information system ©2001 The authors. Page 242
February 8, 2001 10:20 8.1 Enterprise model
ENTSystemFromENTTravelerIntf
travelPermissionRequest:
ENTPaymaster<ENTBookkeeper
paymentRequest:
Figure 8.12
Stimulus/Response
Case study: Development of a business information system ©2001 The authors. Page 243
February 8, 2001 10:20 8.1 Enterprise model
Figure 8.13 The roles role 'ENTTraveler' explanation "The person who travels"
role 'ENTAuthorizer' explanation "The person who authorizes the travel."
role 'ENTBookkeeper' explanation "The person responsible for bookkeeping."
role 'ENTPaymaster' explanation "The person responsible for reimbursement."
We have here given the role definitions in textual form using extracts
of the OOram language defined in Appendix A. We do not
recommend a tabular form, because you should write as complete
role descriptions as possible.
Case study: Development of a business information system ©2001 The authors. Page 244
February 8, 2001 10:20 8.1 Enterprise model
Desire travel
to Permission
travel Request:
travel
<Determine OK>
Permission:
<Check> payment
<Bookkeeping> Request:
Postpone The roles are archetypical objects idealized in the context of the
classification current area of concern. High complexity or repeated patterns are
warnings that sub-models should be factored out.
Data carried by Objects can only interact through messages in our object model.
messages between Data must therefore be carried from one role to another as
objects parameters to appropriate messages. If a role needs several data
items before it can perform a task, the role must store the received
data as attributes until all data have arrived and the task can be
performed. (The message which finally releases the task is frequently
called a trigger in the literature).
Case study: Development of a business information system ©2001 The authors. Page 245
February 8, 2001 10:20 8.1 Enterprise model
ENT ENT
au tr
Traveler Authorizer
bo
ENT ENT
au tr The person
Traveler Authorizer
responsible for
bo reimbursement.
ENT ENT
pm
Bookkeeper Paymaster
descriptions
Determine the Associate a list of all the messages that a role may send to a
messages that may collaborator with the corresponding port. A Process View shows an
be sent from each example process, the interfaces must include all messages shown in
port these views. Study the resulting interfaces, and add messages that
seem to be missing to make them nicely rounded representations of
the role functionality.
Case study: Development of a business information system ©2001 The authors. Page 246
February 8, 2001 10:20 8.1 Enterprise model
ENTAuthorizerFromENTTravelerIntf
void expenseReport: (INF
ExpenseAccount {Role} anINFExpenseAccount)
void travelPermissionRequest: (INF
TravelPermission {Role} anINFTravelPermission)
ENTTravelerFromENTAuthorizerIntf
void travelPermission: (INF
TravelPermission {Role} anINFTravelPermission)
ENT ENT
au tr
Traveler Authorizer
ENTBookkeeper<ENTAuthorizer
bo
void authorizedExpenseReport: (INF
ExpenseAccount {Role} anINFExpenseAccount)
ENTPaymaster<ENTBookkeeper
void paymentRequest: (INF
PayRequest {Role} anINFPayRequest)
ENT ENT
Figure 8.17 Role Bookkeeper
pm
Paymaster
Collaboration View
annotated with
message interfaces
Two interface The Role Collaboration view can be annotated with the permitted
notations messages as illustrated in figure 7.17. The interfaces are often too
large to conveniently fit onto the diagram, or you may want to
describe more details about message parameters and their types.
You then describe the interfaces textually as shown in figure 7.18.
The language is an extract of the OOram language described in
appendix A.
interface 'ENTAuthorizer<ENTTraveler'
/* Read as "ENTAuthorizer from ENTTraveler" */
message synch 'travelPermissionRequest:'
explanation "Request authorization of submitted travel plan."
param 'aTravelPermission' type 'INFTravelPermission' :: 'Travel Expense
Information Model'
message synch 'expenseReport:'
explanation "Request reimbursement of submitted expense report."
param 'anExpenseReport' type 'INFExpenseAccount' :: 'Travel Expense
Information Model'
interface 'ENTTraveler<ENTAuthorizer'
message 'travelPermission:'
explanation "Travel authorization granted."
param 'aTravelPermission' type 'INFTravelPermission' :: 'Travel Expense
Information Model'
interface 'ENTBookkeeper<ENTAuthorizer'
message synch 'authorizedExpenseReport:'
explanation "Request reimbursement of submitted expense report."
param 'anExpenseReport' type 'INFExpenseAccount' :: 'Travel Expense
Information Model'
interface 'ENTPaymaster<ENTBookkeeper'
Figure 8.18 Interfaces message 'paymentRequest:'
for the Enterprise explanation "Reimburse the specified account."
model in informal param 'aPaymentRequest' type 'INFPayRequest' :: 'Travel Expense
textual form Information Model'
Case study: Development of a business information system ©2001 The authors. Page 247
February 8, 2001 10:20 8.1 Enterprise model
Case study: Development of a business information system ©2001 The authors. Page 248
February 8, 2001 10:20 8.2 Information model
In a nutshell
The enterprise model described what people do to achieve a certain
purpose. It also described the information that was the subject of the
messages, but it did not define the information semantics or
representation. We will now create a detailed model of this
information.
First iteration The Information model describes the universe of discourse of the
Information model Enterprise model; i.e. its message parameters and role attributes.
derived from
Enterprise model You begin by listing all relevant parameters and attributes in the
enterprise model. Then define an Information model role for each of
them and determine the relationships between them. Extend it into a
complete model of the world of information as it is perceived by the
user community.
Some information Some information may be handled informally, either orally or through
may be handled informal media such as memos or electronic mail. Travel permissions
manually are frequently handled this way. The travel expense report itself is
frequently required to be on a formal business form or data record. It
contains fields for the different kinds of information:
Focus on computer- An early decision is to choose the information that will be represented
based information in an information system and concentrate further work on this subset.
Our choice is to focus on the ExpenseAccount itself.
Case study: Development of a business information system ©2001 The authors. Page 249
February 8, 2001 10:20 8.2 Information model
The area of concern shown in figure 7.19 reflects our change of focus
from enterprise to information.
Figure 8.19 Area of The area of concern is modeling the information contained in travel
Concern
expense accounts. We focus on the expense account itself and do
not model details about the input and output in the user interfaces.
Case study: Development of a business information system ©2001 The authors. Page 250
February 8, 2001 10:20 8.2 Information model
ExpenseAccount
model
The roles are derived from the Semantic view and optionally
elaborated with attribute information. The diagram in figure 7.20 may
also be annotated with the role semantics, but it is usually better to
describe the list textually as shown in figure 7.21. We have elected to
omit the attribute type specification, this is optional according to the
OOram language defined in appendix A.
role 'ExpenseAccount'
explanation "The master object representing an expense account."
attribute 'traveler'
attribute 'purpose'
attribute 'start_date'
attribute 'end_date'
attribute 'advance'
role 'ExpenseItem'
explanation "A specified cost."
attribute 'date'
attribute 'text'
attribute 'amount'
role 'Permission'
explanation "A permission to travel."
attribute 'date'
attribute 'authorizer'
Figure 8.21 The roles role 'Authorization'
of the Information explanation "A disbursement order."
model attribute 'date'
attribute 'authorizer'
Case study: Development of a business information system ©2001 The authors. Page 251
February 8, 2001 10:20 8.2 Information model
A personal assistant To those of us who never get the sums right, the expense account
may improve the may be drafted in a spreadsheet. An even better solution would be a
creation of travel special expense account program which could help us fill in the
accounts different items, convert foreign expenses into our local currency, do
the sums, and provide on line information about the latest rules,
regulations and rates.
Case study: Development of a business information system ©2001 The authors. Page 252
February 8, 2001 10:20 8.2 Information model
Hybrid solution: An A relational database may be accessed from a program through what
object can is known as an 'Application Programming Interface' (API). We can
encapsulate a define objects with the message interface of our choice, and define
relational database the necessary methods to convert these messages to the appropriate
API calls on the database.
Case study: Development of a business information system ©2001 The authors. Page 253
February 8, 2001 10:20 8.2 Information model
tp ExpenseAccount ei
pa
ea ea ea
Interface definitions The main behavior requirements for the Information model will be
derived from the Task/Tool/Service models to be discussed in the
next section. We may also want to add behavior associated with our
travel expense regulations so that the system can provide default
values and check against maximum values for different kinds of
expenditure.
Case study: Development of a business information system ©2001 The authors. Page 254
February 8, 2001 10:20 8.3 Task/Tool/Service model
In a nutshell
An adequate solution for the information model is often available in
the form of a relational database, the lack of good information tools
adapted to their users' tasks is still a problem. In this chapter, we
discuss the position of the tools in the architecture and the
characteristics of good tools. It should not be surprising that good
user interfaces are object-oriented, making the information appear as
concrete objects that the users can manipulate directly on the screen.
A tool is an artifact We finally focus on the interface between the individual users and the
computer-based information system. An information tool is a
computer-based artifact employed by a user to perform one or more
tasks. We study each of the user's tasks, in turn, with special
emphasis on the appropriate information tools. Our job is the job of a
toolbuilder. Our goal is to create a pleasant and effective
information environment.
Iterate! We have earlier recommended that you iterate between the different
models and even be prepared to reconsider the scope of the project.
You should also include the tasks and tools in this iteration so as to
find a good set of reusable tools. There is a many-to-many
relationship between task and tool: a tool may be used in a number
of tasks, and a task may employ several tools. There are two
advantages in keeping a small number of tools: user familiarity with
the tools increases proficiency and confidence and reduces learning
effort, investment in programming, documentation and maintenance
goes down while the quality goes up. The next best thing to using
identical tools for different tasks is to use related tools which share
user interface properties and code. The object inheritance property is
an open invitation to your ingenuity for identifying related tasks and
for devising families of similar tools.
Information tools are We gave a simple model of human communication in figure 2.4 on
communication page 57??. Figure 7.25 shows a similar model describing the
devices communication between a human user and a computer-based
information system through an information tool. The tool presents
and interprets data according to an implicit Tool Information Model,
while the user communicates according to her own mental model.
Discrepancies will lead to communication errors in much the same
way as between two humans.
Case study: Development of a business information system ©2001 The authors. Page 255
February 8, 2001 10:20 8.3 Task/Tool/Service model
Tool Service
Information model Information model
Tool
Domain Service
Mental tool model
Task
The user has a mental model of the information handled in the task.
The information system is based on an (object-oriented) information
model that frequently is different from the user's model in scope,
complexity and precision. An important success criterion for a tool is
that it provides the required filtering and translation so that the user
gets the illusion of working with a system that supports the user's
mental model of the information.
BOX
We have earlier described a situation concerning hydroelectric
resource management, where two disciplines used the term dam to
mean different things. Two solutions to this dilemma are open to the
systems designer: we can force the disciplines to harmonize their
terminology, or we can create tools that do the necessary translations
so that the disciplines can retain their favorite terminology. Our
technology permits both solutions. It is a management decision to
select the one that best serves the needs of the enterprise.
Case study: Development of a business information system ©2001 The authors. Page 256
February 8, 2001 10:20 8.3 Task/Tool/Service model
Create task and tool The tasks are extracted from the process diagrams such as the
descriptions example in figure 7.14. We now create a detailed task description as
a precursor to designing a tool. The task description could consist of
the following:
The tasks of our The tasks of our ExpenseAccount example are shown in the Process
ExpenseAccount view of the enterprise model in figure 7.14. The tasks are as follows:
example
Example task We will now study possible tools to be used by the Authorizer for
description: performing her task. This tool will be part of a personal information
Authorizer process environment for persons playing the Authorizer role in the
travel request organization. We will describe two alternative tools. The common
parts of the task descriptions are as follows:
Case study: Development of a business information system ©2001 The authors. Page 257
February 8, 2001 10:20 8.3 Task/Tool/Service model
1. Scope and Goal. The goal of this task is to determine if the proposed
travel shall be permitted. The Authorizer should estimate the value of
this travel to the enterprise and check if the trip conforms to current
plans. The Authorizer should also consider if funds are available in the
budget for the proposed travel, and possibly arrange for additional
funds if the situation warrants it.
2. User work situation. This task is but one of the numerous administrative
tasks performed by persons playing the Authorizer role. In this case, it
should be possible to perform it as a simple routine in a few minutes,
and the training needed to master the tools should be minimal.
3. Input information needed to perform the task is the travel request itself.
Possible information items that could be useful to the Authorizer are:
the purpose of the journey, when it will take place, and the planned total
cost. The Authorizer could also need access to the work plans for the
indicated time period, to the budget and to accounts showing current
commitments.
4. Trigger. We assume that the Authorizer's information environment
includes a task management facility. This task will then be added to the
Authorizer's list of outstanding tasks so that she can select it for
execution at her convenience. Since this task is but one of a large
number of similar tasks, it is important that she shall not be required to
spend any mental energy relating to this task outside the few minutes it
takes to process it.
5. Output information. The authorization or rejection shall be passed to the
Traveler. This information shall also be stored and be retrieved
automatically if and when the Authorizer receives an expense account
for processing.
6. Tool description. We will discuss two alternatives below.
7. Task Scenario. A first description is given under Scope and Goal
above. More detailed scenarios will be given below.
It is hard to create Interactive user interfaces come in different styles. The simplest, and
good user interfaces oldest, is what I call the guessing game interface. The user types a
command followed by the appropriate parameters and then hits
ENTER. The computer checks its built-in list of permissible
commands and either starts the appropriate application program or
types a question mark, indicating that the user must make another
guess.
display_travel_request request_id
authorize_travel_request request_id authorizer_id
Case study: Development of a business information system ©2001 The authors. Page 258
February 8, 2001 10:20 8.3 Task/Tool/Service model
Most users would prefer the form based interface: The computer
presents a form on the screen, and the user fills in the blanks before
hitting the ENTER button. The user has to guess the syntax and
semantics of the blanks, but the leader texts and possibly also default
values make this interface much easier to use. A possible form for
our sample task is shown in figure 7.26.
Travel authorization.
Traveler Peter
Period Sept.26-Oct.1
Purpose Attend OOPSLA'93
conference
Authorizer Eve
Figure 8.26 Form
based interface for the ENTER
authorization task
Case study: Development of a business information system ©2001 The authors. Page 259
February 8, 2001 10:20 8.3 Task/Tool/Service model
Case study: Development of a business information system ©2001 The authors. Page 260
February 8, 2001 10:20 8.3 Task/Tool/Service model
If an error situation does occur, make sure you describe the error
in user terms and explain what the user can do to take care of the
problem.
7. Support Undo. Undo is perhaps the most useful function in a
direct manipulation user interface because it allows
experimentation, helps the user get out of dangerous situations,
and helps support a positive mental attitude in the user since it
permits the user to change her mind.
Case study: Development of a business information system ©2001 The authors. Page 261
February 8, 2001 10:20 8.3 Task/Tool/Service model
Case study: Development of a business information system ©2001 The authors. Page 262
February 8, 2001 10:20 8.3 Task/Tool/Service model
Travel permission.
Traveler Peter
Period Sept.26-Oct.1
Purpose Attend OOPSLA'93
conference
Planned costUSD 2,000
Authorize Reject
Case study: Development of a business information system ©2001 The authors. Page 263
February 8, 2001 10:20 8.3 Task/Tool/Service model
The tools described above were not integrated for the current task.
The Authorizer had to select corresponding items in the different
tools, create a new budget commitment and copy the amount from
the TravelRequest into it.
We will sketch out a possible tool in figure 7.28 to illustrate the idea.
A real life tool would have to be based on a detailed study of the
tasks, and should probably be more sophisticated.
Case study: Development of a business information system ©2001 The authors. Page 264
February 8, 2001 10:20 8.3 Task/Tool/Service model
This single tool will be sufficient for most practical cases, and is
clearly superior to the hodgepodge of windows needed in the
previous solution. Note that this is an example of integration on level
3 in figure 7.5. The separation between different Information services,
which is so useful for the information processing department, is
uninteresting from the users point of view and is hidden.
We will now create a role model of the tool shown in figure 7.28. We
begin with the area of concern in figure 7.29.
Figure 8.29 Area of
concern
The area of concern is an integrated tool for the authorization of a
travel proposal in our enterprise
The roles are specified in figure 7.30 using the OOram language
syntax defined in appendix A. The Authorizer is the role representing
any person who authorizes a travel. We let a single role,
[Link], represent the clusters of objects that implement the
tool. This tool is a nice illustration of the two-dimensional nature of
our architecture. It is an integrated tool that accesses three services.
We represent each of them as a single role: an
ExpenseAccountService, a PlanningService and a BudgetService.
The ExpenseAccountService is the service described by the
Information model in section 7.2. The description of the other
services are left open to your imagination.
We recognize that the tool and the service roles may be virtual, they
will then be expanded into clusters of roles in a later stage of the
development.
We create two Process diagrams: One for the opening of the tool
shown in figure 7.31, and another describing a typical sequence of
events when the Authorizer hits the Permit-button shown in figure
7.32.
Case study: Development of a business information system ©2001 The authors. Page 265
February 8, 2001 10:20 8.3 Task/Tool/Service model
TS TS TS TS
TS
Authorizer Account Budget Planning
Authorizer
Tool Service Service Service
Start
authorization
Create and open getExpense
activity
travel Account
authorization
tool
IS
Expense
Account getBudgetFor:
Budget
amount
getPlanFor:
Plan
Case study: Development of a business information system ©2001 The authors. Page 266
February 8, 2001 10:20 8.3 Task/Tool/Service model
TS TS TS
TS
Authorizer Account Budget
Authorizer
Tool Service Service
true
Press Grant
Permit- Permission
button
putAuthorized:
= true
Number
The top level collaboration view of figure 7.33 follows directly from
the basic tool model in figure 7.25.
pla
An object structure
TS TS
TS representing a
Authorizer Account
Authorizer tool auth acc particular expense
Tool Service
account.
bud
TS A system managing
Budget the enterprise
Service budget.
Figure 8.33 Interface
Collaboration View
annotated with role
responsibilities
The stimulus messages are the available user commands; and each
stimulus triggers an activity. We do not go into the detailed design of
these activities here, but indicate a likely set of typical message
interfaces. They are shown graphically in figure 7.34. We see that the
diagram gets overloaded even in this simple example. The textual
Case study: Development of a business information system ©2001 The authors. Page 267
February 8, 2001 10:20 8.3 Task/Tool/Service model
TSAccountServiceFromTSAuthorizerToolIntf
TS INFExpenseAccount getExpenseAccount ()
Planning void getPeriod ()
Service void getPlannedCost ()
void getPurpose ()
void putAuthorized: (Boolean {Role} aBoolean)
pla
TS TS
TS
tool auth Authorizer acc Account
Authorizer
Tool Service
bud
TSBudgetServiceFromTSAuthorizerToolIntf
void commit:for: (Number {Role} aNumber)
Figure 8.34 Interface TSAuthorizerFromTSAuthorizerToolIntf
TS Number getBudgetFor: ()
Budget
Collaboration View void display ()
Service
annotated with
Interfaces
interface 'TSAuthorizerTool<TSAuthorizer'
message 'Permit' "Permit the proposed travel."
message 'Reject' "Refuse the proposed travel."
message 'openOn:' "Create a new instance of the tool and open it on the
specified ExpenseAccount."
param 'expAcc'
interface 'TSAccountService<TSAuthorizerTool'
message 'getExpenseAccount' "Return expense account information."
return 'INFExpenseAccount' :: 'Travel Expense Information Model'
message 'getPeriod' "Return travel time period."
message 'getPlannedCost' "Returned planned cost."
message 'getPurpose' "Return purpose of travel."
message 'putAuthorized:' "Set authorization if aBoolean = true, otherwise the
travel is rejected."
param 'aBoolean' type boolean
interface 'TSBudgetService<TSAuthorizerTool'
message 'getBudgetFor:' "Return budget information."
param 'kind'
return number
message 'commit:for:' "Allocate amount from budget."
param 'amount' number
param 'kind'
interface 'TSAuthorizer<TSAuthorizerTool'
message 'display' "Read the currently displayed text."
Figure 8.35 Interfaces interface 'TSPlanningService<TSAuthorizerTool'
message 'getPlanFor:' "Return planning information."
param 'person'
return 'Plan' :: 'BasicTypes'
Case study: Development of a business information system ©2001 The authors. Page 268
February 8, 2001 10:20 8.3 Task/Tool/Service model
Task/Tool/Service We first met the user's tasks in the Enterprise process view in figure
model closely linked 7.14. We now find corresponding operations in the interface called
to Enterprise and TSAuthorizerTool<TSAuthorizer (AuthorizerTool from Authorizer). It
Information models is, therefore, possible to maintain formal threads from the human
level in the Enterprise model via the Task/Tool/Service model to the
Information model.
Case study: Development of a business information system ©2001 The authors. Page 269
February 8, 2001 10:20
Chapter 9
Case study: The analysis and design of a real time
system
This chapter is written for the specially interested programmer. It
exemplifies the use of state diagrams. It also illustrates that role
models are independent of implementation by showing the transition
from the models to traditional and distributed implementation
environments.
Case study: The analysis and design of a real time system ©2001 The authors. Page 270
February 8, 2001 10:20
We will now study a case where the information is simple, but where
we have to ensure that the system behaves properly in all
circumstances. The case we have chosen is a real time access
control system where a person identifies himself through a card and
code reader, and the system unlocks the door if the person is granted
access. The example has been inspired from a similar case in [Bræk
93].
Work process Our suggested design process for solving the access control problem
includes precise includes the specification of state diagrams to reflect our focus on
modeling of behavior behavior. There is a state diagram for each role; they are mutually
dependent and must be consistent. The descriptions tend to be large
and hard to modify, so we postpone the specification of the state
diagrams to a late stage in the design process. A scenario is simpler
than a set of state diagrams because it only shows the message
sequences of a typical or critical case. We use scenarios in the early
iterations to keep the volume of the model small, and add state
diagrams when the design is reasonably mature.
Iterate! It is important to keep the early descriptions small so that they can be
easily changed in accordance with our emerging understanding of
the problem and its solution. As our models become firm, we
elaborate them with state diagrams and other details until we arrive
at the final description.
Case study: The analysis and design of a real time system ©2001 The authors. Page 271
February 8, 2001 10:20
Case study: The analysis and design of a real time system ©2001 The authors. Page 272
February 8, 2001 10:20 9.1 Environment model
In a nutshell
We initially create a simple model showing the whole system as a
single, virtual role.
Case study: The analysis and design of a real time system ©2001 The authors. Page 273
February 8, 2001 10:20 9.1 Environment model
A person wanting
access through door.
System controlling
pers
Control
door System
cont
Door
Everything starts when a person approaches the door and inserts his
card to gain access. We represent the Person as a role. It is an
environment role because it will send a stimulus message when the
Person wants to open the door. This follows from the definition on
page 61??: For a given system, the environment is the set of all
roles outside the system whose actions affect the system...
The Door is also an environment role, since the effect of locking and
unlocking it is outside the scope of our area of concern. (For a given
system, the environment is ... also those roles outside the system
whose attributes are changed by the actions of the system).
Case study: The analysis and design of a real time system ©2001 The authors. Page 274
February 8, 2001 10:20 9.1 Environment model
Control
Person Door
System
readCard
pinCode:
unlock
isOpen
isClosed
lock
Figure 9.3 Message
sequence for
successful access
Control
Person Door
System
readCard
pinCode:
Case study: The analysis and design of a real time system ©2001 The authors. Page 275
February 8, 2001 10:20 9.2 Detailed model
In a nutshell
We elaborate the virtual role of the environment model and show
details of the local part of the system.
The Area of concern and the Environment views are unchanged from
the first iteration and are not repeated here.
Case study: The analysis and design of a real time system ©2001 The authors. Page 276
February 8, 2001 10:20 9.2 Detailed model
A person wanting
access through door. The centralized logic containing
the main access control logic and
the person data base.
pers Display
disp
Keyboard pane
loca
Case study: The analysis and design of a real time system ©2001 The authors. Page 277
February 8, 2001 10:20 9.2 Detailed model
readCard
cardString:
keyPress:
keyPress:
keyPress:
keyPress:
keyPress:
keyPress:
keyPress:
keyPress:
accessCode:
validate:from:
accept
unlock
set:from:
nowUnlocked
nowLocked
Use state diagrams The volume of the description increases dramatically with the
sparingly and late in introduction of state diagrams, and you should only use them if you
the process. really need them and then only at a late stage in the design process.
Case study: The analysis and design of a real time system ©2001 The authors. Page 278
February 8, 2001 10:20 9.2 Detailed model
accessCode: reject
Vali-
Idle
dating
accept
nowLocked
timeoutFrom: nowUnlocked
Locking Unlocked Unlocking
timeoutFrom:
The state diagram for the LocalStation role is shown in figure 8.7.
The action to be performed on a transition from one state to another
might be specified in pseudo-code, in a programming language or in
a diagrammatic form. The state diagram is to be read as follows:
1. Idle-state. The role is initially in the Idle state. It may receive one
message (signal):
¤ accessCode: (received from Panel). Request a confirmation of the
specified code from the CentralUnit, and wait for answer in the
Validating-state.
2. Validating-state. It may receive an accept or a reject-answer from the
CentralUnit:
¤ reject (received from the CentralUnit.) The request for access has
been rejected. Display a suitable message on the Display and
return to the Idle-state.
¤ accept (received from the CentralUnit.) Send unlock-message to the
Door and start a timer for the time permitted to the Door to actually
unlock it.
3. Unlocking-state. Waiting for the Door to actually unlock. One message
may be received. (We ignore the case when the Door does not respond
in this simple example.)
¤ nowUnlocked (received from the Door.) Start a timer for the time
period that Door may remain unlocked. Go to the Unlocked-state.
4. Unlocked-state. Wait for the duration timeout to expire:
¤ timeoutFrom: (received from the Timer.) Send message to lock Door
. Start the Timer for the duration permitted for the Door to respond.
Go to the Locking-state.
5. Locking-state. Waiting for Door to respond to the lock command. There
are two possible messages that may be received:
¤ nowLocked (from Door.) Everything is OK, go to the Idle-state.
¤ timeoutFrom: (from the Timer.) The locking has been unsuccessful,
possibly because the Person has prevented the door from closing
and latching. Go to the Alarm-state.
Case study: The analysis and design of a real time system ©2001 The authors. Page 279
February 8, 2001 10:20 9.2 Detailed model
The state diagrams for the other roles follow the same principles.
accessCode: aString
Case study: The analysis and design of a real time system ©2001 The authors. Page 280
February 8, 2001 10:20 9.2 Detailed model
Case study: The analysis and design of a real time system ©2001 The authors. Page 281
February 8, 2001 10:20 9.2 Detailed model
interface 'CardReader<Person'
message 'readCard' explanation "Read my identity card."
interface 'Panel<CardReader'
message 'cardString:' explanation "Accept the given String from
the person's identity card."
interface 'Display<Panel'
message 'display:' explanation "Display the given String."
interface 'Person<Display'
message 'show:' explanation "Read my displayed text."
interface 'Keyboard<Person'
message 'keyPress:' explanation "The user has pressed the
indicated key."
interface 'Panel<Keyboard'
message 'keyPress:' explanation "Accept given character from
person."
interface 'LocalStation<Panel'
message 'accessCode:'
explanation "A person requests access and has offered the
identification specified by aString, which is a coded combination of
information from the identity card and the received secret code."
interface 'CentralUnit<LocalStation'
message 'validate:from:'
explanation "Validate the given access code (aString) and
return an accept-message iff access granted, otherwise a reject-
message."
interface 'LocalStation<CentralUnit'
message 'accept'
message 'reject'
interface 'Door<LocalStation'
message 'lock' explanation "Lock the door."
message 'unlock' explanation "Unlock the door."
interface 'Panel<LocalStation'
message 'display:' explanation "Display the given String to the
user."
interface 'Timer<LocalStation'
message 'set:from:'
explanation "Set the timer to the given timeout time, send
timeout message at end of time period."
message 'reset' explanation "Reset timer so that no timeout
message will be sent."
interface 'LocalStation<Door'
message 'nowLocked' explanation "The door has just been
locked."
message 'nowUnlocked' explanation "The door has just been
unlocked."
Figure 9.9 Interfaces of interface 'LocalStation<Timer'
the DetailedModel
message 'timeoutFrom:' explanation "The sending timer has
reached timeout."
Case study: The analysis and design of a real time system ©2001 The authors. Page 282
February 8, 2001 10:20 9.3 Implementation examples
In a nutshell
A role model is basically independent of its implementation language.
We will here indicate five alternatives: implementation in C++ and
Smalltalk; implementation in a distributed environment according to
the standards laid down by the Object Management Group and
Microsoft; and an implementation in the form of an executable
specification.
Access control We first create an object specification for the AccessControl system.
example It is very similar to the collaboration view of figure 8.5, but the roles
are now shown with heavy outlines to indicate that they have been
promoted to object specifications.
Central
Unit
pers Display loca
disp cent
Card Local
Person card pane Panel loca pane
Reader Station
Keyboard pane
loca
This object specification focuses on the local parts of the system. The
CentralUnit is shown as an environment object, which means that we
do not specify all the characteristics of this unit. (It will for example,
have additional functionality for setting and removing people's access
rights and for handling alarms.) The other environment roles are the
Person and Door roles, since they are outside the computer system.
Case study: The analysis and design of a real time system ©2001 The authors. Page 283
February 8, 2001 10:20 9.3 Implementation examples
Deriving a C++ class It is straightforward to derive a C++ class definition from an OOram
definition from an object specification and it can be done automatically. Corresponding
OOram Object concepts are shown in table 4.1 on page 165??.
specification
enum State {
Unlocked,
Locking,
Alarm,
LockTime,
Idle,
Validating,
MaxValidationTime};
class LocalStation1;
class String;
class CentralUnit {
public:
void validatefrom(const String&, LocalStation1*);
void openDoorAlarm(LocalStation1*);
};
class Door {
public:
void Lock();
};
class Timer {
public:
void setfrom(State, LocalStation1*);
};
class Panel;
class Dictionary;
class LocalStation1 {
public:
LocalStation1();
~LocalStation();
State timeoutDictAt(State);
void accept();
Case study: The analysis and design of a real time system ©2001 The authors. Page 284
February 8, 2001 10:20 9.3 Implementation examples
Case study: The analysis and design of a real time system ©2001 The authors. Page 285
February 8, 2001 10:20 9.3 Implementation examples
How the C++ implementation and run-time environment will deal with
asynchronous behavior is not covered in this brief presentation.
LocalStation1>>accessCode: (LocalStation<Panel)
accessCode: aString
" A person requests access and has offered the identification specified "
" by aString, which is a coded combination of information from the identity
"
" card and the received secret code. "
state == #Idle
ifTrue:
[state := #Validating.
cen validate: aString from: self.
tim set: MaxValidationTime from: self]
ifFalse:
[self dpsCaution: 'Illegal state: ' , state. self reset].
LocalStation1>>timeoutFrom: (LocalStation<Timer)
timeoutFrom: timer
" The sending timer has reached timeout. "
state
case: #Unlocked do:
[tim set: (LocalStation1 timeoutDictAt: #LockTime) * 2 from: self.
doo lock.
state := #Locking]
Case study: The analysis and design of a real time system ©2001 The authors. Page 286
February 8, 2001 10:20 9.3 Implementation examples
Idle Prestate
Trigger message
accessCode:
(or signal)
validate:from: TO
cent
Output message
Figure 9.11
OOram/SDL diagram Validating Poststate
for LocalStation >>
accessCode
Same message may The actions associated with the message timeoutFrom: received
trigger different from the timer is particularly interesting, because the action to be
actions performed depends on the current state of the object as shown in
figure 8.7. This is illustrated in figure 8.12.
Case study: The analysis and design of a real time system ©2001 The authors. Page 287
February 8, 2001 10:20 9.3 Implementation examples
unlockAlarmFrom: openAlarmFrom:
Idle lock TO door
TO cent TO cent
Figure 9.12
OOram/SDL diagrams Locking
for different actions in
LocalStation
>>timeoutFrom
process LocalStation;
start;
nextstate Idle;
state Idle;
input accessCode(aCode);
output validatefrom(aCode,thisLocalStation)/* to CentralUnit*/;
nextstate Validating;
state Validating;
input reject;
nextstate Idle;
input timeoutFrom(aTimer);
nextstate Idle;
input accept;
output unlock/* to Door*/;
output setfrom(unLockTime,thisLocalStation)/* to Timer*/;
nextstate Unlocking;
state Unlocking;
input nowUnlocked;
Case study: The analysis and design of a real time system ©2001 The authors. Page 288
February 8, 2001 10:20 9.3 Implementation examples
nextstate Unlocked;
input timeoutFrom(aTimer);
output unlockAlarmFrom(thisLocalStation)/* to CentralUnit*/;
nextstate Idle;
state Unlocked;
input timeoutFrom(aTimer);
output lock/* to Door*/;
output setfrom(lockTime,thisLocalStation)/* to Timer*/;
nextstate Locking;
state Locking;
input nowLocked;
nextstate Idle;
input timeoutFrom(aTimer);
output openAlarmFrom(thisLocalStation)/* to CentralUnit*/;
nextstate Alarm;
state Alarm;
input nowLocked;
output doorLockedFrom(thisLocalStation)/* to CentralUnit*/;
nextstate Idle;
endprocess LocalStation;
Case study: The analysis and design of a real time system ©2001 The authors. Page 289
February 8, 2001 10:20 9.3 Implementation examples
[Link] OMG/CORBA
Deriving a CORBA The interface descriptions in CORBA IDL are easily derived from the
IDL description from OOram object specification. An interface description of LocalStation
an OOram Object in CORBA IDL can be as follows:
specification
Case study: The analysis and design of a real time system ©2001 The authors. Page 290
February 8, 2001 10:20 9.3 Implementation examples
module AccessControl {
interface LocalStationFromPanel {
void accessCode(in string aCode);
};
interface LocalStationFromDoor {
void nowLocked();
void nowUnLocked();
};
interface LocalStationFromCentralUnit {
void accept();
void reject();
};
interface LocalStationFromTimer {
void timeOutFrom(in Timer aTimer);
};
[Link] COM/OLE
Case study: The analysis and design of a real time system ©2001 The authors. Page 291
February 8, 2001 10:20 9.3 Implementation examples
Deriving a Microsoft The interface descriptions in Microsoft IIDL are easily derived from
IDL description from the OOram object specification. The concepts map as shown in table
an OOram Object 8.1.
specification
interface IUnknown
{ HRESULT QueryInterface();
ULONG AdRef;
ULONG Release;
};
[ uuid(AF3B752C-89D0-101B-A6E4-00DD0111A658),
version(1.0) ]
interface ILocalSPanel: IUnknown {
void accessCode([in] string aCode);
};
[ uuid(AF3B7521-89D0-101B-A6E4-00DD0111A658),
version(1.0) ]
interface ILocalSDoor: IUnknown {
void nowLocked();
void nowUnLocked();
};
[ uuid(AF3B7522-89D0-101B-A6E4-00DD0111A658),
version(1.0) ]
interface ILocalSCentralU: IUnknown{
void accept();
void reject();
};
[ uuid(AF3B7523-89D0-101B-A6E4-00DD0111A658),
version(1.0) ]
interface ILocalSTimer:IUnknown {
void timeOutFrom([in] Timer *aTimer);
};
[ uuid(AF3B7524-89D0-101B-A6E4-00DD0111A658),
Case study: The analysis and design of a real time system ©2001 The authors. Page 292
February 8, 2001 10:20 9.3 Implementation examples
version(1.0) ]
interface LocalStation:
{ CentralUnit *get_cen();
Door *get_door();
Panel *get_pan();
Timer *get_ tim();
};
Case study: The analysis and design of a real time system ©2001 The authors. Page 293
February 8, 2001 10:20 9.3 Implementation examples
Monitored execution We have chosen the last solution because it provides the designer
gives important with important insights into the operation of his design and because it
insights is applicable in all cases.
Facilities for monitored execution can take many forms. The Taskon
experimental facility automatically produces three reports: An Object
Collaboration report, an Execution Scenario report, and a Textual
Trace report.
Local Central
Panel loca pane cent loca
Station Unit
door
time
loca
Door loca
Case study: The analysis and design of a real time system ©2001 The authors. Page 294
February 8, 2001 10:20 9.3 Implementation examples
The Object The Object Collaboration report shown in figure 8.14 is similar to a
Collaboration report collaboration view, but we use rectangles rather than super-ellipses
shows all observed to emphasize that we show an object structure rather than a role
objects and their structure. There is one rectangle for each observed object; one port
interaction paths symbol for the start of each observed interaction path; and
associated with each port are the messages actually observed as
sent through that port. We only show the messages observed from
port 15; there are similar message lists associated with all the other
ports.
16 13
Door Timer
#13 Observed msgs
#16
void lock ()
11 void unlock ()
12
Figure 9.14 Object
Timer
collaboration report for #14
successful access
example
We notice that there is a Timer associated with the Door object. This
Timer is not part of the design. It had to be added to the dummy Door
implementation to simulate the time taken by the various door
operations, such as the time that the door is kept open.
Case study: The analysis and design of a real time system ©2001 The authors. Page 295
February 8, 2001 10:20 9.3 Implementation examples
accessCode:
set:from:
validate:from:
accept
reset
unlock
set:from:
nowUnlocked
set:from:
timeoutFrom:
set:from:
timeoutFrom:
timeoutFrom:
set:from:
lock
nowLocked
reset
Figure 9.15 The
Execution Scenario
report shows all
observed message
interactions in time
sequence
Case study: The analysis and design of a real time system ©2001 The authors. Page 296
February 8, 2001 10:20 9.3 Implementation examples
01 OK test
02 TASKON/OOram Monitored Execution,
12 April 1994 at 3:45:24 pm
03 program version e15-t10
04
05 Panel#11 >> accessCode:
('personIdentAndCode') >> LocalStation#12
06 LocalStation#12 >> set:from: (1
{LocalStation#12}) >> Timer#16
07 LocalStation#12 >> validate:from:
('personIdentAndCode' {LocalStation#12})
>> CentralUnit#15
08 CentralUnit#15 >> accept () >>
LocalStation#12
09 LocalStation#12 >> reset () >>
Timer#16
10 LocalStation#12 >> unlock () >>
Door#13
11 TRACE-Door#13: Lock released at
3:45:31 pm
12 )-- Door#13 >> set:from: (2 {Door#13})
>> Timer#14
13 Door#13 >> nowUnlocked () >>
LocalStation#12
14 LocalStation#12 >> set:from: (5
{LocalStation#12}) >> Timer#16
15 )-- Timer#14 >> timeoutFrom:
({Timer#14}) >> Door#13
16 TRACE-Door#13: Door opened at
3:45:33 pm
17 )-- Door#13 >> set:from: (2 {Door#13})
>> Timer#14
18 )-- Timer#14 >> timeoutFrom:
({Timer#14}) >> Door#13
19 TRACE-Door#13: Door closed at
3:45:35 pm
20 Timer#16 >> timeoutFrom:
({Timer#16}) >> LocalStation#12
21 LocalStation#12 >> set:from: (2
{LocalStation#12}) >> Timer#16
Case study: The analysis and design of a real time system ©2001 The authors. Page 297
February 8, 2001 10:20 9.3 Implementation examples
The Textual Trace report shown in figure 8.16 displays all information
that has been collected, but it makes hard and boring reading. It is,
however, useful for studying details in the execution such as
parameter and return values.
The trace is interpreted as follows:
Line 01 shows the name of the test.
Line 02 identifies time and date of the execution.
Line 03 identifies the version of the program being executed.
Line 05 shows a message send.
The syntax of a message report is as follows:
'sender object' >> 'message name' ( 'message parameters' ) >>
'receiver object'
For example, line 5 is to be read
The object Panel#11 sends
the message named accessCode:
with a String parameter: 'personIdentAndCode'
to the object LocalStation#12
Line 11 shows a program trace. The programmer may insert informative
messages in his code. These messages are preceded by 'TRACE' in
the report.
Line 12 shows illegal message send. Message sends are checked against the
port interfaces specified in the role models. If a message is not in
accordance with the role model, the report line begins with the
symbol ')--'. The messages in lines 12, 15, 17 and 18 are examples of
nonconformance. They are all caused by a Timer used in the dummy
Door implementation to make it appear to open and close at
determined times.
Not shown Run-time errors are reported with a line beginning with 'CAUTION';
the execution continues if at all possible.
Case study: The analysis and design of a real time system ©2001 The authors. Page 298
February 8, 2001 10:20 9.3 Implementation examples
Not shown Message return values (Smalltalk messages always return a value) are
given on the following line if different from the receiver object. The
return value is preceded by the keyword RETURN:
RETURN return value
Case study: The analysis and design of a real time system ©2001 The authors. Page 299
February 8, 2001 10:20
Chapter 10
Case study: The creation of a framework
This case is about low-level programming. We create a reusable
framework written in Smalltalk, but the principles presented should be
equally applicable to other programming languages.
Case study: The creation of a framework ©2001 The authors. Page 300
February 8, 2001 10:20
The case we have chosen is the work we have done to adapt the
visual parts hierarchy of Objectworks release 4.0 to our
requirements. This seems to be work which never ends: We keep
finding better concepts and solutions that reduce the burden on the
application programmer and increase product quality. We have
flattened several years of iterative development into a single step in
the case study, and have even included an improved scheme for the
changed-update construct that we were exploring while this chapter
was written.
Guide to the case We presented a general process for creating frameworks in chapter
study 5.3 on page 212??. The process is reflected in this case study report,
you will find the following subsections:
Case study: The creation of a framework ©2001 The authors. Page 301
February 8, 2001 10:20 10.1 First step: Identify consumers and consumer needs
In a nutshell
In this case, the consumers were ourselves and our needs were
dictated by market pull for full color and integration with the platform's
windowing system
The consumers are The consumers of this framework case study are the system
ourselves developers at Taskon. At the time when we first heard of
Objectworks\Smalltalk release 4.0, we had developed a large system
product consisting of some 1,500 classes, 37,000 methods, and
some 300,000 lines of Smalltalk code running under
Objectworks\Smalltalk release 2.5. The code was very compact with
extensive reuse, and a typical runtime image might consist of more
than a quarter million objects.
From our standpoint, the most dramatic changes were the entirely
new class hierarchy for managing windows and their parts. The big
question was how the modified class library would influence our
system. To answer this question, we established a project to create
an OOram framework which modified and extended the visual parts
of release 4.0 to make it satisfactory for our purposes.
Simple, yet powerful Our main requirement was that we wanted to create sophisticated
user interface user interfaces quickly, simply and safely. This implies that we
development wanted to push as much of the problem complexity as possible into
the framework, that we wanted a small surface area between the
framework and the application, and that we wanted the programmer
to retain full control over the model functionality and the layout of the
editors in the window.
Specifically:
1. We wanted all the new capabilities of the new release.
2. We wanted to retain the functionality of our existing editors,
because we liked them and so did our customers.
3. We wanted to reduce the burden on the application programmer
by significantly reducing the surface area between the framework
and its derivatives.
Case study: The creation of a framework ©2001 The authors. Page 302
February 8, 2001 10:20 10.1 First step: Identify consumers and consumer needs
Case study: The creation of a framework ©2001 The authors. Page 303
February 8, 2001 10:20 10.2 Second step: Perform a cost-benefit analysis
In a nutshell
We wanted to combine the added functionality with a reduced
number of editor glitches.
Benefit: Our When we first got access to Objectworks release 4.0, the decision to
customers wanted it adopt it was trivial: our customers wanted its color capabilities and its
closer integration with the platform windowing system, and they
wanted it NOW. So we had no choice but to convert our programs to
the new release as quickly as possible and cost was really not an
issue.
Benefit: Our In addition, our application programmers appreciated that the new
programmers architecture made their task easier, and wanted us to adapt to the
wanted it new release because they believed it would make them more
effective (removing some of the hassle, but none of the fun.)
Benefit: We needed The phenomenon covered by the visual part hierarchy is of central
to improve our MVC importance to our business because it permeates all our task-
framework oriented tool products. Certain aspects of the changed-update
construct had continued to cause difficulties even after several
stages of improvements. (The solution presented here includes an
even later revision, which our application programmers hope will
finally prove to be the ultimate solution.)
It seems to me that there are only three ways of making firm project
commitments: either keep the goal fixed with time and resources
flexible, or keep time and resources fixed with the detailed
specifications of the goal flexible, or make the bureaucracy
surrounding the project so large that it completely dominates the
unknown, creative part.
Case study: The creation of a framework ©2001 The authors. Page 304
February 8, 2001 10:20 10.2 Second step: Perform a cost-benefit analysis
In our case, the work was harder than expected and the available
time and resources were fixed due to commitments to customers. We
have, therefore, been forced to go through several iterations, even if
we in this presentation pretend there has been only one.
Case study: The creation of a framework ©2001 The authors. Page 305
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
In a nutshell
Reverse engineering of existing programs was very enlightening and
helped us identify a number of powerful object patterns.
Third step: Reverse The third step was to do a reverse engineering analysis of the new
engineering visual parts hierarchy of Objectworks\Smalltalk release 4.0. The
results are summarized below.
The class hierarchy The goal of the reverse engineering step was to understand how
was not helpful release 4.0 managed windows with all their different subareas. We
first browsed through the class library, and found that classes and
methods were consistently and well commented. We studied the
class hierarchy: figure 9.1 shows the inheritance relationships
between the classes we have found to be most relevant to our study.
We must admit that the hierarchy did not help us understand the
design of a window and its parts. We clearly needed to study how the
objects collaborate in an actual window, and not how their classes
are related in the class hierarchy.
Case study: The creation of a framework ©2001 The authors. Page 306
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Object
- Controller
- - ControllerWithMenu
- - - ParagraphEditor
- - ScrollbarController
- - StandardSystemController
- - WidgetController
- DisplaySurface
- - Window
- - - ScheduledWindow
- InputSensor
- - TranslatingSensor
- - WindowSensor
- InputState
- Model
- - PopUpMenu
- - ScrollValueHolder
- - ValueModel
- - - PluggableAdaptor
- - - ValueHolder
- - - - TextCollector
- Screen
- SharedQueue
- VisualComponent
- - VisualPart
- - - CompositePart
- - - - BorderDecorator
- - - DependentPart
- - - - View
- - - - - AutoScrollingView
- - - - - - ComposedTextView
- - - - - - - TextCollectorView
- - - - - BooleanWidgetView
- - - - - - ActionButton
Figure 10.1 A part of - - - - - - LabeledBooleanView
the Smalltalk class - - - - - Scrollbar
hierarchy - - - Wrapper
Classes of interest to our study are shown in bold typeface.
Dissecting a In the best Smalltalk tradition, we next tried to understand the new
Transcript window design by analyzing a concrete example. We first tried to investigate
a program Browser, but found it far too complex for our purpose. So
we selected the System Transcript, which is the simplest window of
all. The System Transcript is a text editor where programs can write
messages to the user, and where the user can type simple
commands. Its appearance on the screen is shown in figure 9.2.
DecWindows buttons
Menu bar
Scroll UP button
Scrollbar
Case study: The creation of a framework ©2001 The authors. Page 307
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
The title bar at the top with its resizing and other buttons is managed
by the platform windowing system (DecWindows in this case) and is
not represented as Smalltalk objects. Our interest focuses on the
contents of the window: the menu bar, the scrollers and the text
editor itself.
Case study: The creation of a framework ©2001 The authors. Page 308
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
w m s m
581 3822
2259 5116
Standard v c Scheduled cp ct
Window s Border cp
System Window
Sensor Decorator
Controller
cps
ct ct ct
cp cp
ct ct
14782 12188
Composite Scroll ds
Part Wrapper
cps cp
ct ct ct
cp cp cp
ct ct ct ct ct
791 9795
464 14455
Labeled 444 Text m
m Action m Action m m
Boolean Scrollbar Collector
Button Button
View View
c c c c c
ds ds ds
v v v v v
s s s s s
Case study: The creation of a framework ©2001 The authors. Page 309
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Separation of Even if it was greatly simplified, the object structure of figure 9.3 was
concern still quite formidable. This did not surprise us, since even the simple
Transcript window is quite sophisticated. We decomposed the
Transcript functionality, and created a role model for each of its
functions: A role model is a part of a structure of objects which we
choose to regard as a whole, separated from the rest of the structure
during some period of consideration. A whole that we choose to
consider as a collection of roles, each role being characterized by
attributes and by actions which may involve itself and other roles.
Case study: The creation of a framework ©2001 The authors. Page 310
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
The third object from the left in the top row is the 3822-
ScheduledWindow object. It is the root of the visual component
hierarchy and forms the container for the BorderDecorator object.
Case study: The creation of a framework ©2001 The authors. Page 311
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
up
A Component has the characteristics of a son
object in the visual parts tree structure. A
Component Component manages some area within a window,
Figure 10.6 The roles presents information to the user and possibly takes
and their input pertaining to this presentation from the user.
responsibilities
The message The most interesting parts of this role model are the message
interfaces interfaces. Most relevant objects play both roles. The role model help
us segregate the messages that are sent down the component
hierarchy from the ones that are sent up. The most important
messages are illustrated in figure 9.8.
Container Component<Container
bounds:
container:
dw displayOn:
Container<Component
up graphicsContextFor:
invalidateRectangle:forComponent:
localPointToGlobal:forComponent:
Figure 10.8 Simplified
Component
interfaces for the
Container-Component
construct
Case study: The creation of a framework ©2001 The authors. Page 312
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
interface 'Container<Component'
explanation "We require that the Container shall accept these messages in any sequence.
This means that it is the responsibility of the Container to be prepared for any and all of these
messages after it has sent the container:-message to the Part."
message 'graphicsContextFor:'
explanation "Return aGraphicsContext for set up for aComponent."
param 'aComponent'
message 'invalidateRectangle:forComponent:'
explanation "Invalidate the Rectangle aRectangle. Propagate a damage rectangle up the
containment hierarchy. This will result in a displayOn: aGraphicsContext being sent to the
receiver."
param 'aRectangle'
param 'aComponent'
message 'localPointToGlobal:forComponent:'
explanation "Convert aPoint in coordinate system of aPart to a point in the window's
coordinate system."
param 'aPoint'
param 'aPart'
interface 'Component<Container'
message 'bounds:'
explanation "An actual bounding rectangle is being asserted, aRectangle is in the
coordinate system of the Part. The bounds: message originates at the top of a hierarchy
(usually a ScheduledWindow) and passes down to each VisualComponent. ScheduledWindows
send bounds: to their single component when opened or resized. CompositeParts uses this
message to do layout of tiled components. BoundedWrapper uses the newBounds rectangle
as the actual bounding rectangle. Many VisualComponents do nothing. Do not send a
changedBounds: message back up the hierarchy in response to this message."
param 'aRectangle'
message 'container:'
explanation "The Part is being placed in containment hierarchy inside of aContainer."
param 'aContainer'
Figure 10.9 Textual message 'displayOn:'
interface view explanation "Display the receiver on the given GraphicsContext, which is set up for the
receiver's coordinate system."
param 'aGraphicsContext'
Using synthesis to Figure 9.10 illustrates how the design of the Transcript window can
recreate part of be considered as composed of repeated applications of this base
object structure model.
Case study: The creation of a framework ©2001 The authors. Page 313
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Scheduled Border
dw up
Window Decorator
dw
up
Bordered
Wrapper
Container
dw
dw
up
up Scroll
Wrapper
Component
dw
up
Text
Figure 10.10 Repeated
Collector
applications of the View
Container-Component
model in the Transcript
structure
Implementation Whenever there is a change in the data, the window (or parts of it)
comments has to be redisplayed. There are basically two mechanisms for doing
this in a component: invalidation and direct display. Invalidation is
illustrated in the scenario of figure 9.11, and direct display is
illustrated in the scenario of figure 9.12. Sketches of the
corresponding programs are given below.
Text
Scheduled Border Bordered Scroll
Collector
Window Decorator Wrapper Wrapper
View
invalidateRectangle:forComponent:
invalidateRectangle:forComponent:
invalidateRectangle:forComponent:
invalidateRectangle:forComponent:
displayOn:
displayOn:
displayOn:
displayOn:
Figure 10.11 Scenario
of display through
invalidation
Case study: The creation of a framework ©2001 The authors. Page 314
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
graphicsContextFor:
graphicsContextFor:
graphicsContextFor:
graphicsContextFor:
Figure 10.12 Scenario
get aGraphicsContext
for local display
01 gc := aTextCollectorView graphicsContext
02 . aScrollWrapper graphicsContextFor: aTextCollectorView
03 . . aBorderedWrapper graphicsContextFor: aScrollWrapper
04 . . . aBorderDecorator graphicsContextFor: aBorderedWrapper
05 . . . . aScheduledWindow graphicsContextFor:
Case study: The creation of a framework ©2001 The authors. Page 315
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
anEdgeWidgetWrapper
06 gc
07 paint: aTextCollectorView backgroundColor;
08 displayRectangle: damageArea;
09 paint: aTextCollectorView foregroundColor.
10 aTextCollectorView displayOn: gc
VisualPart
vp VisualPart
Client
Case study: The creation of a framework ©2001 The authors. Page 316
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
VisualPart
vp VisualPart
Client
VisualPart<VisualPartClient
void bounds ()
void components ()
void container ()
void invalidateRectangle: ()
void localPointToGlobal: ()
Figure 10.14 void preferredBounds ()
VisualPart<VisualPartClient void topComponent ()
graphical interface
view
interface 'VisualPart<VisualPartClient'
message 'bounds'
explanation "Answer a Rectangle that represents the
Component's actual bounding rectangle on the screen in the
Component's coordinate system."
message 'invalidateRectangle:'
explanation "Invalidate the Rectangle aRectangle. Propagate a
damage rectangle up the containment hierarchy. This will result in a
displayOn: aGraphicsContext being sent to the receiver."
param 'aRectangle'
message 'localPointToGlobal:'
explanation "Convert a point in local coordinates to a point in
the top windows coordinate system. Forwarded to the receiver's
container."
param 'aPoint'
message 'preferredBounds'
explanation "Answer a Rectangle, which is the preferred
bounds of the receiver in the receiver's coordinate system."
message 'topComponent'
explanation "Answer the top component in the receiver's
hierarchy. If the receiver is not in a hierarchy answer the receiver.
(Taskon comment: This are very questionable semantics. The
protocol of the usual topComponent (ScheduledWindow) is different
from the protocol of an arbitrary Component. We have modified the
specification to return aScheduledWindow or nil)."
message 'components'
explanation "Answer a Collection containing the receiver's
components. Answer an empty Collection if this is a leaf node."
message 'container'
explanation "Answer the receiver's container, or nil."
Figure 10.15
VisualPart<VisualPartClient
textual interface view
Case study: The creation of a framework ©2001 The authors. Page 317
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Container
ct Container
Client
dw
Container
dw
VisualPart
vp VisualPart
Client
up
10.3.2 Model-View-Controller
Case study: The creation of a framework ©2001 The authors. Page 318
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
I needed multiple This concept proved inadequate when I wanted to use Smalltalk-76
presentations to create a system for production control in shipbuilding. The
information represented in the system was the production schedule
with its activities and resources, and the user would want to see and
manipulate it in many different forms: as a network of activities, as a
chart showing each activity as a bar along the time axis, and as a
business form presenting activity attributes as texts that could be
edited.
Case study: The creation of a framework ©2001 The authors. Page 319
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Case study: The creation of a framework ©2001 The authors. Page 320
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
out m
View
The Model knows about any number of Views; they are called
dependents and are the only relations that shall exist from Model to
View. Views and Controllers come in pairs. The View knows about
exactly one Controller, and a Controller knows about exactly one
View. The View and the Controller know the same Model, but the
Model does not know the Controller.
view: self
model: Model
addDependent: self
Figure 10.22 Scenario:
View and Controller
setup
Case study: The creation of a framework ©2001 The authors. Page 321
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
anyInputCommand
anyAttributeChangingMessage
update:
anyPresentation
Figure 10.23 Scenario:
User modifies
information
MVC roles designed This sequence of events is controlled by the MVC framework, even if
to be specialized the command in step 1, the message to the Model in step 2, the
nature of the model modification in step 3, and the nature of the
information requested by the View in the last step are determined in
the derived model specializing the framework.
Case study: The creation of a framework ©2001 The authors. Page 322
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
ControllerFromUserIntf ModelFromControllerIntf
anyInputCommand anyAttributeChangingMessage
Controller m
View<Controller
in containsPoint:
localPointToGlobal: Model
showSelection
User subViewWantingControl
d
Controller<View
model:
setSensorFromView
view:
c
out View m
View<Model
update:
UserFromViewIntf Model<View update:with:
update:with:from:
Figure 10.24 Some anyPresentation addDependent: aView
removeDependent: aView
important messages
Case study: The creation of a framework ©2001 The authors. Page 323
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Input management All input from keyboard and mouse are received into the
Objectworks\Smalltalk image through an interrupt driven process,
which is an instance of class InputState (not shown in figure 9.3).
Each window has one instance of WindowSensor (2259-
WindowSensor in our Transcript) that holds a SharedQueue of input
events. The InputState puts received input events into the
WindowSensor queue of the currently active window. Every
Controller holds an instance of TranslatingSensor, and asks this
sensor for an input event whenever it needs one. The five instances
of this construct in the Transcript are illustrated in figure 9.25.
We will now discuss two role models that explain these input
facilities. We will see that the models give a nice overview of the
phenomena which would be hard to get by studying the classes.
There are two different chains of objects in figure 9.3 which are of
interest to our current discussion: the visual component objects going
from top to bottom, such as 3822-ScheduledWindow, 5116-
BorderDecorator, 9943-BorderedWrapper, 12188-ScrollWrapper,
9795-TextCollectorView. Another chain of objects go from bottom to
top, such as 3003-ParagraphEditor (aController), 610-
TranslatingSensor, 2259-WindowSensor. There are similar chains for
the menu bar and the scroller buttons.
Case study: The creation of a framework ©2001 The authors. Page 324
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Main Input Role The first model is the Main Input Model, which describes how the
Model keyboard and mouse input is made available to the Controller. The
second model is the TranslatingSensor Initialization Model, which
describes how the TranslatingSensor is set to provide the required
coordinate transformations.
All the five instances of the input construct highlighted in figure 9.25
are represented by the three input roles of figure 9.27.
A
inpu
The WindowSensor role has queues for metaInput,
keyboardInput, and damage. Instances are also
Window
responsible for handling events for their window.
Sensor
Mouse coordinates are translated into the
window's coordinate system.
S
The TranslatingSensor role is an InputSensor
ws that translates mouse coordinates into a
client's local coordinate system.
Translating
Sensor Object responsible for
capturing and processing
S input from the user.
s
Figure 10.27
Controller
Collaboration view of
Main Input Model
Case study: The creation of a framework ©2001 The authors. Page 325
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Window Scheduled
w s
Sensor Window WindowSensorFromControllerIntf
translatingSensor
ScheduledWindowFromControllerIntf
sensor
ws ws sw
Translating
s Controller v c View
Sensor
flushCoordinateCaches
topComponent
sensor
translatingSensor
localPointToGlobal: 0@0
globalOrigin: aPoint
Figure 10.30 Scenario:
TranslatingSensor
Initialization
Case study: The creation of a framework ©2001 The authors. Page 326
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
We see that the Controller knows a great deal about the complete
structure of objects. This is generally not a good idea, because it
makes it hard to change the structure. I think I would have preferred
to let the Controller ask the View for a new TranslatingSensor and let
this request pass up the Container-Component chain.
Case study: The creation of a framework ©2001 The authors. Page 327
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Scrollbar
Controller
m
in v
Scroll
User
Wrapper
c ds
out m
Scrollbar
A ScrollWrapper is a Container
Scrollbar is a slider that permits a (See Container-Component role
variable-sized bubble, and is used to model) that translates the
Figure 10.32 The put scrollbars on a view. coordinate system for their
Scrollbar role model is Component.
derived from MVC
The message flow which takes place when the user moves the
scrollbar is illustrated in the scenario in figure 9.33:
1. The activity starts when the User moves the scollbar (scrollAbsolute).
2. The ScrollbarController senses this movement. It computes relative
displacement in model coordinates (mapToDataSpace:, dataExtent).
The ScrollbarController notes the displacement of the scrollbar. It then
sends the scrollVertically: message to the ScrollWrapper.
3. The ScrollWrapper scrolls itself by changing its coordinate
transformation. (The ScrollWrapper also redisplays itself and its
component. This display is done with the new transformation, and the
contents appears scrolled. This is not shown in the scenario.)
4. The Scrollbar (view) redisplays itself. The scrollbar position must be
updated regardless of the cause of the stimulus causing the scrolling
action. This is taken care of by the changed-update mechanism:
Whenever the ScrollWidget changes its scroll offset, it sends a
changed-message to itself which causes an update:with:from: message
to be sent all dependents, including the Scrollbar. The Scrollbar then
computes new values for the size and position of its slider from the
visibleExtent, dataExtent and scrollOffset of the ScrollWidget so that it
can redisplay itself.
Case study: The creation of a framework ©2001 The authors. Page 328
February 8, 2001 10:20 10.3 Third step: Perform reverse engineering of existing programs
Scrollbar Scroll
User Scrollbar
Controller Wrapper
scrollAbsolute
mapToDataSpace:
dataExtent
scrollOffset
scrollVertically:
update:with:from:
visibleExtent
dataExtent
scrollOffset
Figure 10.33 Scenario:
Scroll vertically, using
scrollbar
Case study: The creation of a framework ©2001 The authors. Page 329
February 8, 2001 10:20 10.4 Fourth step: Specify the new framework
In a nutshell
The new framework was specified to combine functionality that had
been supported by different frameworks in the past.
We want a single In the past, we have provided separate frameworks for the visual
framework component functions much as we have described them in the above
reverse engineering reports. Each framework is reasonably simple,
but the sum is quite formidable so that the creation of new editors
has been a job for experts.
Case study: The creation of a framework ©2001 The authors. Page 330
February 8, 2001 10:20 10.5 Fifth step: Document the framework as patterns describing ho
In a nutshell
In this step, we give a number of patterns that describe how a
consumer apply the Tool framework.
We assume pattern We assume the reader of the patterns to be thoroughly familiar with
user to be expert the solution technicalities. This is in accordance with Alexander's
patterns, which are short and to the point. The patterns give sufficient
information for the expert reader; the non-expert can study the
solution logic of the sixth step to become one.
You use this Tool framework when the following conditions are
satisfied:
Case study: The creation of a framework ©2001 The authors. Page 331
February 8, 2001 10:20 10.5 Fifth step: Document the framework as patterns describing ho
Your
Tool
vs
tool
tool
Controller
c v m
View Model
m
Case study: The creation of a framework ©2001 The authors. Page 332
February 8, 2001 10:20 10.5 Fifth step: Document the framework as patterns describing ho
References Use Pattern 2: Fixed Proportion Tool Layout (p. 349??) to specify
simple, proportional layouts, or Pattern 3: Flexible Tool Layout (p.
350??) for full freedom in layout specification. See also Patterns 4:
The Controller (p. 352??), 5: The Model Object (p. 353??) and 6: The
View (p. 354??).
When to use You use this pattern when your tool layout is defined by simple
proportions.
Solution You consider the tool's actual bounds as the unit rectangle
(0@0 corner: 1@1), and specify the outer boundary of each view
with its borders and possible scrollbars as rectangles relative to
this. The actualBounds of the views will automatically be
recomputed whenever the tool's actualBounds is changed.
Case study: The creation of a framework ©2001 The authors. Page 333
February 8, 2001 10:20 10.5 Fifth step: Document the framework as patterns describing ho
References The views are described in Pattern 6: The View (p. 354??).
When to use You use this pattern when you want a complex layout of the views
within a tool.
The suggested width and height specify the space that will be
made available to the tool, nil values indicate that the container
will adapt to whatever value you choose (e.g., by scrolling).
Case study: The creation of a framework ©2001 The authors. Page 334
February 8, 2001 10:20 10.5 Fifth step: Document the framework as patterns describing ho
References The views are described in Pattern 6: The View (p. 354??).
When to use You use this pattern when you want user command activities to be
performed within a transaction. Views redisplay themselves once at
the end of a transaction when the model is in a consistent state.
This is the default pattern for controller objects which you use in
Pattern 1: The Tool.
Problem The Controller is responsible for handling all user input. This
pattern gives it the added responsibility to ensure that all
activities that lead to model attribute changes shall be
performed within a transaction.
Solution All commands that change one or more model attributes must
be executed within a transaction. The transaction shall be
activated as close to the user interaction code as possible:
1. TransactionManager
inTransactionDo: [<code modifying model attributes>]
¤ TransactionManager is a global variable, the sole instance of class
TransactionManager1.
Case study: The creation of a framework ©2001 The authors. Page 335
February 8, 2001 10:20 10.5 Fifth step: Document the framework as patterns describing ho
View
Translating v
Sensor
s
Controller m Model
tm
Transaction
Manager
References Other patterns may be made which specialize this one, but they are
not discussed here.
When to use You use this pattern when you want to program model objects and
none of its specializations are appropriate.
This is the default pattern for model objects which you use for Pattern
1: The Tool (p. 347??), and the corresponding programs are parts of
the Tool framework.
Problem Views send messages to the model to obtain the current values
of its attributes, and may cache the results on the screen or in a
variable. It is the responsibility of the model to inform its views
whenever messages will return a new value.
Solution You capture model attribute changes and map these changes to
the externally available interrogation messages.
View
m
Model
Object
m
Controller
Case study: The creation of a framework ©2001 The authors. Page 336
February 8, 2001 10:20 10.5 Fifth step: Document the framework as patterns describing ho
References Other patterns may be made which specialize this one, but they are
not discussed here.
When to use You use this pattern when you want to program view objects and
when none of its specializations are appropriate.
This is the default pattern for view objects which you use for Pattern
1: The Tool (p. 347??).
Case study: The creation of a framework ©2001 The authors. Page 337
February 8, 2001 10:20 10.5 Fifth step: Document the framework as patterns describing ho
Problem The view caches information it has obtained from the model,
usually in the form of a picture on the screen. The view receives
the message update1: towards the end of the transaction if the
model has changed. Make sure that the view is updated exactly
as needed and no more.
Make your View class inherit from View1. Override update1, and
determine required redisplays and possible changes to the
virtualBounds from the current viewChangeHolder:
1. Send the following message if you want to order a redisplay:
¤ self changeHolder invalidate: damageRectangle
2. Send the following message if you want to change the virtualBounds of
the view:
¤ self virtualBounds: aRectangle
3. Send the following message if you want the accumulated change
information to take effect without waiting for the end of the transaction:
¤ self commitChanges
Container
View
cn Change
Holder
ct v
vch
References Other patterns may be made which specialize this one, but they are
not discussed here.
Case study: The creation of a framework ©2001 The authors. Page 338
February 8, 2001 10:20 10.6 Sixth step: Describe the framework's design and implementati
In a nutshell
This step gives background technical information aimed at the
application programmer who wants to use the Tool framework. We
describe the overall design of the framework and briefly discuss the
rationale behind some of the design choices.
insideWindow
outsideMenuBar
insideMenuBar
outsideUpScrollerButton
insideUpScrollerButton
outsideVerticalScroller
insideVerticalScroller
outsideTextView
insideTextView
visibleTextArea
outsideDown ScrollerButton
insideDownScrollerButton
Synonyms and We studied the code of release 4.0 to determine the vocabulary used
homonyms to describe all these rectangles. We found bounds, clippingBounds,
clippingBox, compositionBounds, and insetDisplayBox. We
suspected that all denote the area actually allocated to a component
by its container. They are, therefore, synonyms or at least closely
related concepts.
Case study: The creation of a framework ©2001 The authors. Page 339
February 8, 2001 10:20 10.6 Sixth step: Describe the framework's design and implementati
VisualPart>>bounds
^container == nil
ifTrue: [self preferredBounds]
ifFalse: [container compositionBoundsFor: self]
CompositePart>>compositionBoundsFor: aVisualComponent
^aVisualComponent preferredBounds
Our main rectangles It is quite likely that we did not fully understand the ideas behind the
visual component hierarchy, but we felt a strong need for some
precisely defined words which we could use consistently throughout
the framework. We defined the following three notions:
Our main classes of VisualPart2 is the superclass of all our visual part classes. An extract
visual parts of the class hierarchy is as follows:
VisualPart2
1. SimpleContainer2 defines a subroot in the visual part hierarchy that
holds at most one component.
¤ View2 is the Taskon View superclass; all Taskon views shall be
subclass of this or equivalent.
* MarginTool1. A multi-media tree editor, an example is given in figure
12.5 on page 440??.
¤ Tile2 defines the only visual parts which are responsible for
coordinate transformations. A Tile positions its component within its
container and transforms the relevant parameters and return values
of messages being passed up and down the visual hierarchy chain.
* BoundedTile2 defines a Tile whose virtualBounds is identical to the
virtualBounds of its part.
* UnboundedTile2 defines a Tile whose virtualBounds is the area
allocated by its Container (A larger Part will be clipped.)
* ScrollingTile2 defines a Tile which is able to vary its coordinate
transformation to effect scrolling of its component.
Case study: The creation of a framework ©2001 The authors. Page 340
February 8, 2001 10:20 10.6 Sixth step: Describe the framework's design and implementati
1. Multiple display for multiple attribute changes. Our general rule is that
any method which modifies an object should also send the self changed
- message, which leads directly to an update-message being sent to all
views, which again leads to the views redisplaying themselves. If the
user command leads to several attribute changes, the views will
redisplay themselves several times, once for each attribute. This takes
time and is disturbing to the user.
2. Model may be inconsistent in the middle of a modification activity. The
model may be a structure of objects such as a doubly linked list. A
structure change will involve several objects and several methods, and
the model is likely to be inconsistent until the modification activity is
completed. If each method that performs part of the structure
modification sends a self changed: message, the views will try to
display an inconsistent model with possible catastrophic results.
3. The model programmer loses control when sending an update-
message. We have, in certain very special cases, found it convenient to
program a chain reaction: A user command leads to a model change,
which leads to a view update. The view update method sends a new
attribute modification message to the model. This is a new stimulus in
the MVC model which is sent while the system is busy performing the
previous activity. (FOOTNOTE: This is exactly what we defined as
unsafe synthesis in chapter 3??.)
Case study: The creation of a framework ©2001 The authors. Page 341
February 8, 2001 10:20 10.6 Sixth step: Describe the framework's design and implementati
Case study: The creation of a framework ©2001 The authors. Page 342
February 8, 2001 10:20 10.6 Sixth step: Describe the framework's design and implementati
The tool object is The Tool object is the object which controls the layout of the Tool's
part of the visual editors (view-controller pairs) and coordinates their behavior. This
component hierarchy object has been a rover in our architecture. We have tried letting a
controller play the Tool role, and we have tried letting the Tool object
be a separate object outside the VisualPart hierarchy. Our current
solution is to let the Tool be a Container object because it is
responsible for an area of the screen and manages a number of
Components. A general role model showing the Tool's position in the
VisualPart structure is shown in figure 9.35.
Case study: The creation of a framework ©2001 The authors. Page 343
February 8, 2001 10:20 10.6 Sixth step: Describe the framework's design and implementati
Container
Translating
Sensor cps
cont
Translating
Sensor Tool
Tool
view
tls
ct
Tile
cp
ct
Bounded Widget
ct tls
Tile Composite
Transaction
view
cp part Manager
mode
boun ct
s Con-
Controller v c View
View m
Model
Model
troller
Figure 10.35 The tran m
VisualPart architecture
showing the position of
the Tool role
Activity phases We have introduced transactions to solve the problems with views
controlled by trying to display inconsistent models, and with multiple, redundant
transactions display operations. The transaction also controls the persistent
storage of model objects, but this does not belong to our current
discussion.
Case study: The creation of a framework ©2001 The authors. Page 344
February 8, 2001 10:20 10.6 Sixth step: Describe the framework's design and implementati
Case study: The creation of a framework ©2001 The authors. Page 345
February 8, 2001 10:20 10.7 Seventh step: Inform the consumer community
In a nutshell
In this case, the consumers are ourselves. But we still need a
systematic information and training program.
In our case, the main part of this step consisted of a number of short
seminar and discussion groups. In addition, the Tool framework
documentation was given to every programmer and also made
available electronically.
Case study: The creation of a framework ©2001 The authors. Page 346
February 8, 2001 10:20
Chapter 11
Organizing for software productivity
This chapter is mainly written for the software manager and
businessperson who is willing to consider new ways to create and
deploy software. We present the idea of a value chain: somebody
creates something that is of value to somebody else, who creates
something that is of value to somebody else, and so on up to the end
user who applies software to perform a valuable task.
In a nutshell
Software life cycle models tell us what happens to a piece of software
and when it happens. We expand our interest with a third dimension:
who makes it happen.
We believe that the people who contribute their skills to the creation
and deployment of software should be organized in a value chain.
The guiding principle should be that while the qualifications of the
people on the different layers will be different, the individual
qualification requirements shall be realistic in terms of a large and
distributed organization plan. The professionals performing the tasks
on each layer shall be supported by a combination of technologies,
procedures and tools.
We must organize One of the great promises of object orientation is reuse, but we must
properly to realize organize ourselves properly to realize its potential. We present the
reuse potential idea of a value chain: somebody creates something that is of value
to somebody else, who creates something that is of value to
somebody else, and so on up to the end user who applies software to
perform a valuable task.
On each layer, there are people who employ the results created by
the people on the layer below and provide results for the people on
the layer above. The technology and techniques applied at each
layer must be tailored to the personnel who populate it, their goals,
tasks, working conditions, preferences and competence.
We will not pretend that we have the final answers to either of these
questions, but we have worked on them for more than ten years. In
this chapter, we give a report on a structure for the
telecommunications intelligent network services industry, and also a
report on how to organize the creation and deployment of business
information systems.
Extend the life cycle Software life cycle models are commonly used to describe the
model with an actor important events in the life of a piece of software. A model may, for
dimension example, distinguish between system specification, design,
implementation, testing, installation, and maintenance. There are
many variants of this model, but most of them have one thing in
common: they describe the software life cycle from the point of view
of the program developer. Just consider the apparently innocent word
maintenance. It covers both bug fixing and minor software
improvements. Bug fixing could involve a user who discovers a
software irregularity, a systems operator in the user organization who
passes a bug report to the vendor's customer support person, who
reports the bug to the head of the software development team, who
allocates it to a responsible programmer, who fixes the bug and
returns a program patch along the same path.
We want to extend the traditional life cycle model to describe all the
different people and all the activities that contribute to the final value
to the end user.
What, when, who We could say that traditional life cycle models have two dimensions:
What and when. We extend the models with who as a third
dimension. This permits us to describe the software life cycle not only
from the programmer's point of view, but also from the point of view
of other people such as the provider of reusable components, the
distributor, and the end user.
End user
Layer N
Layer N-1
Layer N-2
Need effective work Figure 10.2 shows a generic specification of an abstract layer. The
process layer has its own tasks, work processes and production facilities. The
work processes can be formal or informal according to the culture
and preferences prevalent on that particular layer. The layer
specification must be augmented by the special requirements
associated with a concrete layer.
People form the The actors populating a given layer have unique responsibilities and
most essential part corresponding competence and interests. The production facilities for
of a layer the actors on every layer in the value chain should be designed at
least as carefully as we design the end user systems. The current
tendency to try and provide a common environment that satisfies all
needs will result in solutions that are too complex to satisfy anybody.
The guiding principle should be that the qualifications of the actors on
the different layers must be realistic in terms of real people. Their
goals, qualifications, tasks, and production facilities must all be in
harmony.
The deliverables A layer creates a certain kind of value. The products delivered from
constitute the one layer constitute the libraries and other production facilities
product employed on the layer above it. The success criterion of the people
populating the layer (the supplier) is the satisfaction of the consumers
on the next layer up. The actors who populate a layer must,
therefore, understand the qualifications and requirements of their
clients.
We will need We now change our perspective from the individual layer to the value
different value chain as a whole. Our first observation is that the value chain must
chains be adapted to its purpose. We do not know the number of different
value chains that will be needed, but we will at least need one for
each of the main software categories such as business information
systems, telecommunications systems, real time control systems,
and computer aided design systems. We also expect that there will
be variants of these value chains dependent on their commercial
organization: the interaction between different companies are of a
different nature than the interaction between teams within the same
company.
The linear value The term "value chain" implies a linear structure, which is the
chain simplest structure imaginable. Our main reason for wanting this
structure is that we want people to work in a homogeneous,
integrated environment that is tailored to their needs and preferences
(FOOTNOTE: We stress that this does not imply that the work should
be mindless or even routine; even the most creative person in the
world will be more effective if she works in an environment that
stimulates her creativity and simplifies her mundane tasks.).
A simple, linear As an example of a linear value chain, consider the situation when I
value chain first started programming in 1958. The value chain was then as
illustrated in figure 10.3. I was the programmer, and since I
programmed in binary, I based my work entirely on the computer's
hardware capabilities which were made available through a well-
defined instruction repertoire. The user, my customer, loaded and
started the program, and was then in the environment I had defined.
Even though the computer had been built by my colleagues, there
was no practical way for me to change its specifications. Similarly,
the use of the program did not give the user access to its internal
construction.
User layer
Programmer
layer
The disadvantage to the user was that he was limited to running one
program at a time. If the user needed the functionality of more than
one program, he would have to quit one before running another, and
it was hard to obtain a synergy effect by intermixing the functionality
of several programs. The disadvantage to me as a programmer was
the limited power of the hardware instruction set, and also that I had
to do everything myself. This severely limited the functionality of the
programs that were feasible to create.
The tree structured We get a tree structured value chain when the work on a given layer
value chain is to be based on the results from several sublayers. This is the
situation for most programmers today, who have to relate to a myriad
of different facilities from different suppliers. Figure 10.4 illustrates
that the situation is radically different from the good old days, but it
must be admitted that it empowers me to create programs that were
unthinkable in the fifties.
Userlayer
Application programmer
layer
The directed graph Real value chains in the real world will usually take the form of an
value chain acyclic, directed graph. We made figure 10.4 into a tree by cheating:
some of the partitions in the hardware layer would almost certainly be
shared among several partitions on the programming support layer.
Our nice and simple model of figure 10.1 has now changed into the
complex picture of figure 10.5, where the actors on one layer build on
the results from several suppliers on the layer below.
Level 4b
Level 2a Level 2b
Figure 11.5 A directed
graph value chain
Level 1a
based on extensive
reuse from several
sources
Value chains created As an engineer, I tend to think that a value chain should be the result
by design? of careful analysis and design rather than the result of an arbitrary
happening. This is indeed the case for the initial value chain we
created for Intelligent Network Services in cooperation with the
Norwegian Telecom that we describe below.
Value chains created Real life business is not as simple as this. Networks of organizations
by natural selection? evolve under the influence of many pressures. Market pressures is
the current fashion, but financial, political, technical and even moral
pressures influence business evolution. The software business is no
exception, and fragments of value chains are appearing
spontaneously all around us: operating system vendors try to entice
application programmers to build on their results; repository builders
encourage providers of CASE (Computer Aided Software
Engineering) tools to standardize on their products. Consultants and
authors of newsletters try to make order out of chaos and influence
vendors and users to use a common vocabulary and adapt to some
common, high level architecture.
Production When we first worked on the initial system for Intelligent Networks,
engineers create the we assumed that the people on one level would be totally responsible
value chain for the production facilities of the people on the layer above them. But
then a member of the project asked the very pertinent question: But
what is our role in this? We are not part of the chain, yet we design
and implement it. This led to the idea of production engineering,
which covers the design and implementation of value chains. This
includes the chain architecture as well as choosing the appropriate
technology for the different layers, specifying the work processes,
choosing the production facilities, and installing them. This is
illustrated in figure 10.6. We have now reverted to the simple, linear
value chain model, because we believe it to be the duty of the
production engineers to create the illusion of a linear chain even if
they integrate systems and products from several vendors to
implement a production facility.
Work processes
End user and
Layer N
production facilities
Layer N-1
Layer N-2
Production
engineering
Create your own The focus on people and responsibility which is embedded in the
value chain idea of value chains has proven useful in a number of situations. We
have found that very complex problems are greatly simplified when
we add the third, people dimension to the life cycle model. The
examples described in the following sub-sections are but two
examples.
There are two opposing forces. One which makes the producer tend
towards specialization, another which makes the consumer want
general suppliers:
1. People must specialize to be best in what they do, so they will tend to
focus on a small part of the value chain.
2. Customers do not like to deal with lots of vendors, so they will prefer to
buy everything from one company.
If you believe that value chains can help you better organize your
work, you may consider the following activities as part of your initial
studies:
1. Identify all the people or organizational units involved, and describe the
layers of the value chain. The top layer will be the ultimate end user of
your software; that is the layer where value is created outside the realm
of software. The bottom layer will likely be some purveyor of hardware
or basic software such as operating systems, communication systems
and database services. Also include suppliers of computer aided
software engineering tools. Make sure to include all layers, such as
layers for distribution, installation, training and service.
2. Describe the nature of the work performed in each layer and the
success criteria of their actors.
3. Describe the kind of people who will be most effective on the different
layers. You would expect to find extrovert people near the top of the
chain because of their close relationship to the end users. The people
near the bottom of the chain are likely to be introvert, more concerned
about computational details than the happiness of users.
4. Select suitable technology to support the work on each layer, specify
the work processes and the production facilities. Be sure to be open
minded when you select the technology, a simple duplication of master
objects may be more appropriate than sophisticated technology such as
automatic program generators.
In a nutshell
This section has been written for the interested layman, so we do not
apologize to the telecommunications expert for glossing over the
hard problems or for explaining principles that are well known to him.
The result was a blueprint for a major industry. We believe its general
pattern shows the future of the software industry, and that a viable
Intelligent Networks Industry could be based on our model. But study
the following pages and judge for yourself.
We report the results of the first iteration briefly in this chapter and
more thoroughly in chapter 12. This iteration was performed in 1993
and reported with a paper and demonstration at the TINA conference
of that year [Ree 93]. The next iteration takes place in 1994-95; its
results were not ready in time to be included here.
Intelligent Networks A large number of different Intelligent Network services have been
(IN) provide proposed, and some of them have already been made operational by
sophisticated some operators. We list a few to give you an idea of their nature:
telecommunications
services
IN will be one of the The construction and deployment of IN services is going to be a very
world's major large operation. There will be a large and expanding number of
industries available services; the total system complexity will be staggering; and
many organizations employing people in different capacities will be
involved in its creation and operation.
Service Domain
An elaborate life Norwegian Telecom has proposed an Intelligent Network service life
cycle model cycle model to the EURESCOM, further details can be found in
[Vestli, Nilsen 92]. The model has more phases than most other life
cycle models, but a short reflection convinces us that all are needed
if we want to support a very large number of users and encourage
extensive software reuse:
Many different actors Many different individuals and enterprises will be involved in the
creation and invocation of Intelligent Network Services. Typical
examples are subscribers and end users, Public Telecommunications
Administrations, "Teleshops", and independent software houses.
These individuals and enterprises will, as a body, be responsible for
supporting the complete Intelligent Network Service Life Cycle.
Identify the value We analyzed the life cycle model and identified six actors who can be
chain organized in a six-layer value chain as shown in figure 10.8.
1. User layer. The User is the party who wants to use available services,
and who is responsible for selecting and invocating a service.
2. Subscriber layer. The Subscriber is the party who purchases a set of
services on behalf of one or more Users, who pays for them, and who is
responsible for making the services available to his or her users.
3. Service Provider layer. The Service Provider is a party who has a
license for activating Intelligent Network service software for specified
Subscribers. We think of the Service Provider as the corner Teleshop
where consumers can buy regular services, but it could also be a
professional customer consultant who sells specialized services to
advanced corporations.
User Layer
Subscriber Layer
Table 11.1
Intelligent Network
versus consumer
goods value chains
We discuss the layers of the value chain in more detail in the case
study of chapter 12.
In a nutshell
One of the themes of this book is that object orientation enables us to
create customized software which is adapted to the tasks and
preferences of individuals. The tasks and preferences of
professionals vary widely. Therefore, we need a great number of
different tools and even greater number of configurations of tools into
coherent information environments.
Business Information Decisionmakers and other professionals need to harness both halves
Systems support of their brains. They need logic and creativity; they need rational
decisionmakers analysis of aspects that can be formalized and intuitive
understanding of complex relationships beyond the reach of logic.
Senior
decision maker
User layer
Information
editor
Basic information
provider
Figure 11.9
Subdivision of the User
layer in a Business
Information System
value chain
Experience based I have met many managers of high technology enterprises who would
information like to capture and formalize the collective experience of the
environments enterprise to make it less vulnerable to the vagrancies of its experts,
and to ensure that the enterprise as a whole learns from experience
and does not repeat past mistakes.
All kinds of You would probably make a different list, and my list will probably be
information different a year from now. But this is immaterial for our argument: we
environments can be start with goals, determine the kind of people who can best achieve
created them, and create a information environment which best supports
these people in their preferred mode of working.
Tool-Maker layer
Production
engineering
Module-Maker layer
Kernel-Maker layer
Some of the systems software is less robust than we could desire and
requires very specialized and detailed knowledge to make it run
together with the rest of our software. This is one of the challenges that
our production engineers have to face.
6. The Production Engineers are responsible for the methodologies for
the upper four layers of the value chain.
The business The organization can be patterned after the value chain as indicated
organization can be in figure 10.11. The Tool-Makers are grouped in accordance with the
patterned after the End User business. This enables the company to reuse its
value chain understanding of the customers' requirements as well as the
appropriate technology. The Module-Makers create application
oriented functionality, this functionality is often reusable for several
categories of End Users and, therefore, several Tool-Makers. The
Kernel-Maker is responsible for generally reusable patterns and
frameworks as well as procedures and production facilities. The
Kernel-Maker, therefore, can fill the function of Production
Engineering as well as the Kernel-Maker layer in the value chain.
Module-Maker Module-Maker
Our life cycle model is shown in figure 10.12 is called the Taskon
Fountain Model: Software production consists of spouting a column
of specialized software from the pool of reusables; the end user
drinks from this fountain to satisfy his thirst for solutions. The pool
level rises when systematically collected experience is packaged as
reusable facilities and components. The work needed to satisfy a
given user requirement is given by the height of the production
column; sophisticated requirements increase its height by lifting the
top, while better reusable assets decrease its height by lifting the
general level of the pool.
END USER
Fountain
of
production
Collection
Produce revenue of
Increase complexity Experience
Work analysis
for improved
processes
Reverse engineering
improved
* concepts
* pattern
s
* frameworks
* configurable
objects
Pool of reusable assets:
* Production facilities (methodologies)
* Reusable components:
Figure 11.12 The models, patterns, frameworks, objects
Fountain Model for
Reuse
Production done by System production activities aim at satisfying customer needs and
Tool-Makers and generate revenue. The Tool-Makers are in the front line: they
Module-Makers determine user needs, instantiate and structure library objects, and
preset initial parameters and other configuration data.
Job rotation All our organization models in this chapter are considered as role
essential models. The production engineers and the actors of the value chain
layers are roles which must be mapped on to real persons. We
believe there should be many-to-many relationships between roles
and people. Specifically, we believe that people should alternate
between production work and experience collection, between
revenue creation and investment.
We simply believe that all programmers benefit from taking their own
medicine: be the end users of their own software, use their own
reusables, clean up their own production.
Does it scale? You may well ask if this is applicable to large organizations with
hundreds of programmers. We believe it is for two reasons. One is
that it seems hard for a methodology section of a large programming
organization to make front line programmers adopt their wonderful
components, processes, and tools -- a certain interchange of people
might help the transfer. The second is that the development of
reusable assets by nature is a slow and painstaking process. A
person who is working exclusively in that area will not understand the
humble-tumble of front line programming, and will be hard put to
create the optimum production facilities.
Management When I first entered the programming field in the late fifties, we tried
challenge to hit right to persuade a shipyard that it should invest in computer aided design.
balance between On one memorable occasion, the yard management had to decide if
production and they were to spend their scarce investment resources on a new
investment welding machine or on a computer for the new systems. Simple
arithmetic showed that the welding machine would pay for itself in
one year, while nobody knew if and when the computer would pay its
way. Fortunately for us, management made a good decision and
bought the computer.
The management of today has the same kind of problems when they
allocate scarce resources. Should they enter into a contract with
customer X which will generate a known cash flow and satisfactory
profit, or should they invest the same resources in an improved, low
level framework which is invisible to management and customers
alike? It would be nice if we could apply a formula to compute return
on a proposed investment in reusables. I am sorry to admit that we
do not have a good solution, and that resource allocation to
investment and production activities are based more on intuition than
rational computations. But we do have some experience of schemes
which do not work, at least not for us. We do have examples of
reusable components which have never been used, and we have on
The Taskon vision We finish this chapter with the Taskon vision for software
development: Study user requirements on a basis of experience from
studying similar users; model user information by reusing models for
similar users; specify tools which are adapted to the users' tasks;
create systems without programming by duplication and conceptual
modeling; if new functionality is required, create new software by
marginally extending existing software. Reusable assets augment
competent people to produce software which is cheaper, better
adapted to user needs and more reliable than was achievable by
using people alone.
Chapter 12
Advanced reuse based on object instances
This chapter is written for the specially interested reader. The
technology presented is independent of role modeling and constitutes
an additional road to software reuse.
Advanced reuse based on object instances ©2001 The authors. Page 371
February 8, 2001 10:20 12.1 Introduction to object reuse
In a nutshell
We have discussed how to reuse models and classes through
inheritance and specialization. We shall now see how we can
compose a system from a pool of predefined objects. This technology
is entirely different from the OOram role modeling technology. It is
not as mature, but it can become the most important reuse
technology of the future.
System creation by Encapsulation separates the external properties of an object from its
configuration internal implementation. Polymorphism permits different objects to
use different methods for processing the same messages. The two
properties taken together open an opportunity for constructing object
structures by composition. A large variety of systems can be
constructed from a limited set of objects by connecting them in
different ways. This is an object-oriented variant of the system
creation without programming that has proven so successful in the
world of databases.
Many alternatives for An object is created and inserted in the collaboration structure by
selecting the class of some other object. The selection of the appropriate class for a new
new objects object may be accomplished in many different ways, ranging from the
simple and rigid to the complex and flexible. All of them have the
common characteristic that they can be designed and implemented
as general mechanisms that can be used by the application
programmer according to simple rules.
Advanced reuse based on object instances ©2001 The authors. Page 372
February 8, 2001 10:20 12.1 Introduction to object reuse
Advanced reuse based on object instances ©2001 The authors. Page 373
February 8, 2001 10:20 12.2 Runtime configuration and object trading
In a nutshell
We often want to create user interfaces where the user can navigate
through an object structure and edit any chosen object. The
challenge to the application programmer is to identify the type of the
selected object, to select a suitable editor class, and to instantiate
and install the selected class. This section gives you a general
mechanism for creating a "dynamic matchmaker" which will achieve
this goal and which you can use as the foundation when you want to
create very powerful and user friendly user interfaces.
System
requirements
model
System
design
model
Trader library
of editor classes
System
implementation
Legend:
Advanced reuse based on object instances ©2001 The authors. Page 374
February 8, 2001 10:20 12.2 Runtime configuration and object trading
A simple text editor can, for example, edit any object which
understands the two messages getText and putText. A simple list
editor can edit any object which understands size, getElement (index)
, and putElement (index, anObject). A simple graph editor can edit
any structure of objects where every object understands
getNeighbors, putNeighbor (anObject), removeNeighbor (anObject).
Trader Editor
trad Trader eds trad
Client Factory
info inst
class
Trader mechanism
The objects participating in this mechanism play the five roles shown
in figure 11.2.
1. InformationObject. This role is played by any object which represents
information that the user wants to see and possibly edit.
2. Editor. This object is responsible for the interface between a user and
the designated information object.
3. TraderClient. This role is played by any object which knows an
InformationObject and wants an editor for it.
Advanced reuse based on object instances ©2001 The authors. Page 375
February 8, 2001 10:20 12.2 Runtime configuration and object trading
Two activities There are two activities in the trading mechanism: Initialization and
Trading. The Initialization activity must somehow instantiate the
Trader object and load it with a list of EditorFactories. This list can be
sorted in priority sequence so that the first acceptable editor will also
be the default one. We have hard coded a list of EditorFactories in
our current implementation; it could alternatively be specified by the
user or supplied through a configuration file.
getEditorFor
supportedInterface
supportsInterface
©createInstance
setInformation
Figure 12.3 Activity for
selecting and
instantiating and editor
A variant of this activity lets the Trader collect the names of all
technically acceptable editors and invite the user to indicate her
preference before the editor is instantiated.
Advanced reuse based on object instances ©2001 The authors. Page 376
February 8, 2001 10:20 12.2 Runtime configuration and object trading
Objects typically play This description of the Trading mechanism illustrates the separation
several roles of concern inherent in role modeling. The object that plays the Trader
role in our system is a globally available object that plays a number of
other roles such as Transaction Manager, Persistent Store Manager,
and Clipboard Manager. It would clearly be confusing if we were to
describe all these roles simultaneously. We can also see that it is
easy to discuss the Trading mechanism in the context of all the
participating roles, and it is nice to know that we can map these roles
on to actual objects in any way we please.
Advanced reuse based on object instances ©2001 The authors. Page 377
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
In a nutshell
An OOram Composition System (OOCS) is a system that controls
the creation of object structures by composition. The idea is that
given a seed object, an OOCS Schema specifies the types of the
objects that can be attached to it. One type is selected and
instantiated, and the new object is attached to the seed. The
composition proceeds by choosing new seed objects; selecting the
type of a new addition; instantiating it; and attaching it to the growing
structure.
System creation by Figure 11.4 illustrates that we use a special work process when we
composition create a system by composition. The System User model describes
the system environment as in the normal programming case. The
System Requirements model has been modified into an OOCS
schema. An OOCS schema is not only a description of the world as
seen by the end user community, but it is also a precise and
complete definition of the system. (It abides by the so called "100%
rule".) In this sense the schema language is like a programming
language. The difference is that the schema language builds on a
few, simple notions which yield powerful leverage within its
designated application area.
System
user
model
OOCS
OOCS Types
Schema
System
of objects
Figure 12.4 Models on
all levels may be
composed from
simpler base models
Box
My wife has been working as a database manager for a number of
Advanced reuse based on object instances ©2001 The authors. Page 378
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
years. One of her reactions when helping me with this book has been
that of frustration. Database technology has slowly been maturing so
that she now can draw the conceptual schema of a new application
on a computer screen and push a button; the finished program is
generated correctly and automatically. And it works immediately,
every time! No detailed coding, no intricate bugs to track down. She
felt that with object orientation, she would be back to the old days
when she spent most of her time coding and debugging, working
through the night to find the last bug before system installation, and
more nights fighting fires to keep the system operational.
The first lesson to learn from this is that nobody should replace a
mature technology with a new one without good reason. The new
technology may be more fashionable, but pressing requirements that
cannot be satisfied by the current technology should be the only
acceptable reason. Psychologists claim that we only ask for things
that we believe to be feasible [Aronson 72], and we must be careful
to read pressing requirements as real requirements, not perceived
requirements.
Advanced reuse based on object instances ©2001 The authors. Page 379
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
2. Means for specifying and recording the database schema. The schema
defines the structure of the database and its elements in user-related
terms.
3. Means for storing and managing data according to the rules and
constraints specified in the schema.
4. Means for retrieving data from the database. This includes finding the
required data and presenting them in a suitable form.
5. A program which manages the database at runtime.
Relational databases Conceptual schemas are well known in the database community.
offer a small, fixed They describe the semantic relationships between data items arising
set of reusable data from relationships in the "real world" of the problem domain. A
types conceptual schema can be used to specify a customized information
system, and programming in the traditional sense can often be
avoided altogether.
Advanced reuse based on object instances ©2001 The authors. Page 380
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
Object-oriented Notice that we do not regard the object oriented database as a viable
database not a competitor to the relational database. The object-oriented database is
candidate too general; it can be used to represent anything and cannot be used
without low-level programming. True competitors to the relational
database will have to restrict their scope to enable effective, high-
level system specification and generation tools. The object-oriented
database has to add a conceptual schema layer to compete with the
relational database.
OOCS Schema is The OOCS Schema controls the composition of the System of
decision tree objects in figure 11.4. The Schema is a kind of decision tree: Given
an object, what are the types of the objects we may attach to it and
what do the users call these parts? One of the possible types is
selected, instantiated, and attached to the object structure.
Advanced reuse based on object instances ©2001 The authors. Page 381
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
document , TreeNode
title , TextLeaf
author , TextLeaf
section , TreeNode
paragraph , TextNode
figure , TreeNode
caption , TextLeaf
picture , PictureLeaf
table , TableNode
BOX: A dream
All living tissues are built from a family of chemical compounds called
proteins. A protein is a complex molecule which is composed of
amino acids. There are just 32 different amino acids, and all forms of
life are composed from these 32 building blocks. (This is the
chemistry aspect, we ignore a host of other aspects.) Now consider
that we were able to create 32 different objects which we could use
to compose data systems as varied as life itself!
The OOCS value The OOram Composition System gives rise to a value chain with four
chain layers as shown in figure 11.6. (FOOTNOTE: Value chains were
discussed in detail in chapter 10.)
Advanced reuse based on object instances ©2001 The authors. Page 382
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
1. End user layer. The end users create value when they add, retrieve,
and remove objects in their OOCS system.
2. OOCS Schema creator layer. The domain analyst who defines an
OOCS Schema may work according to the suggestions given in chapter
7. The results will be expressed as OOCS Schemas rather than role
models, and the implementation will be automatic, as suggested in
figure 11.4. The technical aspects of creating OOCS Schemas will be
discussed in section 11.3.1.
3. OOCS Type implementor layer. An important feature of the OOram
Composition System is that it is truly extensible. Extensions come in the
form of new OOCS Types; they are created by object-oriented
programmers who base their work on the frameworks provided by the
bottom layer. Section 11.3.2 describes the creation of OOCS Types in
general terms.
4. Infrastructure creator layer. The infrastructure needed to support the
OOram Composition System is quite sophisticated. It includes a module
which exports a reusable framework to the OOCS Type implementor;
safe editors for the OOCS Schema creator; a runtime system; and
appropriate composition tools for the end users. The technical details of
this module is a specialized topic which is outside the scope of this
book.
Advanced reuse based on object instances ©2001 The authors. Page 383
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
Problem The Schema Creator is to specify rules for how the end user can
compose object structures from predefined types. The rules
shall be in the form of a decision tree: given an object in a
partially completed structure, the rules shall specify all
extensions permitted from it.
References Necessary prerequisites are OOCS Types for all Entities; a schema
editor that only permits the specification of legal structures; and the
necessary runtime infrastructure including OOram trading for editor
selection and instantiation.
The OOCS Schema Objects are named, instantiated and interconnected according to a
generic object structure or grammar specified in an OOCS Schema.
The Schema is in many ways an object-oriented parallel to the
conceptual schemas used to describe relational databases. Both are
used to model interesting information, and both obey the "100% rule"
which means that the schema contains sufficient information for the
automatic generation of the application program. But there are three
important differences:
Advanced reuse based on object instances ©2001 The authors. Page 384
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
OOCS
Schema
OOCS
Entity
Advanced reuse based on object instances ©2001 The authors. Page 385
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
document
1:1 OOCS Entity isdocument
drawElements cells
Advanced reuse based on object instances ©2001 The authors. Page 386
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
Entity attributes OOCS Entities have a number of attributes which specialize the
OOCS Type. An important attribute is the cardinality; it constrains the
number of permitted instances and is displayed in the diagram as
minimum count : maximum count. We must have exactly one
titlePage with exactly one title. We may have any number of author
objects. author and title belong to the same Group, author objects
can therefore precede and follow the single title object. Notice that
the Schema controls editing operations and does not prescribe all
permissible object structures. Modification of an Entity cardinality will
therefore only influence permissible editing operations and not affect
existing object structures.
We have not shown other attributes here, but real systems will
include attributes for setting default object values, for giving hints
about the printing of the objects, etc.
In a nutshell An OOCS Type is a building block that the end user at his discretion
may instantiate, attach to an object structure and edit. An OOCS
Type instance is illustrated in figure 11.9. It is an object, or a cluster
of objects, with one plug to attach to a socket in the existing object
structure. It may also have one or more sockets for attaching
additional OOCS Type instances. Most of the common OOCS Type
functionality is captured in a framework so that the application
programmer can focus on the application specific problems.
Advanced reuse based on object instances ©2001 The authors. Page 387
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
One plug
for plugging into
existing object structure
OOCS Type
Two levels of There are two levels of semantic correctness in the OOram
semantic Composition System architecture:
correctness
Advanced reuse based on object instances ©2001 The authors. Page 388
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
There are two reasons why we did it this way. One is that we do not
know an algorithm that will intelligently transform an existing object
structure to make it conform to the notions of a new OOCS Schema.
Another is that we do not want to rewrite history. Users may change
their mind about their object structures, but the old structures were
created under the old assumptions and should be retained
unchanged in the archives.
You may want a Our reasons may not be your reasons, and you may want a different
different solution solution. We believe that whatever the solution, the main
responsibility for technical correctness should rest with the
Infrastructure Creator because the implementation of model
conformance is a hard problem which should be solved once and for
all.
Syntactically correct There is a large subset of all object structures that will operate
programs do not without error. Their objects will receive messages as needed, and
crash messages sent to collaborators will be handled correctly. We say that
these systems are syntactically correct; the word syntax here
alludes to the composition of OOCS Type instances.
A name denotes an The plugs and sockets of figure 11.9 are typed to ensure syntactic
OOCS Type correctness. In our implementation, the OOCS Types are given
unique names, and the OOCS Type implementor is fully responsible
for ensuring that plugs and sockets with compatible names can be
safely connected. Other schemes could be based on message
signatures or mathematical descriptions of the interactions, but we
elected to keep our scheme as simple as possible.
Advanced reuse based on object instances ©2001 The authors. Page 389
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
TreeObject
| TreeNode
| | DrawNode
| TextLeaf
| DrawElement
Figure 12.10 Example | | DrawCircle
OOCS Type hierarchy
| | DrawLine
| TableNode
OOCS Schema The OOCS Schema assumes that all objects are organized within a
defines tree structure tree structure. The role model is shown in figure 11.11. We see that
the root object of a permissible structure must be able to play the
Parent role, the leaf objects must be able to play the Child role, and
all intermediate objects must be able to play both roles.
Parent
dw
up
Figure 12.11 The
Schema base model Child
Advanced reuse based on object instances ©2001 The authors. Page 390
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
OOCS Types All OOCS Types are derived from the Schema base model. The role
derived model for a drawing application may, for example, be derived from
the base model as illustrated in figure 11.12. The base model is first
used to synthesize the up plug of the DrawNode, and then applied
again to synthesize the the relation between the DrawNode and its
DrawElements.
TreeNode
dw
Parent
up
dw
DrawNode
up
dw
Child
up
Figure 12.12 The
Schema base model DrawElement
OOCS Type The OOCS Type Creator writes a class for each OOCS Type, and
implementor must makes the type known in a class initialization message. He also
declare socket types declares the names and types of the sockets as exemplified in figure
11.13. (SN denotes Schema Group name, CT denotes OOCS Type
name):
TreeObject
| TreeNode
SN subNodes CT TreeObject
| TextLeaf
| DrawNode
SN drawElements CT DrawElement
| DrawElement
| | DrawLine
Figure 12.13 Example | | DrawCircle
OOCS Type structure
| TableNode
SN cells CT TreeNode
Advanced reuse based on object instances ©2001 The authors. Page 391
February 8, 2001 10:20 12.3 OOram Composition System (OOCS).
The OOCS Type implementor must make sure that a suitable editor
is available for a new OOCS Type. He may have to program a new
one. This is a separate activity which is basically an application of the
Tool framework described in chapter 9 with a few extensions to
ensure compatibility with the OOCS Schema infrastructure.
Advanced reuse based on object instances ©2001 The authors. Page 392
February 8, 2001 10:20 12.4 Object duplication
BOX: In a nutshell
You may essentially create new objects in one of two ways: you can
create a new instance of a class, or you can create a copy of an
existing master object. While all instances of a class are created
equal, the copy of an object will reflect the state of the master at the
time of duplication. So if you want an object which is exactly as
specified by the programmer, use instantiation. If you want an object
which reflects information accumulated at runtime, use duplication.
System
user
model
System
requirements
model
System
design
model
Master object
structure
System
implementation
Legend:
An alternative way of As computer programmers, we tend to focus on writing code for new
creating new objects programs. But we should not forget that the cheapest and safest way
to produce a particular object structure is to copy a validated master.
Figure 11.14 illustrates this. The master objects are first instantiated
from the relevant classes and processed to give them the required
attributes. The masters are later duplicated and the copied objects
are linked into the system of objects.
Advanced reuse based on object instances ©2001 The authors. Page 393
February 8, 2001 10:20 12.4 Object duplication
The problem A facility for the duplication of selected material is an important part
of almost all user interfaces. Duplication is also a powerful technique
for the production of software; the PC revolution would be
unthinkable without program duplication, packaging and distribution.
In the case study of chapter 12, we argue that the instantiation,
processing, storing and duplication of master object structures will be
an effective technique in the industrial production of customized
software.
Advanced reuse based on object instances ©2001 The authors. Page 394
February 8, 2001 10:20 12.4 Object duplication
The solution The duplication of object structures can pose serious problems to the
programmer, and she may be hard put to create duplication
programs that provide the "obvious" results in in all cases. It is a
problem which nicely illustrates both the power and the weakness of
the distributed nature of object-oriented systems.
The power results from our ability to create programs that are valid
for a wide variety of object structures, and that work correctly with
any object as the selected master. The weakness is that the
algorithm will be distributed among the objects. There is no "main
program" which sees everything and knows everything. Every object
must be able to play the role of a master; every object must be able
to play the role of a subobject that is to be copied together with the
master; every object must be able to play the role of a copy; every
object must be able to play the role of an environment object which is
to remain uncopied. Even seasoned programmers must be prepared
for a nasty surprise when a user attempts to copy an unexpected
substructure.
Advanced reuse based on object instances ©2001 The authors. Page 395
February 8, 2001 10:20 12.4 Object duplication
Advanced reuse based on object instances ©2001 The authors. Page 396
February 8, 2001 10:20 12.4 Object duplication
originPoint
aRectangle
Figure 12.16 cornerPoint
shallowCopy copies aRectangleCopy
the object and retains
all references
unchanged
Heavy lines indicate the original structure; gray lines indicate the shallow
copy.
shallowCopy of a shallowCopy may cause bugs which are hard to track down. In the
Rectangle past, we have experienced trouble with Rectangles which used to
have shallowCopy as its default copy operation. Rectangle objects
have two instance variables as depicted in figure 11.16: origin, which
is a Point object defining the upper left corner, and corner, which is a
Point object defining the lower right corner. shallowCopy of a
Rectangle master object yields a new Rectangle object which shares
the origin and corner objects with the master. Do you see the
possible problem?
BOX: A mysterious Consider that you have a window with a number of views. The
side effect bounds of each view within the window is stored as a Rectangle
object. Open a new window as a copy of the first one. Rearrange the
views of the copied window by modifying the x and y values of the
origin and corner Points of their bounds, e.g., by the code bounds
origin putXY (50, 25). The original window is also rearranged!
Rearrange the views of the window copy by replacing the origin and
corner Points with new Points, e.g., bounds putOrigin ((Point new)
putXY (50, 25)). The original window is unchanged!
The default copy method in class Object, the mother of all classes, is
now as follows:
Object>>copy (copying)
copy
^self shallowCopy postCopy
Advanced reuse based on object instances ©2001 The authors. Page 397
February 8, 2001 10:20 12.4 Object duplication
Object>>postCopy (copying)
postCopy
" Finish doing whatever is required, beyond a shallowCopy, to implement
'copy'.
Answer the receiver. This message is only intended to be sent to the
newly created instance.
Subclasses may add functionality, but they should always do super
postCopy first. "
^self
Rectangle>>postCopy (copying)
postCopy
super postCopy.
origin := origin copy.
corner := corner copy
originPoint
aRectangle
cornerPoint
originPointCop
Figure 12.17 postCopy aRectangleCopy
does "the right thing" cornerPointCo
Heavy lines indicate the original structure; gray lines indicate the copy.
We may not want to We will extend our example slightly to illustrate that an object may
make a copy of all leave certain references unchanged. We color the Rectangle by
instance variables extending the object with two variables: a variable holding a color
index and a variable pointing to a Palette which holds an Array of
colors. The Rectangle gets its color by asking the Palette for the color
corresponding to its color index. We assume that the Palette shall be
shared by the master Rectangle and its copy. The result is illustrated
in figure 11.18 and the code is given below.
Rectangle>>postCopy (copying)
postCopy
super postCopy.
origin := origin copy.
corner := corner copy.
palette := palette.
Advanced reuse based on object instances ©2001 The authors. Page 398
February 8, 2001 10:20 12.4 Object duplication
originPoint
aRectangle
cornerPoint
aPalette
originPointCop
Figure 12.18 postCopy aRectangleCopy
does does not copy a cornerPointCo
shared object
Heavy lines indicate the original structure; gray lines indicate the shallow
copy.
Copying a part of a This algorithm treats a directed graph roughly as a tree structure with
directed graph cross-references. It assumes that we know how to start from a given
root object and traverse the structure to find all objects that shall
always be copied. It further assumes that with this knowledge
available, we can identify the pointer variables that need to be
modified. The algorithm is similar to postCopy, except that we now
collect all copied objects before finalizing the operation.
Advanced reuse based on object instances ©2001 The authors. Page 399
February 8, 2001 10:20 12.4 Object duplication
B C
D E F G
B*
Advanced reuse based on object instances ©2001 The authors. Page 400
February 8, 2001 10:20 12.4 Object duplication
Revisiting the We could use this algorithm to duplicate the colored rectangle
colored rectangle discussed in the previous subsection. The application programmer
has to write the two duplication methods in the ColoredRectangle
class:
ColoredRectangle>>addObjectsToBeCopiedTo: (copying)
addObjectsToBeCopiedTo: objectSet
super addObjectsToBeCopiedTo: objectSet.
objectSet add: origin.
objectSet add: corner.
ColoredRectangle>>completeDuplication: (copying)
completeDuplication: objectDictionary
super completeDuplication: objectDictionary.
origin := objectDictionary at: origin ifAbsent: [origin].
corner := objectDictionary at: corner ifAbsent: [corner].
palette := objectDictionary at: palette ifAbsent: [palette].
colorIndex := colorIndex.
The application The main methods for structure duplication can be defined in class
programmer need Object and need not be modified by the application programmers.
not override the We include a sketch of these methods for your perusal.
framework methods
Object>>structureCopy (copying)
structureCopy
" A client sends this message to obtain a structured copy of the receiver.
"
| objectDictionary |
objectDictionary := IdentityDictionary new.
self collectDuplicatesIn: objectDictionary.
objectDictionary values do:
[:copiedObject | copiedObject completeDuplication: objectDictionary].
Advanced reuse based on object instances ©2001 The authors. Page 401
February 8, 2001 10:20 12.4 Object duplication
Object>>collectDuplicatesIn: (copying)
collectDuplicatesIn: objectDictionary
objectDictionary at: self put: self shallowCopy.
objectSet := IdentitySet new.
self addObjectsToBeCopiedTo: objectSet.
objectSet do: [:subObject | subObject collectDuplicatesIn:
objectDictionary].
Object>>addObjectsToBeCopiedTo: (copying)
addObjectsToBeCopiedTo: objectSet
^self
Object>>completeDuplication: (copying)
completeDuplication: objectDictionary
^self
A D
original
B E
copyA copyD
copyB copyE
deepCopy
Figure 12.20
deepCopy copies the copyC
object and all its
references recursively
| arr |
arr := Array new: 1.
Advanced reuse based on object instances ©2001 The authors. Page 402
February 8, 2001 10:20 12.4 Object duplication
Advanced reuse based on object instances ©2001 The authors. Page 403
February 8, 2001 10:20
Chapter 13
Case study: A Value Chain for Intelligent Network
Services
This chapter is written for the specially interested person with a
programming background. It illustrates the technical and
organizational aspects of a specific value chain in some detail. We
start by presenting an example target system, and describe its
objects and execution processes. We then discuss each layer in turn.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 404
February 8, 2001 10:20 13.1 A simple case with an extensible solution
In a nutshell
Providing telecommunication services is a very large operation with
many actors. This case study describes a possible value chain and
fills in details for a plain telephone service. We populate each of the
six layers in the value chain and choose appropriate technology for
each layer.
User Layer
Subscriber Layer
The work processes on the User layer are determined by the user's
tasks and are outside the scope of this discussion.
2. Subscriber layer. The Subscriber is the party who purchases a set of
services on behalf of one or more Users, who pays for them, and who is
responsible for making the services available to his or her users. In
private households, the Subscriber is the User who enters into contract
with the telecommunications provider and who pays the bills. In
businesses, the Subscriber will often be a facilities manager. The
personal profile of the Subscriber is similar to the User profile, but the
professional Subscriber may require somewhat more sophisticated
facilities. The success criterion of the Subscribers is that the Users get
to create their value, effectively and effortlessly.
The work processes on the Subscriber layer are outside the scope of
this discussion.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 405
February 8, 2001 10:20 13.1 A simple case with an extensible solution
The main work processes on the Service Creator layer will involve
collecting and analyzing market intelligence; specifying and defining
products; and creating relevant documentation.
5. Service Constituent Creator layer. The Service Constituent Creator is
a party who has a license for producing software building blocks that
may be configured into IN services. These software building blocks,
called Service Constituents, are the reusable components used by the
Service Creator to create service software. The typical Service
Constituent Creator person is a computer programmer specialized in
some technical aspect of IN Services. The Service Constituent Creator
will build on the results of the Network Providers and other Service
Constituent Creators, and will understand how these results can be
applied to the problems at hand. The success criterion will be that the
Service Creators can create all the services that are needed in the
market, and that the service constituents are simply presented to the
Service Creators so that they can focus on the market and the products
rather than the technology.
The main work processes on the Service Constituent Creator layer will
be crafted after some software life cycle model such as the waterfall
model or the spiral model [Boehm 88].
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 406
February 8, 2001 10:20 13.1 A simple case with an extensible solution
The main work processes on the Network Provider layer will be crafted
to support the creation of very large, ultrareliable, distributed
communication systems.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 407
February 8, 2001 10:20 13.1 A simple case with an extensible solution
All reuse It was interesting and instructive to discover that all our reuse
technologies needed technologies found their proper place in the IN Service value chain.
for IN Services The highlights can be summarized as follows:
An initial system We illustrate the nature of the IN value chain through a system that
was demonstrated at TINA-93 [Ree 93]. The system was designed
so that its operation could be demonstrated on a computer screen.
The running system consisted of 18 objects -- ridiculously simple in
terms of telecommunications technology, but sufficient to illustrate
how we match actors and technology in the IN value chain.
The Plain Old The service in our initial system is what is affectionately known as
Telephone service POTS -- Plain Old Telephone Service. Person-A wants to establish a
telephone conversation connection to Person-B. It is the
responsibility of the service to establish the connection between the
parties. The service is dormant while A and B converse. The service
is again activated to take down the connection and arrange for
charging when the conversation is complete. Our system focus on
the first phase: establishing the connection.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 408
February 8, 2001 10:20 13.1 A simple case with an extensible solution
Invocation Manager A single object called InvocationManager, #102 InvMngr, is the main
and Invocation point of contact with the Service Domain for all Users. This object
Analyzer are the delegates the management of each User's affairs to an Invocation
main objects in the Analyzer object associated with each User (#104 Anlz-A and #106
Service Domain Anlz-B). Specifically, an Invocation Analyzer object holds a set of
master service objects that represent all services available to its
User.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 409
February 8, 2001 10:20 13.1 A simple case with an extensible solution
Network
access point Connection
with Point
accessPointID Network
Leg access poin
with
Leg accessPoint
Figure 13.2 A Network
Connection
interconnects any
number of network
access points by Legs
which meet in a
common Connection
Point
18 objects in the The initial object structure is shown in figure 12.3. The Users are
initial system represented by two User objects, #103 User-A and #105 User-B.
#103 User-A is responsible for requesting a service (Tel-A) and
initiating the invocation process, presumably through some user
interface program inside the object. The #105 User-B object is
responsible for accepting or refusing the requested call, as specified
in the Calling Telephone service.
#102
InvMngr
#114 #113
ConPt SwMngr
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 410
February 8, 2001 10:20 13.1 A simple case with an extensible solution
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 411
February 8, 2001 10:20 13.1 A simple case with an extensible solution
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 412
February 8, 2001 10:20 13.2 User layer
In a nutshell
The User is the party who wants to use available services, and who
is responsible for the selection and invocation of a service. The
invocation leads to the creation and installation of a copy of the
relevant objects and the execution of the service. All remaining
parameters must be bound by the User as part of the service
invocation.
Current interfaces The cryptic codes to be used to activate current telephone services
cumbersome are printed on one of the first pages in the telephone directory. A few
examples translated from our local telephone directory:
1. Call Forward Unconditionally (CFU): wait for dialing tone, touch *21*,
touch new number which is to receive call, terminate with #, wait for
acknowledge tone, hang up. To cancel CFU: wait for dialing tone, dial
#21#, wait for acknowledge tone, hang up.
2. Call Forward on Busy (CFB): wait for dialing tone, touch *67*, touch
new number which is to receive call, terminate with #, wait for
acknowledge tone, hang up. To cancel CFB: wait for dialing tone, dial
#67#, wait for acknowledge tone, hang up.
3. Call Forward on no Reply (CFR): wait for dialing tone, touch *61*, touch
new number which is to receive call, terminate with #, wait for
acknowledge tone, hang up. To cancel CFR: wait for dialing tone, dial
#61#, wait for acknowledge tone, hang up.
Invocation by trading In our initial system, an Invocation Analyzer object was allocated to
and object each user. All services available to the User were stored in a library
duplication of master objects in the User's Invocation Analyzer object
(encapsulated aggregation). The Invocation Analyzer was partially
responsible for the following steps in the life cycle model:
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 413
February 8, 2001 10:20 13.2 User layer
User production The User's production facility is defined by the Subscriber. It consists
facilities of an (advanced) telephone which is permanently associated with the
Invocation Analyzer object. The Invocation Analyzer object is loaded
with objects for all services available to the user.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 414
February 8, 2001 10:20 13.3 Subscriber layer
In a nutshell
The Subscriber is the party who purchases a set of services on
behalf of one or more users, and is responsible for making the
services available to them. The work of the Subscriber involves
selecting a desired service and making a copy of the relevant objects
available to the User. Some of the service parameters may be bound
as part of this process.
Possible user We assume that the Subscriber has a special terminal with
interface bitmapped display, keyboard and a pointing device. The Subscriber
could, for example, manage service availability to the individual users
through a direct manipulation interface as shown in figure 12.4.
CFU
CFB
Figure 13.4 A possible CFR
Subscriber tool Subscriber Service
This interface has one column for each User and one row for each available
Service. A cross in a cell indicates that the given Service is not available for
the given user, presumably because the User's equipment does not support
it. Other cells are touch sensitive, clicking in the cell causes the
corresponding Service to be activated (checked) or passivated (blank) for
the given User. There is a Customize button for each service which may be
customized through this interface. If the Subscriber wants to customize a
service, he clicks the Customize button which causes a new interface to pop
up. In this case, this interface will probably allow the Subscriber to set the
target for the Switched CFU.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 415
February 8, 2001 10:20 13.3 Subscriber layer
The service are later made available to the Users by duplicating the
service masters, binding parameters, and installing the copies as new
masters in the Users' Service Analyzer objects.
2. Deactivation. A service is made unavailable by removing the
corresponding service objects from the Subscriber manager object and
the Invocation Analyzer objects of all the Subscriber's Users.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 416
February 8, 2001 10:20 13.4 Service Provider layer
In a nutshell
The Service Provider is an actor who is licensed to customize
services and make them available to Subscribers. The Service
Provider selects services and service variants, and commands the
instantiation of the necessary objects and their installation in the
Subscriber's management object. (Directly into the User's invocation
analyzer object in our initial system, which does not have a
Subscriber layer.)
Possible user The main responsibility of the Service Provider layer is to define
interface Subscribers and their services. An appropriate medium for this
information is a Service Contract Document, which may be printed
(and signed), and which may be executed to cause the installation of
the Subscribers and their services in the Service Domain.
The initial tool for creating this document is the intelligent editor
shown in figure 12.5. It permits the Service Provider to create any
and all permissible service variants, but which automatically prevents
the creation of illegal combinations.
The tool edits a tree The tool in figure 12.5 is in two parts: The left margin gives a
structured model graphical representation of the structure. The rectangular symbols
are OOCS Entities, they represent the kind of object shown to the
right. The small, black triangles represent insertion points, they
indicate where the user can insert additional objects. An insertion
point only permits the insertion of new objects which are appropriate
at that point in the structure as specified in the OOCS schema.
(FOOTNOTE: See the following section.)
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 417
February 8, 2001 10:20 13.4 Service Provider layer
Figure 12.5 shows the editor when the Service Provider is defining
the Tel-B service. The specification says that the network access
points with IDs 222, 333, 444 are to be selected in a round robin
fashion Monday through Friday between 08:00 and 16:00. The
hidden call forward selector specifies that all day Saturday and
Sunday, incoming calls are to be forwarded to the User with userID
5601. In all other cases, the call is to be received in the default
Access Point with accessPointID 222.
The Service The Service Creator will need a powerful personal computer with
Creator's production suitable software for supporting the intelligent editor, printing and
facilities administrative management of contracts, and automatic
communication for operations such as service installation. The user
interface, as described here, is based on the object trading
technology described in chapter 11.2. The Service Creator specifies
a OOCS Schema that defines all permissible services. OOCS
Schemas were discussed in chapter 11.3.
A sample contract Figure 12.6 shows a sample contract document from the initial
document system. More work is needed to make it into something that could be
used in a real IN service marketing operation.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 418
February 8, 2001 10:20 13.4 Service Provider layer
The Teleshop
Date of issue: 22 September 1993
Subscriber Service Contract
Teleshop, Gaustadalléen 21, N-0371 Oslo 3 Norway. Tel. + (47) 22 95 86
Subscriber name: Manufacturer Inc
Billing address: Drammensveien 1; Oslo
Subscriber service ID: 56
Subscriber Access Point IDs #(111 222 333 444 555 666 )
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 419
February 8, 2001 10:20 13.5 Service Creator layer
In a nutshell
The Service Creator is a party who has a license for producing
telecommunications service software to be made available for
installation in the telecommunications network. The Service Creator
creates an OOCS Schema that defines a family of services, and
possibly specializes their names and some service parameters to suit
the Service Provider.
The Service Creator The OOram Composition System (OOCS) was described in chapter
specifies all 11.3. Figure 12.7 shows the condensed OOCS Schema for our
permissible services system, and figure 12.8 shows the extended schema.
document
0:1
Text Conn-A-Data
0:N 1:1 Text Conn-B-Data
0:N 1:1
AP-Selector CF-Selector
0:N 0:N
Figure 13.7
Condensed OOCS
Schema
Name of Entity in first line. Cardinality constraints in second line: minimum count :
maximum count.
Condensed OOCS Figure 12.7 says that a document (i.e., a contract) consists of any
Schema shows number of Text objects, exactly one SubscrData object, and any
service semantics number of User objects. The specification of a User consists of any
number of Text objects, exactly one User-Data object, and and any
number of different services. The services offered here are Tel-A and
Tel-B; each is specified with describing Text objects and certain
attributes (Tel-A-Data and Tel-B-Data). Tel-B-Data may optionally be
modified with one or more Access Point Selectors (AP-Selector)
and/or Call Forward Selectors (CF-Selector).
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 420
February 8, 2001 10:20 13.5 Service Creator layer
Groups in expanded The expanded OOCS Schema includes groups and types as shown
OOCS Schema in figure 12.8. Groups, which are shown with thin outline in the figure,
constrain cardinality control the legal sequence of objects, and also the total number of
and object sequence objects within a group.
There are two entities under the group UserDef: Text and User-Data.
The cardinality of Text is here 0:N, so there can be any number of
Text objects. The cardinality of User-Data is 1:1, so there must be
exactly one User-Data object. Since these two entities are in the
same group, there may be any number of Text objects before and
after the User-Data object. The cardinality of a group constrains the
total number of objects in that group. So if cardinality of the User-Def
group had been 1:2, there could have been at most one Text object
which could come before or after the User-Data object.
Types form bridge We need eight OOCS Types to implement the schema of figure 12.8:
from OOCS Schema Text, SubscrInstall, Section, UserInstall, Tel-A, Tel-B, AP-Sel, and
to implementation CallForw.
Section and Text are very general types which can be reused in a
great many circumstances. The conditional types AP-Sel and
CallForw are quite specific, but could conceivably be reused
wherever we needed to select an accessPointID or a userServiceID.
The OOCS Types are created in the next layer down by the Service
Constituent Creator. The Service Creator need only be concerned
about their functionality and can ignore design and implementation
details. The tools will ensure that he can create any legal service
specification and none other.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 421
February 8, 2001 10:20 13.5 Service Creator layer
Contract
Entity 0:1
ServiceContract
Type
Services
UserDef
Group 0:N Group 0:N
Conn-A Conn-B
Text User-Data
Entity 0:N Entity 1:1 Entity 0:1 Entity 0:N
Section
Section
Text UserInstall Type Type
Type Type
Text Conn-B
Text Conn-A
Group 0:N Group 1:1 Group 0:N Group 1:1
Text Conn-B-Data
Text Conn-A-Data
Entity 0:N Entity 1:1 Entity 0:N Entity 1:1
Text Tel-B
Text Tel-A
Type Type Type Type
Condition
Group 0:N
AP-Selector CF-Selector
Entity 0:N Entity 0:N
AP-Sel CallForw
Type Type
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 422
February 8, 2001 10:20 13.5 Service Creator layer
Several Schemas The Service Creator may define different OOCS Schemas for
can be defined different categories of Service providers. One end of the spectrum
could be the clerks in the corner Teleshop who get to use a small
schema, which just permits them to specify the simple services they
learned in their training course. Another end of the spectrum could be
a highly competent customer consultant who gets to use a very
elaborate schema that he knows how to exploit to tailor advanced
services to the needs of his sophisticated customers.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 423
February 8, 2001 10:20 13.6 Service Constituent Creator layer
In a nutshell
The deliverables from the Service Constituent Creator layer are
OOCS Types -- building blocks, which may be composed by the
Service provider under the control of OOCS Schemas as specified by
the Service Creator.
Two kinds of Service In the terminology of the IN industry, a Service may be constructed
Constituents from a number of Service Constituents. In our initial value chain,
services are constructed both by composition and by inheritance, and
have, therefore, two different kinds of Service Constituents: OOCS
Types and OOram Frameworks. The relationships between them is
shown schematically in figure 12.9.
Deliverables from The deliverables from this layer to the Service Creator layer are
this layer are OOCS OOCS Types. They appear in the OOCS Schema of figure 12.8 as
Types OOCS Types, and their nature is discussed in chapter 11.3.2.
Service Creator
layer
OOCS Type
Service Constituent OOCS Type
Service Constituen
Framework and
OOCS Type
Service Constituent
Framework
Service Constituent
Framework
Service Constituent
Figure 13.9 The
internal structure of the Switching Domain
layer delivers Frameworks
Service Constituent
Creator layer
Each box signifies a Service Constituent. Black arrows signify delivery of
OOCS Types to the Service Creator layer for schema composition; the open
arrows signify synthesis relationships.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 424
February 8, 2001 10:20 13.6 Service Constituent Creator layer
A typical object plays Consider object #107-1 Tel-A in the sample object structure of figure
many roles 12.3. This object appears as different roles in a number of different
descriptions:
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 425
February 8, 2001 10:20 13.6 Service Constituent Creator layer
IN Service Service
Layers Information Entities
User
Abst-Tel
Invocation
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 426
February 8, 2001 10:20 13.6 Service Constituent Creator layer
The real module As the system is scaled up towards real size and the service
structure must be specifications are expanded into real services, it will be necessary to
carefully constructed organize the Service Constituents in a large number of modules and
to assign these modules to well defined sublayers within the Service
Constituent Creator layer.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 427
February 8, 2001 10:20 13.7 Network Provider layer
In a nutshell
The Network Provider layer presents the functionality of the actual
switches in a unified, implementation-independent manner to the
Service Domain software, and makes its functionality available to the
Service Constituent Creator in the form of one or more frameworks.
The deliverables The Switching Domain is implemented as a very large, very high
from the Network capacity, very fast, and very reliable heterogeneous distributed real
layer time system. Communication channels are established by
establishing paths between the Users through the switches. Figure
12.11 illustrates how six Users are interconnected through four
switches in a conference connection.
The purpose of the interface between the Switching Domain and the
Service Domain is to hide the distributed nature of the
communication network and to present a simple, abstract model of
the network capabilities.
A1 A2 A3
B1 B2 B3
A
B
C
D
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 428
February 8, 2001 10:20 13.7 Network Provider layer
The Connection One such framework is based on the Connection Control model,
Control model which was briefly described in section 12.1. The distributed switches
are abstracted into a single Connection Point, each communication
channel from a user to this Connection Point is abstracted into a Leg.
The Area of Concern is shown in figure 12.12. The Collaboration
view in figure 12.13.
Figure 13.12
Connection Control --
Area of concern An abstract interface to the Switching Domain which offers
connection functionality in an implementation independent form.
ler cpr
Leg il le ConnPoint
Collaboration view
ConnUser may be specialized, i.e. synthesized with other roles.
Leg and ConnPoint are immutable roles, i.e., roles that cannot be modified
in the derived model. The symbol for immutable roles is a role symbol with a
double boundary as shown in the figure.
As seen from the Service Constituent layer, this model must permit
the specialization of the ConnUser role through synthesis. The Leg
and ConnPoint roles must be immutable because they can not be
modified in the derived models. The model will have been
implemented in the Network Provider layer, and the class
corresponding to ConnUser must be available for subclassing while
the other classes must be immutable. These constraints could, for
example, be imposed by the compiler, or they may be checked by
automatically analyzing the source code.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 429
February 8, 2001 10:20 13.7 Network Provider layer
Frameworks hides We see that the complex realities of the Switching Domain are
Switching Domain effectively hidden in the frameworks offered to the Service
details and protects Constituent Creators. This means that they can focus on their main
integrity goal, which is to create powerful service components, and do not
need to worry about the complex technical details of the switches.
We also see that the frameworks can help enforce various
constraints that are needed to protect the integrity of the switching
network. This is done by insisting that all access to the network is
through validated classes, which may not be modified (subclassed)
by the Service Constituent Creator.
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 430
February 8, 2001 10:20 13.7 Network Provider layer
Case study: A Value Chain for Intelligent Network Services ©2001 The authors. Page 431
February 8, 2001 10:20
Appendix A
The OOram Language
The OOram technology has been developed around an object oriented data base, and the
preferred user tools have task oriented, direct manipulation graphical user interfaces. It is
nevertheless useful to define a textual form for all OOram model information, and it is the
preferred form for some purposes such as documenting interfaces and role attributes.
This appendix defines a first version of the OOram language. The language serves three
purposes:
1. As a summary of the OOram concepts and the relationships between them.
2. As a language for the precise documentation OOram models on paper.
3. As an interchange language for communicating OOram models, e.g. through electronic
mail and between different implementations of OOram
CASE tools.
We present the lexical conventions of the OOram language in Appendix A1, its grammar in
Appendix A2 and its scoping rules in Appendix A3. The OOram semantics is defined in the
main body of this book, particularly in chapters 2.5: Basic OOram role modeling concepts
and notation, 3.3: Basic OOram concepts and notation for role model synthesis, and 6:
Additional role modeling concepts and notation. We shall assume that the correspondence
between the concepts defined there and the constructs of the language defined in the
following will be clear from the chosen keywords etc.
The examples and case studies presented in this book have been specified in the
TASKON/OOram tools, the book itself has been written with the TASKON/OOram
documentation tool, and the diagrams and other OOram views have been automatically
created by the tools. Appendix A4 contains an OOram language specification of the module
which forms the basis of chapter 7: Case study: Development of a business information
system, and A5 is similarly the specification of a module which includes some of the models
of chapter 3: Role model synthesis.
A text describing an OOram model in the OOram language will be called an OOram
specification.
A1 Lexical conventions
This section presents the lexical conventions of the OOram language, defining the structure
of the tokens used, and the correspondence between a sequence of tokens and how it can be
described by a string of characters.
The OOram language uses the ISO Latin-1 character set [ISO8859.1]. This character set is
divided into alphabetic characters (letters), digits, graphic characters, the Space (blank)
character and formatting characters (CR, LF, FF, and TAB).
If the input character string has been parsed into a token up to a given character, then any
following spaces, formatting characters and comments (see below) will be skipped.
Thereafter the next token is taken to be the longest string of characters that could possibly
constitute a token.
Comments can occur anywhere between tokens. The characters /* start a comment, and it is
terminated with the characters */. Comments do not nest. Comments may contain alphabetic,
digit, graphic, space, and formatting characters. We recommend the convention that
comments are printed in an italic font, but this has no formal significance.
The language uses the following kinds of tokens: separators, keywords, identifiers, string
literals, and integer literals.
A1.1 Separators
| ( ) , :: <- >> \n
A1.2 Keywords
The words listed in table A2 are the keywords of the language. Upper and lower case letters
are considered equivalent in keywords. For example, module, Module, and MODULE are all
considered equivalent. We recommend the convention that keywords are printed in a bold
font, but this has no formal significance.
Table A2 Keywords
A1.3 Identifiers
Symbol Meaning
::= is defined to be
| alternatively
<text> a normal non-terminal
<TEXT> a non-terminal indicating a token of the given category
"text" the text directly identifies a keyword or separator
* the preceding syntactic unit can be repeated zero or more times
+ the preceding syntactic unit can be repeated one or more times
{} The enclosed syntactic units are grouped as a single syntactic unit
[] The enclosed syntactic unit is optional -- may occur zero or one time
Table A3 The symbols of the OOram Extended Backus-Naur format and their meaning.
A3 Scope of identifiers
As explained earlier, some occurrences of identifiers in an OOram specification serve to
associate that identifier with the entity described by the corresponding language construct.
This association will have effect throughout the closest surrounding "scoping construct" in
which the definition occurs (also textually in front of the definition). Thus, from within its
scoping construct an entity may be referenced directly by its identifier. By using "scoped
names" entities may also be referenced from outside their scoping construct. The scoped
name x::y should be understood as the entity named x defined local to the scoping construct
named y.
The syntactical units that qualify as scoping constructs are the following: Modules,
role_models, interfaces, messages, and roles. In the grammar above these constructs are
identified by their initial keyword, and they are always nested as indicated in figure A1. In
this figure we have also indicated what name-types are local to the different scoping
constructs. Note that the name of a scoping construct is itself local to the nearest enclosing
scoping construct.
Local to one scoping construct, no two entities can be identified by the same name. However,
local to two different scoping constructs the same names may be used, even if they are
nested. A referencing occurrence of a name will always identify the entity with that name
local to the nearest possible enclosing scoping construct.
<module_name>
"module"
<rm_name>
"role_model"
<interface_name>
<role_name>
<scenario_name>
When an OOram model is represented as a structure of objects, the different entities are
identified by their object identifiers. The names that users assign to the entities help the users
understand the models, but have no formal significance.
If the model is used to generate code in a programming language, the names are used to
generate identifiers in the selected programming language. The wise analyst will then use
entity names that may be used unchanged as program identifiers to make the relationship
between model and program as evident as possible. Our modeling tools support this by
warning the analyst if a chosen name does not conform to the syntax and pragmatics of the
chosen language. The tools will also warn the analyst about duplicate names which would
cause compilation errors if used unchanged.
When an OOram model is represented as a string of characters, we could have retained the
object identifiers as the real identifiers of the different entities. These identifiers are typically
quite unreadable to a human, and the OOram language is designed so that the entities are
identified by their names. The kind of entity determines the scope of these names as
illustrated in figure A1.
task 'authorizedExpenseReport:'
explanation "<Check> <Bookkeeping>"
in 'ENTBookkeeper'
entity 'paymentRequest:'
data ( aPaymentRequest )
task 'paymentRequest:'
explanation "<Arrange for payment>"
in 'ENTPaymaster'
flow 'stimulus' >>'travelPermissionRequest:' >> ( 'travelPermissionRequest:' )
flow 'travelPermissionRequest:' >>'travelPermission:' >> ( 'travelPermission:' )
flow 'travelPermission:' >>'expenseReport:' >> ( 'expenseReport:' )
flow 'expenseReport:' >>'authorizedExpenseReport:' >> ( 'authorizedExpenseReport:' )
flow 'authorizedExpenseReport:' >>'paymentRequest:' >> ( 'paymentRequest:' )
import 'Travel Expense Enterprise Model' <- 'Travel Expense Enterprise Model' :: 'Work Environments'
role_model 'BasicTree'
explanation "A role model describing a basic tree structure."
interface 'Child<Mother'
message synch 'preorderTraverse:' param 'aBlock'
message synch 'postorderTraverse:' param 'aBlock'
message synch 'getLeaves'
interface 'Mother<Child'
message synch 'getRoot'
role 'Mother'
port many 'dw' interfaces ( 'Child<Mother')
role 'Child'
port one 'up' interfaces ( 'Mother<Child')
role_model 'ThreeLevelTree'
explanation "A role model describing a tree structure with three levels."
base_model 'BasicTree'
'Mother' -> 'Node'
'Child' -> 'Leaf'
base_model 'BasicTree'
'Mother' -> 'Root'
'Child' -> 'Node'
role 'Root'
port many 'dw'
role 'Node'
port one 'up'
port many 'dw'
role 'Leaf'
port one 'up'
role_model 'DerivedTravelExpense'
explanation "The area of concern is the procedure for travel management including the purchase of tickets."
base_model 'AirlineBooking'
'ABBookKeeper' -> 'DTEBookKeeper'
'ABTravelAgent' -> 'DTETravelAgent'
'ABBookingClerk' -> 'DTEBookingClerk'
'ABPaymaster' -> 'DTEPaymaster'
'ABTraveler' -> 'DTETraveler'
base_model 'Travel Expense Enterprise Model'
'ENTPaymaster' -> 'DTEPaymaster'
'ENTAuthorizer' -> 'DTEAuthorizer'
'ENTTraveler' -> 'DTETraveler'
'ENTBookkeeper' -> 'DTEBookkeeper'
role 'DTETraveler'
explanation "The person who travels."
stimulus 'travelPermissionRequest:' :: 'ENTAuthorizer<ENTTraveler'
response_msgs ( 'paymentRequest:' :: 'ENTPaymaster<ENTBookkeeper' )
attributes_changed ( )
port one 'sec' interfaces ( 'ABBookingClerk<ABTraveler')
port one 'au'
role 'DTEBookingClerk'
explanation "Clerk responsible for managing the purchase of tickets."
port one 'bk' interfaces ( 'ABBookKeeper<ABBookingClerk')
port one 'tr' interfaces ( 'ABTraveler<ABBookingClerk')
port one 'ta' interfaces ( 'ABTravelAgent<ABBookingClerk')
role 'DTEBookKeeper'
explanation "The person responsible for bookkeeping. Responsible for accounting."
port one 'pm' interfaces ( 'ABPaymaster<ABBookKeeper')
role 'DTETravelAgent'
explanation "A travel agent."
port one 'cust' interfaces ( 'ABBookingClerk<ABTravelAgent')
role 'DTEPaymaster'
explanation "The person responsible for reimbursement. Cashier."
port one 'ven' interfaces ( 'ABTravelAgent<ABPaymaster')
role 'DTEAuthorizer'
explanation "The person who authorizes the travel."
port many 'tr'
port one 'bo'
process 'ExpenseAccount Process diagram'
task stimulus 'stimulus' explanation "Desire to travel" in 'DTETraveler'
entity 'travelPermissionRequest:' data ( aTravelPermission )
task 'travelPermissionRequest:' explanation "<Determine OK>" in 'DTEAuthorizer'
entity 'travelPermission:' data ( aTravelPermission )
task 'travelPermission:' explanation "<Order tickets>" in 'DTETraveler'
task stimulus 'planTravel' explanation "Order tickets" in 'DTETraveler'
entity 'Travelspecification1' data ( ticketSpecification )
task 'orderTicket' explanation "Order tickets" in 'DTEBookingClerk'
entity 'Travelspecification2' data ( ticketSpecification )
task 'issueTickets' explanation "Issue tickets. Prepare invoice." in 'DTETravelAgent'
entity 'TicketsAndInvoice' data ( aTicket )
task 'processTickets' explanation "Process tickets and invoice" in 'DTEBookingClerk'
entity 'TicketsAndCost' data ( tickets and cost information )
task 'noteCost' explanation "<Note cost> <Travel> <Prepare expense account>" in 'DTETraveler'
entity 'Authorizedinvoice' data ( anInvoice )
task 'processInvoice' explanation "Process invoice" in 'DTEBookKeeper'
entity 'RemunerationRequest' data ( anInvoice )
task 'pay' explanation "Send payment" in 'DTEPaymaster'
entity 'Payment' data ( aCheque )
task 'receivePayment' explanation "Receive payment" in 'DTETravelAgent'
entity 'expenseReport:' data ( anExpenseReport )
task 'expenseReport:' explanation "<Check OK>" in 'DTEAuthorizer'
entity 'authorizedExpenseReport:' data ( anExpenseReport )
task 'authorizedExpenseReport:' explanation "<Check> <Bookkeeping>" in 'DTEBookkeeper'
entity 'paymentRequest:' data ( aPaymentRequest )
task 'paymentRequest:' explanation "<Arrange for payment>" in 'DTEPaymaster'
flow 'stimulus' >>'travelPermissionRequest:' >> ( 'travelPermissionRequest:' )
flow 'travelPermissionRequest:' >>'travelPermission:' >> ( 'planTravel' )
flow 'planTravel' >>'Travelspecification1' >> ( 'orderTicket' )
flow 'orderTicket' >>'Travelspecification2' >> ( 'issueTickets' )
flow 'issueTickets' >>'TicketsAndInvoice' >> ( 'processTickets' )
flow 'processTickets' >>'TicketsAndCost' >> ( 'noteCost' )
flow 'processTickets' >>'Authorizedinvoice' >> ( 'processInvoice' )
flow 'processInvoice' >>'RemunerationRequest' >> ( 'pay' )
flow 'pay' >>'Payment' >> ( 'receivePayment' )
flow 'noteCost' >>'expenseReport:' >> ( 'expenseReport:' )
flow 'expenseReport:' >>'authorizedExpenseReport:' >> ( 'authorizedExpenseReport:' )
flow 'authorizedExpenseReport:' >>'paymentRequest:' >> ( 'paymentRequest:' )
Appendix B
References
[Alexander 77] Christopher Alexander: A Pattern Language. Oxford University Press, New
York, 1977.
[Alexander 79] Christopher Alexander: The Timeless Way of Building. Oxford University
Press, New York, 1979.
[E. Andersen 92] Egil P. Andersen, Trygve Reenskaug: System Design by Composing
Structures of Interacting Objects. ECOOP '92, Utrecht, Holland.
[And 91] Jørn Andersen, Trygve Reenskaug: Operations on sets in an OODB. OOPS
Messenger, 2, 4 (October 1991) pp. 26-39.
[Aronson 72] Elliot Aronson: The Social Animal. W. H. Freeman and Company, San
Francisco 1972. ISBN 0-7167-0829-9
[Beck 86] O'Shea, T., Beck, K., Halbert, D., Schmucker, K. J. Panel on "The learnability of
Object-Oriented Programming Systems". SIGPLAN Notices, 21, 11 (November 1986) p. 503.
[Beck 94] Kent Beck, Ralph Johnson: Patterns Generate Architectures. In: Tokoro, Pareschi
(Eds): 8th European Conference on Object-Oriented Programming (ECOOP 94). Springer
Verlag, 1994.
[Bent 86] See for example John Bentley: "Programming Pearls". Comm. ACM 29,5 (May
1986) p364-369 and Comm. ACM 30,4 (April 1987) p384-290.
[Boehm 88] Barry W. Boehm: A Spiral Model of Software Development and Enhancement.
Computer, May 1988, pp 61-72.
[Booch 94] Grady Booch: Object-Oriented Analysis and Design with Applications. Second
edition. The Benjamin/Cummings Publishing Company. ISBN 0-8053-5340-2
[Broc94] Kraig Brockschmidt: Inside OLE2. Microsoft Press, 1994, 977 pages
[Bræk 93] Rolv Bræk, Øystein Haugen: Engineering Real Time Systems. An object oriented
methodology using SDL. Hemel Hempstead: Prentice Hall, 1993. ISBN 0-13-034448-6
[CCITT Z120] Message Sequence Charts. Recommendation Z120. Geneva, ITU 1993.
[Chambers 89] Craig Chambers, David Ungar, Elgin Lee: An Efficient Implementation of
Self, a Dynamically-Typed Object-Oriented Language Based onPrototypes. OOPSLA '89.
Sigplan Notices 24, 10 (October 1989)
[Chen 76] P. Chen: The Entity Relationship Model -- Toward a Unified View of Data. TODS,
1,1 (March 1976)
[CORBA 91] The Common Object Request Broker: Architecture and Specification. Object
Management Group Document Number 91.12.1, Revision 1.1 (Draft 10 December 1991)
[Coul88] George F. Couloris, Jean Dollimore: Distributed Systems - Concepts and Design.
Addison-Wesley, 1988, 366 pages
[Engelbart 67] William K. English, Douglas C. Engelbart, and Melvyn L. Berman: Display-
Selection Techniques for Text Manipulation. IEEE Transactions on Human Factors in
Electronics, Vol. HFE-8, No. 1, March 1967, pp. 5-15.
[Ewing 92] Juanita Ewing: How to use class variable and class instance variables. The
Smalltalk Report, 1, 5 (January 1992) p 13
[Gabriel 94a] Richard P. Gabriel: Pattern languages. JOOP, January 1994, pp 72-75.
[Gabriel 94b] Richard P. Gabriel: The failure of pattern languages. JOOP, February 1994, pp
84-88.
[GaHeJoVli 95] Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides: Design
Patterns. Elements of Reusable Object-Oriented Software. Addison-Wesley 1995. ISBN 0-
201-63361-2
[Gazz 88] M. S. Gazzaniga: Mind Matters. Houghton Miffin Co., Boston 1988. ISBN 0-395-
42159-4
[Gold 83] A. Goldberg, D. Robson: "Smalltalk-80, The Language and its Implementation".
Addison-Wesley 1983. ISBN 0-201-11371-6.
[HallFagan] Hall, Fagan: General Systems, Yearbook of the Society for General Systems
Research, Ann Arbor, Michigan, Vol. I-X, 1956-65
[Harel 87] David Harel: Satecharts: a visual formalism for complex systems. Science of
Computer Programming 8 (1987) pp 231-274. Elsevier Science Publishers (North Holland)
[Helm 90] Richard Helm, Ian M. Holland, Dipayan Gangopadhyay: Contracts: Specifying
Behavioral Compositions in Object-Oriented Systems. Sigplan Notices 25 10
(ECOOP/OOPSLA '90, Oct 1990)
[Hol 77] Erik Holbæk-Hanssen, Petter Håndlykken, Kristen Nygaard: System Description
and the Delta Language. Norwegian Computing Center publication no. 523. Second printing,
Oslo 1977.
[IDEF0 93] Software standard Integration Definition for Function Modeling (IDEF0).
Federal Information Processing Standards Publication 183, 1993. Obtainable from National
Technical Information Service, U.S. Department of Commerce, Springfield, VA 22161.
[ISO9000] ISO 9000, Quality management and quality assurance standards -- Guidelines for
selection and use. ISO 9001, Quality systems -- Model for quality assurance in
design/development, production, installation and servicing. International Standardization
Organization
[Jacobson 92] Ivar Jacobson, Magnus Christerson, Patrick Jonsson, Gunnar Øvergaard:
Object-Oriented Software Engineering. A Use Case Driven Approach. Addison-Wesley
1992. ISBN 0-201-54435-0
[John 88] Johnson, R.E., Foote, B. "Designing Reusable Classes". Journal of Object-Oriented
Programming, 1, 2 (June/July 1988), 22-25.
[Johnson 92] Ralph E. Johnson: Documenting Frameworks using Patterns. OOPSLA '92.
ACM Sigplan notices, 27, 10 (Oct 92) pp 63-68
[KerPla 74] Kernighan and Plauger: The Elements of Programming Style. McGraw-Hill
1974. ISBN 0.07-034199-0
[Lieb 89] Karl J. Lieberherr, Ian M. Holland: Assuring Good Style for Object-Oriented
Programs. IEEE Software, Sept 89, pp 38-48.
[Liskov 88] Liskov, Barbara: Data Abstraction and Hierarchy. SIGPLAN Notices 23,5 (May
1988)
[Love 93] Tom Love: Object Lessons. SIGS Books, New York 1993. ISBN 0-9627477-3-4.
[Martin 87] James Martin: Recommended Diagramming Standards for Analysts and
Programmers: A Basis for Automation. Prentice-Hall, Englewood Cliffs, NJ 1987 (ISBN 0-
13-767377-9 025).
[Nordhagen 89] Else Nordhagen: Generic Object Oriented Systems. Proceedings of Tools 89,
Paris November 1989 (pp. 131-140)
[Nordhagen 95] Else K. Nordhagen: The COIR architecture for Flexible Software
Components and Systems. Research report no. 197 (1995), Department of Informatics,
University of Oslo. ISBN 82-7368-108-4
[Oftedal 87] Gro Oftedal: The use of remote applications from a Smalltalk work station.
[Link]. thesis, Dept. of Informatics, University of Oslo, January 1987.
[Olle 88] T. William Olle, Jaques Hagelstein, Ian G. Macdonald, Colette Rolland, Henk G.
Sol, Frans J. M. Van Assche, Alexander A. Verrijn-Stuart: Information Systems
Methodologies. A Framework for Understanding. Addison-Wesley 1988. ISBN 0-201-
41610-7.
[Oxford 86] Oxford Dictionary of Computing. Oxford University Press 1986. (ISBN 0 19
853913 4)
[Parnas 86] David Lorge Parnas, Paul C. Clements: A Rational Design Process: How and
Why to Fake It. IEEE Trans. on Software Engineering. SE-12, 2 (February 1986).
[Ree 73] Trygve Reenskaug: Administrative Control in the Shipyard. ICCAS Conference,
Tokyo 1973.
[Ree 77] Trygve M. H. Reenskaug: Prokon/Plan - A Modelling Tool for Project Planning and
Control. IFIP Conference, North-Holland 1977.
[Ree 89] Trygve Reenskaug, Anne Lise Skaar: An Environment for Literate Smalltalk
Programming. Sigplan Notices 24 10 (Oct 89) OOPSLA 89 pp 337-345
[Ree 92] Trygve Reenskaug, Egil P. Andersen, Arne Jørgen Berre, Anne Hurlen, Anton
Landmark, Odd Arild Lehne, Else Nordhagen, Eirik Næss-Ulseth, Gro Oftedal, Anne Lise
Skaar, Pål Stenslet: OORASS: Seamless Support for the Creation and Maintenance of
Object-Oriented Systems. Journal of Object-Oriented Programming, October 1992, pp 27-41.
[Ree 93] T. Reenskaug: The Industrial Creation of Intelligent Network Services. TINA '93 -
The Fourth Telecommunications Information Networking Architecture Workshop, L'Aquila,
Italy, September 1993. Proceedings from Scuola Superiore G. Reiss Romoli S.p.A.; Str. Prov.
per Coppito km 0,300; 67010 Coppito (AQ); Italy.
[Rubin 92] Kenneth S. Rubin, Adele Goldberg: Object Behavior Analysis. Comm. ACM, 35,
9 (Sept. 92) pp 48-62
[Rumbaugh 91] James Rumbaugh, Michael Blaha, William Premerlani, Frederick Eddy,
William Lorensen: Object-Oriented Modeling and Design. Prentice-Hall 1991. ISBN 0-13-
630054-5
[Soukup 94] Jiri Soukup: Taming C++. Pattern classes and Persistence for Large Projects.
Addison-Wesley 1994. ISBN 0-201-52826-6
[Stenslet 82] Pål Stenslet: Spørresystem basert på Smalltalk (Query system based on
Smalltalk). MSc thesis, Department of Informatics, University of Oslo, 1982
[Strou 86] Bjarne Stroustrup: The C++ Programming Language. Addison-Wesley 1986.
ISBN 0-201-12078-X.
[Verr 91] M. Verrall: The Software Bus - its objective: the mutual integration of distributed
software engineering tools. Proc. 5th Conf. on Software Engineering Environments,
Aberystwyth, March 1991, Ellis Horwood 1991.
[Vestli, Nilsen 92] Vestli, Nilsen: The Intelligent Network Service Life Cycle. Telektronikk
2.92 (Norwegian Telecom Research, P.b. 83, 2007-Kjeller, Norway)
[Weinb 71] Gerald M. Weinberg: The Psychology of Computer Programming. Van Nostrand
Reinhold 1971
[Weinb 75] Gerald M. Weinberg: An Introduction to General Systems Thinking. John Wiley,
1975 (ISBN O-471-92563-2)
[Wheeler 92] John A. Wheeler quoted by John Horgan in: Quantum Philosophy. Scientific
American, July 1992 p 79.
[WiJo 90] Rebecca J. Wirfs-Brock, Ralph E. Johnson: Surveying current research in object-
oriented design.
Communications of the ACM, 33, 9 (September 1990) pp 113 ff.
[Wirth 71] Niklaus Wirth: Program Development by Stepwise Refinement. Comm. ACM 14,
4 (1971) pp. 221-227
Table of contents
Chapter 1 Preface 2
Goals 2
Motivation 2
Audience 4
Background 7
Acknowledgments 8
2.4 Organization 46
4.3 Basic OOram concepts and notation for role model synthesis 129
4.3.1 The Inheritance and Role List views 129
4.3.2 Synthesis in Area of Concern view 132
4.3.3 Synthesis seen in the Environment and Stimulus-Response views 133
4.3.4 Synthesis seen in the Collaboration view 134
4.3.5 Synthesis seen in the Scenario view 136
4.3.6 Synthesis seen in the Interface view 137
4.3.7 Synthesis of method Specification view 138
5.2 The relationship between a role model and its implementation 157
5.2.1 Implementing the roles 158
5.2.2 Implementing the ports and interfaces 163
5.2.3 Implementing the methods and actions 166
Chapter 9 Case study: The analysis and design of a real time system 270
10.5 Fifth step: Document the framework as patterns describing how to 331
solve problems
10.5.1 Pattern 1: The Tool 331
10.5.2 Pattern 2: Fixed Proportion Tool Layout 333
10.5.3 Pattern 3: Flexible Tool Layout 334
10.5.4 Pattern 4: The Controller 335
10.5.5 Pattern 5: The Model Object 336
10.5.6 Pattern 6: The View 337
10.6 Sixth step: Describe the framework's design and implementation 339
entity-relationship 207
environment 57, 88
Executable specifications 293
Execution Scenario report 296
export 224
external collaboration view 93
fire walls 170
Forward engineering 45, 61, 293
framework 31, 200, 201
frameworks 30, 39
Generalization-specialization 112
identity 38, 58
IDL 290
immutable 376, 429
Implementation description 185
import 224
Incidental reuse 177, 178
information environments 229
information hiding 58
Information model 249
Information Service 231
information tool 255
inheritance 64, 152
Inheritance Collaboration view 129, 130
Inheritance Table 129, 131
instance variable 62, 86, 147
instances 147
instantiating 147
interaction 94
interface 85
Interface Definition Language 290
interface view 20, 89, 95, ii
Invocation Analyzer 413
Kernel-Maker 365
late binding 86
Leg 409
legacy system 231
List of Instructions 185
LocalStation1>>accessCode: (LocalStation<Panel) 286
LocalStation1>>timeoutFrom: (LocalStation<Timer) 286
Logical map 185
manifest model 53
mental model 52
messages 87
method 59, 60, 70, 86, 118, 147, 166
Method Specification view 89, 97, ii
method view 21
methodology 13
Microsoft 291
model 319
model creation process 40
Model-View-Controller 318
Modeling in the large: The OOram Module 223, iii
modeling-in-the-large 223
module 36
Module-Maker 365
monitored execution 294
multiple inheritance 29
MVC 318
Network Connection 409
records 37
Rectangle>>postCopy (copying) 398
Relation 207
relational database 249
relations 37
response 89, 91
reusable assets building process 40
reusable components 14
Reverse engineering 45, 61, 293
role 20, 27, 66, 67, 87
role instances 67
Role List view 89, 206, 222, iii
role model 14, 19, 66, 87
role model collaboration view 20
role model instances 67
role model synthesis 14, 23, 113
role model synthesis, 23
role model, 20
safe 99
safe synthesis 25, 118, 214, 219
scenario 70, 94
scenario view 21, 89, 94, ii
semantic correctness 388
Semantic view 89, 206, 207, 208, iii
separation of concern 14, 23
Service 424
Service Constituent 424
Service Constituent Creator 360, 406
Service Constituents 408
Service Creator 360, 406
Service Domain 358
Service Provider 359, 406
shallowCopy 396
single inheritance 29
state 86
state diagram 218
State Diagram view 89, 206, 217, iii
Stimuli 91
stimulus message 59, 89, 118
Stimulus-response view 89, 91, ii
subclass 148
Subscriber 359, 405
subtype relation 207
superclass 148
surface area 203, 223, 302
Switching Domain 358
Synchronous 85
Synchronous deferred 85
syntactically correct 389
synthesis 61, 101, 109, 113
synthesis collaboration view 105
synthesis relation 105
Synthesis view 129
system 56
System Design model 43, 100
system development process 40
System implementation 100
System Implementation model 43
System of objects 381
System Requirements model 43, 100