The Object Primer The Application Developer S Guide To Object Orientation 2nd Ed Edition Scott W Ambler Instant Download
The Object Primer The Application Developer S Guide To Object Orientation 2nd Ed Edition Scott W Ambler Instant Download
https://ebookgate.com/product/the-object-primer-the-application-
developer-s-guide-to-object-orientation-2nd-ed-edition-scott-w-
ambler/
https://ebookgate.com/product/the-primer-of-object-relations-2nd-
ed-2nd-edition-jill-savege-scharff/
ebookgate.com
https://ebookgate.com/product/the-unified-process-transition-and-
production-phases-1st-edition-scott-w-ambler/
ebookgate.com
https://ebookgate.com/product/object-oriented-design-and-patterns-2nd-
edition-cay-s-horstmann/
ebookgate.com
https://ebookgate.com/product/the-use-of-the-object-in-psychoanalysis-
an-object-relations-perspective-on-the-other-david-e-scharff/
ebookgate.com
The principles of object oriented JavaScript Zakas
https://ebookgate.com/product/the-principles-of-object-oriented-
javascript-zakas/
ebookgate.com
https://ebookgate.com/product/modernism-s-other-work-the-art-object-s-
political-life-1st-edition-siraganian/
ebookgate.com
https://ebookgate.com/product/object-oriented-oracle-wenny-rahayu/
ebookgate.com
https://ebookgate.com/product/emotion-and-object-1st-edition-john-r-s-
wilson/
ebookgate.com
Scott W. Ambler
PUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGE
The Pitt Building, Trumpington Street, Cambridge, United Kingdom
http://www.cambridge.org
A catalog record for this book is available from the British Library.
Foreword xvii
Preface xix
Acknowledgments xxiii
Chapter 1 • Introduction 1
1.1 The Structured Paradigm versus the Object-Oriented Paradigm 2
1.2 How Is This Book Organized? 3
1.3 How to Read This Book 5
1.4 What You Have Learned 7
ix
x The Object Primer
Glossary 475
References and Recommended Reading 499
Index 505
Developers are good at building systems right.
Chapter 1
Introduction
1
2 The Object Primer
DEFINITION
Paradigm. (pronounced para-dime) An overall strategy or viewpoint for doing
things. A paradigm is a specific mindset.
Chapter 1 • Introduction 3
Object
Object
Functions
and Data
Procedures Object Object
the real world, students know things (they have names, addresses, birth Figure 1-1.
dates, telephone numbers, and so on) and they do things (enroll in Comparing the
courses, drop courses, and pay tuition). Professors also know things (the structured and
courses they teach and their names) and they do things (input marks and object-oriented
paradigms
make schedule requests). From a systems perspective, rooms know things
(the building they’re in and their room number) and should be able to
do things, too (such as tell you when they are available and enable you
to reserve them for a certain period of time). Courses also know things
(their title, description, and who is taking the course) and should be able
to do things (such as letting students enroll in them or drop them).
To implement this system, we would define a collection of classes (a class
is a generic representation of similar objects) that interact with each other.
For example, we would have “Course,” “Student,” “Professor,” and “Room”
classes. The collection of these classes would make up our application,
which would include both the functionality (the program) and the data.
As you can see, the OO approach results in a completely different view For individuals,
of what an application is all about. Rather than having a program that OO is a whole new
accesses a database, we have an application that exists in what is called way to think.
For organizations,
an object space. The object space is where both the program and the data
OO requires a
for the application reside. I discuss this concept in further detail in Chap- complete change
ter 5 but, for now, think of the object space as virtual memory. in its system
development
culture.
1.2 How Is This Book Organized?
The Object Primer covers leading-edge OO techniques and concepts that
have been proven in the development of real-world applications. It covers
in detail why you should learn this new approach called object orientation,
requirements techniques, such as use cases and CRC modeling, OO
4 The Object Primer
DEFINITIONS
Class. A template from which objects are created (instantiated). Although in
the real world Doug, Wayne, and Bill are all “student objects,” we would model
the class “Student” instead.
Object space. The memory space, including all accessible permanent storage,
in which objects exist and interact with one another.
Object. A person, place, thing, concept, event, screen, or report. Objects both
know things (that is, they have data) and they do things (that is, they have
functionality).
Object-oriented paradigm. A development strategy based on the concept of
building systems from reusable components called objects.
OO. An acronym used interchangeably for two terms: Object-oriented and
object orientation. For example, when we say OO programming, we really
mean object-oriented programming. When we say this is a book that describes
OO, we really mean this it is a book that describes object orientation.
The Object Primer concepts, OO analysis and design using the UML modeling techniques,
covers everything OO programming, OO testing, and the OO software process. The book
you need to know to ends with a discussion of how to continue your learning process, including
get you started in
descriptions of common object-oriented technologies and techniques you
OO development.
might want to consider applying on software projects.
Figure 1-2 depicts the organization of The Object Primer, showing the
individual chapters and the relationships between them. Table 1-1 sum-
marizes the contents of each chapter. On the left side of the diagram are
the chapters that describe the fundamental activities of the software
process, such as gathering requirements, object-oriented analysis, and
object-oriented programming. The arrows between the boxes represent
the general relationships between the chapters: you see the chapters
describing gathering requirements, validating requirements, and object-
oriented analysis are closely related to one another. Chapter 9 covers
object-oriented testing and describes testing techniques that should be
used to validate your analysis, design, and programming efforts. Along
the right-hand side of Figure 1-2 are listed several “supporting” chapters,
chapters that present material that is critical to your understanding of
the object-oriented paradigm.
DEFINITION
Unified Modeling Language (UML). The definition of a standard modeling
language for object-oriented software, including the definition of a modeling
notation and the semantics for applying it as defined by the Object Manage-
ment Group (OMG).
Chapter 1 • Introduction 5
Object-Oriented Object-Oriented
Analysis Concepts
(Chapter 6) (Chapter 5)
Figure 1-2.
The organization of
1.3 How to Read This Book this book
Chapter Description
2: A New Software Paradigm Discussion of the advantages and disadvantages of object ori-
entation, why objects are here to stay, and an overview of the
software process.
10: Object-Oriented Software Process Overview of the Object-Oriented Software Process (OOSP)
and the enhanced lifecycle of the Unified Process.
11: Where to Go From Here Discussion of what you need to do to continue your OO
learning process, including a description of leading object
technologies and techniques such as Java, Enterprise Java-
Beans (EJB), C++, and component-based development.
Chapter 1 • Introduction 7
DEFINITION
Full lifecycle object-oriented testing (FLOOT). A testing methodology for
object-oriented development that comprises testing techniques that, taken
together, provide methods to verify that your application works correctly at
each stage of development.
Students
Like the first group of people, you should also read this book from cover
to cover. Furthermore, you should read this book two or three weeks
before your midterm test on object orientation, and not the night before
the exam. This stuff takes a while to sink in (actually it takes much
longer than a few weeks, but there’s only so much time in a school term).
Chapter 6
Determining What to
Build: Object-Oriented
Analysis
How to develop a system use case model from an essential use case model
How to develop sequence diagrams
How to develop a conceptual class model from a domain model
How to develop activity diagrams
How to develop a user interface prototype
How to evolve your supplementary specification
How to apply the Object Constraint Language (OCL)
How to apply analysis patterns
How to write user documentation
How to apply packages on your diagrams
Your requirements model, although effective for understanding what your users
want to have built, is not as effective at understanding what will be built.
Object-oriented analysis techniques, such as system use case modeling, sequence
diagramming, class modeling, activity diagramming, and user interface
prototyping are used to bridge the gap between requirements and system design.
181
182 The Object Primer
Requirements The purpose of analysis is to understand what will be built. This is similar
engineering to requirements gathering, described in Chapter 3, the purpose of which
focuses on
is to determine what your users want to have built. The main difference
understanding
is that the focus of requirements gathering is on understanding your
users and their
usage, whereas users and their potential usage of the system, whereas the focus of analy-
analysis focuses sis shifts to understanding the system itself.
on understanding Figure 6-1 depicts the main artifacts of your analysis efforts and the
what needs to be relationships between them. The solid boxes indicate major analysis arti-
built. facts, whereas the dashed boxes represent your major requirements arti-
facts. As with the previous Figure 3-1, the arrows represent “drives”
relationships; for example, you see that information contained in your
CRC model affects information in your class model and vice versa. Figure
6-1 has three important implications. First, analysis is an iterative process.
Essential
Use Case
Use Case
Model
Model
Sequence Activity
Business Rules
Diagram Diagram
Class Model
CRC Model
(Analysis)
DEFINITIONS
Activity diagram. A UML diagram used to model high-level business processes or the transitions
between states of a class (in this respect, activity diagrams are effectively specializations of state chart
diagrams).
Class diagram. Shows the classes of a system and the associations between them.
Class model. A class diagram and its associated documentation.
Class Responsibility Collaborator (CRC) card. A standard index card that has been divided into
three sections: one indicating the name of the class the card represents, one listing the responsibilities
of the class, and the third listing the names of the other classes with which this one collaborates to ful-
fill its responsibilities.
Class Responsibility Collaborator (CRC) model. A collection of CRC cards that model all or part
of a system.
Diagram. A visual representation of a problem or solution to a problem.
Essential use case. A simplified, abstract, generalized use case that captures the intentions of a user
in a technology and implementation independent manner.
Essential use case model. A use case model comprised of essential use cases.
Essential user interface prototype. A low-fidelity prototype of a system’s user interface that mod-
els the fundamental, abstract characteristics of a user interface.
Model. An abstraction describing a problem domain and/or a solution to a problem domain. Tradi-
tionally models are thought of as diagrams plus their corresponding documentation, although non-
diagrams, such as interview results and collections of CRC cards, are also considered to be models.
Project stakeholder. Anyone who could be materially affected by the implementation of a new sys-
tem or application.
Prototype. A simulation of an item, such as a user interface or a system architecture, the purpose of which
is to communicate your approach to others before significant resources are invested in the approach.
Sequence diagram. A diagram that models the sequential logic, in effect, the time ordering of messages.
Use case. A sequence of actions that provide a measurable value to an actor.
Use case diagram. A diagram that shows use cases, actors, and their interrelationships.
Use case model. A model comprised of a use case diagram, use case definitions, and actor defini-
tions. Use case models are used to document the behavior requirements of a system.
User interface (UI). The user interface of software is the portion the user directly interacts with,
including the screens, reports, documentation, and software support (via telephone, electronic mail,
and so on).
User interface flow diagram. A diagram that models the interface objects of your system and the
relationships between them. Also know as an interface-flow diagram, a windows navigation diagram,
or an interface navigation diagram.
User interface prototype. A prototype of the user interface (UI) of a system. User interface proto-
types could be as simple as a hand-drawn picture or a collection of programmed screens, pages, or
reports.
Chapter 6 • Determining What to Build: Object-Oriented Analysis 185
DEFINITIONS
Extend association. A generalization relationship where an extending use case
continues the behavior of a base use case. The extending use case accomplishes
this by inserting additional action sequences into the base use case sequence.
This is modeled using a use case association with the <<extend>> stereotype.
Include association. A generalization relationship denoting the inclusion of
the behavior described by a use case within another use case. This is modeled
using a use case association with the <<include>> stereotype Also known as a
“uses” or a “has-a” relationship.
Chapter 6 • Determining What to Build: Object-Oriented Analysis 187
continued on page 90
188 The Object Primer
Student System
1. The student wants to enroll in a seminar. 3. The system verifies the student is eligible to enroll
2. The student inputs his name and student number in seminars at the university, according to business
into the system via “UI23 Security Login Screen.” rule “BR129 Determine Eligibility to Enroll.”
4. The system displays “UI32 Seminar Selection
Screen,” which indicates the list of available seminars.
5. The student indicates the seminar in which she 6. The system validates the student is eligible to
wants to enroll. enroll in the seminar, according to the business
rule “BR130 Determine Student Eligibility to Enroll
in a Seminar.”
7. The system validates the seminar fits into the
existing schedule of the student, according to the
business rule “BR143 Validate Student Seminar
Schedule.”
8. The system calculates the fees for the seminar
based on the fee published in the course catalog,
applicable student fees, and applicable taxes.
Apply business rules “BR 180 Calculate Student
Fees” and “BR45 Calculate Taxes for Seminar.”
9. The system displays the fees via “UI33 Display
Seminar Fees Screen.”
10. The system asks the student whether she still
wants to enroll in the seminar.
11. The student indicates she wants to enroll in the 12. The system enrolls the student in the seminar.
seminar. 13. The system informs the student the enrollment
was successful via “UI88 Seminar Enrollment Sum-
mary Screen.”
14. The system bills the student for the seminar,
according to business rule “BR100 Bill Student for
Seminar.”
15. The system asks the student if she wants a
printed statement of the enrollment.
16. The student indicates she wants a printed 17. The system prints the enrollment statement
statement. “UI89 Enrollment Summary Report.”
18. The use case ends when the student takes the
printed statement.
Figure 6-3.
Basic course of
action for “Enroll in
Seminar” written in
action-response style
190 The Object Primer
Figure 6-4.
The opportunities
for reuse in use case
models
Registrar
Enroll in Enroll in
<<include>>
University Seminar
Student
<<extend>>
International
Student
case. Notice how the identifier and the name of the use case is indicated.
If several use cases extended this one from the same point, then each one
would need to be listed. A condition statement, such as “Condition:
Enrollee is an international student,” could have been indicated immedi-
ately following the name of the use but, in this example, it was fairly
obvious what was happening.
case. The best way to think of an include association is that it is the invo-
cation of a use case by another one. In Figure 6-4, notice that the use case
Figure 6-5.
4. The system displays “UI43 Student Information Entry.” [Extension Point: Documenting an
UC34 Enroll International Student In University.] extension point
5. The student… within a use case
192 The Object Primer
DEFINITIONS
Base use case. A use case extended by another via an extend association.
Extending use case. A use case that extends another use case via an extend
association.
Extension point. A marker in a use case where extension is allowed.
“Enroll in University” includes the use case “Enroll in Seminar”; the nota-
tion for doing so is simply a normal use case association with the stereo-
type of <<include>>. Figure 6-6 presents an example of how you would
indicate where the use case is included in the logic of the including use
case. Similar to calling a function or invoking an operation within source
code, isn’t it? Object-oriented programming is covered in Chapter 8.
You use include associations whenever one use case needs the behav-
ior of another. Introducing a new use case that encapsulates similar logic
that occurs in several use cases is quite common. For example, you may
discover that several use cases need the behavior to search for and then
update information about students, indicating the potential need for an
“Update Student Record” use case included by the other use cases.
As you would expect, the use case “Enroll in University” should list
“UC17 Enroll in Seminar” in its “Includes” list. Why should you bother
maintaining an “Includes” and an “Extends” list in your use cases? The
answer is simple: Your use cases should stand on their own; you shouldn’t
expect people to have your use case diagram in front of them. Yes, it
would be nice if everyone has access to the use case diagram because it
also contains this information, but the reality is that sometimes you use
different tools to document each part of your model. For example, your
diagrams could be drawn using a drawing package and your use cases
documented in a word processor. Some of your project stakeholders may
have access to the word processor you are using, but not the drawing
package. The main disadvantage of this approach is you need to main-
tain these two lists in parallel with the diagram, the danger being they
may become unsynchronized.
Figure 6-6.
Indicating the 8. The student indicates the seminar(s) she wants to take via the use case
inclusion of a UC 17 Enroll in Seminar.
use case 9. The student…
Chapter 6 • Determining What to Build: Object-Oriented Analysis 193
6.1.2.3 Inheritance
Use cases can inherit from other use cases, offering a third opportunity to Use cases may
indicate potential reuse. Figure 6-4 depicts an example of this, showing inherit from other
that “Enroll Family Member in University” inherits from the “Enroll In use cases.
University” use case. Inheritance between use cases is not as common as
either the use of extend or include associations, but it is still possible. The
inheriting use case would completely replace one or more of the courses
of action of the inherited use case. In this case, the basic course of action
is completely rewritten to reflect that new business rules are applied when
the family member of a professor is enrolling at the university. Family
members are allowed to enroll in the school, regardless of the marks they
earned in high school; they don’t have to pay any enrollment fees, and
they are given top priority for enrollment in the university.
Inheritance between use cases should be applied whenever a single condi- Apply inheritance
tion, in this case, the student is a family member of a professor, would result between use cases
in the definition of several alternate courses. Without the option to define when a single
condition would
an inheriting use case, you need to introduce an alternate course to rework
result in several
the check of the student’s high-school marks, the charging of enrollment alternate courses.
fees, and for prioritization of who is allowed to enroll in the given semester.
The inheriting use case is much simpler than the use case from which
it inherits. It should have a name, description, and identifier, and it
should also indicate from which use case it inherits in the “Inherits
From” section. In sections that you replace, you may need to rewrite the
preconditions, postconditions, or courses of action. If something is not
replaced, then leave that section blank, assuming it is inherited from the
parent use case (you might want to put text, such as “see parent use
case,” in the section).
The fourth opportunity for indicating potential reuse within use case Actors may inherit
models occurs between actors: An actor on a use case diagram can inherit from other actors.
from another actor. An example of this is shown in Figure 6-4, where the
“International Student” actor inherits from “Student.” An international stu-
dent is a student, the only difference being he or she is subject to different
rules and policies (for instance, the international student pays more in
tuition). The standard UML notation for inheritance, the open-headed
arrow, is used and the advice presented about the appropriate use of inheri-
tance still applies: It should make sense to say the inheriting actor is or is
like the inherited actor.
the actor is an external system, then you need to develop a system inter-
face, perhaps a data file transfer or a real-time online link to the external
system. For example, in the “Enroll in Seminar” use case of Figure 6-2,
the Student actor interacts with the system via several major UI compo-
nents, particularly “UI23 Security Login Screen,” “UI32 Seminar Selec-
tion Screen,” “UI33 Display Seminar Fees Screen,” “UI88 Seminar
Enrollment Summary Screen,” and “UI89 Enrollment Summary Report.”
You should be able Second, use cases are often written under the assumption that you can
to exit from a use exit at any time. For example, in the middle of the “Enroll in Seminar”
case at any time. use case, the student may decide to give up and try again later or the sys-
tem may crash because the load on it is too great. The description of the
use case doesn’t include these as alternate courses because it would
greatly increase the complexity of the use case without adding much
value. Instead, it is assumed, if one of these events occurs, that the use
case simply ends and the right thing will happen. However, your subject
matter experts (SMEs) may want to define nonfunctional requirements
that describe how situations such as this should be handled.
Beware of the “use Third, in my opinion, use case modeling has received far more atten-
case driven” hype tion than it actually deserves. Yes, it is a useful technique but no, it isn’t
of consultants and the be-all-and-end-all of requirements and analysis modeling. You saw in
tool vendors. Chapter 3 that essential use case modeling is one technique of several
you can use to gather requirements and, as you see in this chapter, it is
also one of several techniques to perform object-oriented analysis. Don’t
let the marketing hype of CASE tool vendors and object-oriented consul-
tants deceive you into thinking everything should be “use case driven.”
Use case modeling is merely one of many important techniques you
should have in your modeling toolkit.
Include, extend, Fourth, although the reuse techniques— extend associations, include
and inheritance associations, and inheritance—are useful, don’t overuse them. Include
associations associations and, to a lesser degree, extend associations, lead to func-
between use cases tional decomposition within your use case model. The problem is use
can lead to
cases are not meant to describe functions within your source code; they
functional
decomposition if
are meant to describe series of actions that offer value to actors. A good
you are not rule of thumb to use is if you are able to describe a use case with a single
careful. sentence, then you have likely decomposed it too much, something that
occurs when you apply include associations too often. Another rule of
thumb is, if you have more than two levels of include associations, for
example, if use case A includes use case B, which includes use case C,
then two levels of include exist, and then you are in danger of functional
decomposition. The same can be said of extend associations between use
cases, as well as inheritance.
Chapter 6 • Determining What to Build: Object-Oriented Analysis 195
DEFINITIONS
Major user interface element. A large-grained item, such as a screen, HTML
page, or report.
Minor user interface element. A small-grained item, such as a user input
field, menu item, list, or static text field.
Supplementary specification. An artifact where all requirements not contained
in your use case model, user interface model, or domain model are documented.
198 The Object Primer
student number
isEligible(name, studentNumber)
3. System verifies student <<create>>
theStudent
theStudent
<<destroy>> Note: Need to
X flesh this message
<<create>> out more.
4. System displays seminar list
selection
5. Students picks seminar
isEligibleToEnroll(theStudent) qualifications()
6. System determines eligibility to enroll
getSchedule()
determineFit(seminar)
7. System determines schedule fit
<<create>>
9. System displays fees
10. System verifies student wishes to enroll
11. Students indicates yes. verification
enrollStudent(theStudent)
12. System enrolls student in seminar X
Figure 6-7.
A UML sequence
diagram for the basic
course of action for
Figure 6-2
200 The Object Primer
Messages fulfill the logic of the steps of the use case, summarized
down the left-hand side of the diagram. Notice how the exact wording of
the use case steps isn’t used because the steps are often too wordy to fit
nicely on a diagram. What is critical is that the step numbers correspond
to those in the use case and that the general idea of the step is apparent
to the reader of the diagram.
Stereotypes may Notice the use of stereotypes throughout the diagram. For the boxes, I
be applied to applied the stereotypes <<actor>>, <<controller>>, and <<UI>> indicating
actors, objects, that they represent an actor, a controller class, or a user interface (UI)
classes, and class, respectively. For now, a controller class is a placeholder for one or
messages on
more classes that would be fleshed out during design (Chapter 7) to
sequence
implement the business logic of your system. As you see in Chapter 7,
diagrams.
you want to layer your system, separating your user interface logic, busi-
ness logic, system logic, and persistence logic away from each other.
Stereotypes are also used on messages. Common practice on UML dia-
grams is to indicate creation and destruction messages with the stereo-
types of <<create>> and <<destroy>>, respectively. For example, you see
that the “:SecurityLogon” object is created in this manner (actually, this
message would likely be sent to the class that would then result in a
return value of the created object, so I cheated a bit). This object later
DEFINITIONS
Anonymous object. An object appearing on the diagram that hasn’t been
given a name; instead, the label is simply an indication of the class, such as
“: Invoice.”
Classifier. A mechanism that describes behavioral or structural features. Classi-
fiers include use cases, classes, interfaces, and components.
Lifeline. Represents, in a sequence diagram, the life span of an object during
an interaction.
Method. Something a class or object does. A method is similar to a function or
procedure in structured programming and is often referred to as an operation
or member function in object development.
Message-invocation box. The long, thin, vertical boxes that appear on sequence
diagrams, which represent invocation of an operation on an object or class.
Signature. The combination of the name, parameter names (in order), and
name of the return value (if any) of a method.
Static method. A method that operates at the class level, potentially on all
instances of that class.
Stereotype. A stereotype denotes a common usage of a modeling element.
Stereotypes are used to extend the UML in a consistent manner.
Chapter 6 • Determining What to Build: Object-Oriented Analysis 201
DEFINITIONS
C++. A hybrid object-oriented programming language that adds object-oriented
features to the C programming language.
Constructor. A method, typically a static one, whose purpose is to instantiate
and, optionally, initialize an object.
Controller. A class that implements business/domain logic, coordinating sev-
eral objects to perform a task.
Destructor. A method whose purpose is to remove an object completely from
memory.
Goldplating. The addition of extraneous features to a system.
Java. An object-oriented programming language based on the concept of
“write once, run anywhere.”
Note. A modeling construct for adding free-form text to the UML diagrams.
You may have heard terms such as dynamic modeling and static modeling TIP
bantered about by other developers familiar with object-oriented modeling
techniques. You may even have heard arguments about the merits of each Sequence
style. Dynamic modeling techniques focus on identifying the behavior within Diagrams Are
your system. These techniques include sequence diagramming and activity Dynamic
diagramming (both of which are described in this chapter) and collaboration
diagramming, described in Chapter 7. Static modeling focuses on the static
aspects of your system, including the classes, their attributes, and the associations
between classes. Class models, described in this chapter, are the main artifact
of static modeling, as are persistence models, which are described in Chapter
7. Both dynamic and static modeling techniques are required to specify an
object-oriented system adequately, which makes the “dynamic modeling
versus static modeling” debates questionable at best.
The sequence diagram of Figure 6-8 is simpler than that of Figure 6-7;
this is generally the case of alternate courses. I modeled the return value
from the “isEligibleToEnroll(theStudent)” message because this is what
causes the alternate course to occur in the first place. This arguably points
to the need always to model return values in your sequence diagrams. I
still prefer to keep my diagrams as simple as possible, though, so I model
them only when the information is vital to my understanding of the
logic. I also chose to show the ineligibility notice as its own user- interface
element, once again bordering on a design decision that would need to be
reflected in the user interface prototype. I also modeled that the prerequi-
sites list is displayed as part of the seminar details user interface element,
which is more than the use case currently calls for. This implies that I
should verify the change with my SMEs because I have effectively
increased the requirements although, by doing so, I have likely indicated Figure 6-8.
an opportunity for both reuse and an overall simplification of the poten- A UML sequence
diagram for an
alternate course
Enroll In Seminar
Alternate Course of
Action: Student Does
not Have Prerequisites A Student :EnrollInSeminar :IneligibilityNotice :SeminarDetails seminar:Seminar
<<actor>> <<controller>> <<UI>> <<UI>>
SD #: UC17-01B
isEligibleToEnroll(theStudent)
B.6. System determines ineligibility to enroll
false
<<create>>
B.7. System informs the student of ineligibility
B.8. System informs the student of <<create>>
prerequisites
B.9. Use case resumes at step 4
204 The Object Primer
tial design. As you can see with this example, the line between analysis
and design is fuzzy with object-oriented development; experienced devel-
opers new to objects can take time to get used to this. Finally, I left the
“Student” actor in the diagram, even though no direct interaction occurs
at this point because this actor is referred to in the steps of the use case.
1
Stereotypes in the UML typically begin with a lowercase letter. However, because I am
using the term “UI” for the stereotype label, instead of “user interface,” I have chosen
to capitalize it. Also, in Chapter 3, I was using the stereotype <<Actor>> instead of
<<actor>> on the Class Responsibility Collaborator (CRC) cards. I did this for two rea-
sons. First, CRC models are not part of the UML and, therefore, don’t have comply
with UML practices. Second, I did it to show you the world won’t end if you break the
rules a bit. I’ve lot track of the amount of time, easily in the hundreds of hours, that
I’ve wasted in conversations during modeling sessions over nitpicky issues such as this.
Your goal is to model your system accurately in a way that is understandable to the
people involved; whether you use <<Actor>> or <<actor>> as a stereotype is barely rele-
vant when the big picture is taken into consideration.
206 The Object Primer
13. Update your use case model. As you are sequence diagram-
ming, you may find errors in your original use case logic, errors
that need to be fixed on both your sequence diagram(s) and in
your use case(s). As always, validate any use case changes with
your SMEs first.
DEFINITION
Transitory object. An object that is not saved to permanent storage.
208 The Object Primer
DEFINITION
Computer-aided system engineering (CASE) tool. Software that supports
the creation of models of software-oriented systems.
(1999) point out that if you are having problems getting started drawing
sequence diagrams for a use case, then you likely wrote the use case
incorrectly and should reconsider its logic. They also point out that
sequence diagramming is the primary vehicle for allocating behavior.
During analysis, you will begin to add solution-space objects to the
problem-domain objects (from your CRC model), including controller
and user interface objects. Furthermore, during design, Rosenberg and
Scott (1999) also point out that you will infrastructure objects such as
system and persistence objects, scaffolding, and other helper objects into
your models.
2
In the original edition of this book, written in 1995, I argued for, and then used, the
term “class model,” instead of “object model,” for the simple reason that you use them
to model classes and their relationships, not objects.
Chapter 6 • Determining What to Build: Object-Oriented Analysis 209
DEFINITIONS
Problem space. The scope of your business domain being addressed by your
system.
Solution space. The problem space being addressed by your system plus the
nondomain functionality required to implement your system.
needed to actually build it. Luckily, those details have been captured in
the notes taken down by the scribe(s) during CRC modeling. Figure 6-9
depicts the CRC model we developed in Chapter 3, the “SecurityLogon”
class identified in the sequence diagrams earlier has been introduced to
CRC model, and Figure 6-10 depicts the UML class diagram that would
be created based on that CRC model.
For each card in the CRC model, you create a concrete class in the class
diagram, with the exception of cards that represent actors (actors exist in the Figure 6-9.
real world). Notice how the names stayed the same (spaces were removed A CRC model for
the university
Professor
Name
Seminar
Address
Phone number
Email address
Salary
Transcript <<UI>>
Provide information
Seminars instructing
**See the prototype** Student
Student <<Actor>> Get student info Seminar
Get seminars student Professor .
Provide information Enroll in Seminar took Enrollment Record
about self Transcript Determine average Seminar
Request to enroll in mark
seminar Name
Output self Student
Request Transcript Seminar number
Professor
Fees
Waiting list
Enrolled students
Enroll in Seminar <<UI>> Instructor
Add student
**See the prototype** Seminar Drop student
Enable seminar search Professor
Display seminar list
Display seminar fees Student
Display professor info
Name Enrollment
Address Record
Phone number
Email address
Student number
Average mark received
SecurityLogon <<UI>> Validate identifying info
Provide list of seminars
**See the prototype** Student taken
Request identifying
info for student
Enrollment Record
Thomas Lindet stood at his window thinking. One by one the lights
died out in the town. A candle had been shining through the curtain
in Madame Leroux’s bedroom for an hour, and now that was
extinguished. The red glow of the forge at the corner had become
fainter. For long it had shot a scarlet glare over the pavement, and
had roared before the bellows. The clink on the anvil was hushed,
the shutters were closed, and only a feeble glimmer shone through
their chinks, and under the door. The watch had closed the tavern of
the ‘Golden Cross.’ None traversed the square. Lindet saw a light still
in Madame Aubin’s windows. She had a child ill, and was sitting up
with it. There was a glimmer also from the window of M. François
Corbelin, and the strains of a violin issued from his room. There was
no moon now. The stars shone in the black vault above, and the
priest fixed his eyes upon them.
Save for the violin, all was hushed; the frogs indeed trilled as
usual, but the curé was so accustomed to the sound that he did not
hear them, or rather did not know that his ear received their
clamorous notes. Then suddenly he heard the baying of some
hounds, distant, but approaching.
A moment after, Lindet saw a figure dart across the market-place,
with extended arms, and rush to his door. Looking fixedly at the
form, he distinguished it to be that of a woman. She struck at his
door, and gasped, ‘Let me in! they are after me.’
‘Who are you, and what do you want?’ asked the curé from his
window.
‘Oh! quick, let me in,’ she cried; ‘the dogs! the dogs!’
‘Who are you?’
‘I am Gabrielle——’ she broke off with a scream, for instantly from
the street, out of which she had started, appeared the bloodhounds,
baying and tracking her.
‘For God’s sake! or they will tear me!’ she cried.
Lindet flung himself down the stairs, tore the door open, beat off
the dogs with a staff he snatched up, as the girl sprang in; then
slammed and barred the door upon the brutes.
‘Have they hurt you?’
She could not answer; her breath was nearly gone.
‘Stay there,’ he said; ‘I will light a candle.’ He groped his way to
the kitchen, felt for the tinder and steel, and struck a light. Having
kindled from it a little lamp, he returned to the girl. She had sunk
upon the ground beside the door, outside of which the hounds
leaped and barked, and at which they attempted to burrow.
‘How came you here?’ asked the curé. He set down the lamp, and
raised her from the floor in his arms.
‘I have escaped,’ she gasped. ‘I ran. They are after me.’
Voices were now heard without, calling off the dogs.
‘Bah! she has taken refuge with her dear friend the curé. I thought
as much.’ The voice was that of Foulon.
‘Sacré!’ exclaimed Berthier; ‘I wish we had discovered her flight a
little earlier. I wish the dogs had brought her down in the forest.
Sacré! I wish——’
‘My dear good Berthier,’ said Foulon, ‘what is the use of wishing
things to be otherwise than they are? always accept facts, and make
the most of them. Gustave! take the dogs away. They make a
confounded noise.’
‘Remain here,’ said Lindet, in an agitated voice; ‘I will go and
summon Madame Pin, the old woman whose house this is. She is as
deaf as a post.’
‘Do not go!’ pleaded Gabrielle, trembling; ‘perhaps they may get
in. Wait, wait, to defend me.’
Lindet stood and listened to the voices outside. The dogs were
collared and withdrawn. Foulon tapped at the door.
‘Do not open,’ entreated Gabrielle.
‘Well! Monsieur le Curé,’ said the old gentleman through the door;
‘sly priest! so the little rogue is with you? What will the bishop say?
So late at night!’
The noise had attracted the musician to his window. The mother
of the sick child had opened her casement, and was looking out.
Madame Leroux started out of the dose into which she had fallen,
and appeared at her garret window.
‘What is the matter?’ asked the musician.
‘Ah, M. Corbelin!’ exclaimed Foulon, in a loud voice; ‘what foxes
these curés are! We have just seen one admit a young and pretty
girl to his house. Hark! it is striking midnight. No wonder all the dogs
in the town have been giving them a charivari.’ Then, in a low tone
to Berthier, he said: ‘My good boy! I have served out our curé now,
for having repeated in the pulpit certain observations I made in
private. Those she-dragons yonder’—he pointed up at the windows
—‘will have ruined Thomas Lindet for ever. Come, let us go home.’
C H A P T E R X I V.
By an order dated January 24th, 1789, the king required that the
desires and reclamations of all his subjects should be transmitted to
him. Every parish was to draw up a statement of its grievances and
its wishes, which was to be handed into the assembly of the
secondary bailiwick, by it to be fused into one which was forwarded
to the grand bailiwick. The secondary bailiwicks of Beaumont-le-
Royer, Breteuil, Conches, Ezy-Nonancourt, Orbec, and Bernay,
belonged to the grand bailiwick of Évreux. The nobility and the
clergy drew up their papers separately.
Another operation, not less important than the composition of
these cahiers, was to be simultaneously accomplished. This was the
election of delegates.
According to the edict of the 24th January, the ancient distinction
of electors and deputies into three orders, the clergy, the nobility,
and the third estate, was maintained. These orders had a common
electoral circumscription, the grand bailiwick. The mode of election
in the two first orders was made the same, but it was different in the
third.
The nomination of deputies for the clergy was to be made directly
by the bishops, abbés, canons, and other beneficed clergy in the
grand bailiwick. The curés, who subsisted on the portion congrue, in
another word, nearly all the clergy in country parishes, could only
vote in person if their parish were within two leagues of the town in
which was held the assembly, unless they had a curate to take their
place during their absence, and provide for the religious
requirements of the people.
The election was equally direct for the deputies of the nobility. The
nobles possessing fiefs within the jurisdiction of the grand bailiff,
might appear by representatives, but all others were required to
appear in person.
The third estate, on the contrary, in naming its representatives,
had to traverse three stages. Eight days at latest after having
received the notification, the inhabitants composing the tiers état in
the towns and country parishes, above the age of twenty-five, were
invited to unite in their usual place of assembly, before the justice,
or, in his default, before their syndic, for the purpose of naming a
number of delegates, the number being proportioned to the
population—two for two hundred fires and under, three for more
than two hundred, four for three hundred and over, and so on, in
progression. These delegates were required to betake themselves to
the seat of the secondary bailiwick of their arrondissement, and
there elect one quarter of their number. Those who had passed this
ordeal were next bound to transport themselves to the principal
bailiwick, and there, united with the deputies of that particular
arrondissement of the bailiwick, and with the delegates of the town
corporations, to form, under the presidence of the lieutenant-
general, a college to which was remitted the final election of
deputies.
Such organization had this advantage,—it gave to the elections, at
a period when the relations of men with each other were much more
limited than they are at present, guarantees of sincerity which they
could not have had by direct universal suffrage. At each stage the
electors knew those who solicited their votes. A communication was
established through an uninterrupted chain of confidential trusts,
from the most humble member of the primary assemblies to the
delegates sent to Versailles from the grand colleges.
On Monday, the 16th March, 1789, seven hundred and fifty
ecclesiastics, four hundred and thirty nobles, and three hundred
deputies of the third estate, assembled in Évreux for the final
election of delegates.
At eight o’clock in the morning, the great bell of the Cathedral
boomed over the city to announce the opening of the first session.
From the summit of the central spire floated a white standard,
powdered with golden lilies. Ropes had been flung across the
streets, and from them were slung banners and flags bearing
patriotic inscriptions, ‘Vive le Roy!’ and ‘Vive les États Généraux.’ The
lilies of France fluttered from the windows of the barracks, the
hospital, and the Palais de Justice.
The weather was cold. The winter had been of unprecedented
severity, and the snow was not gone. On the north side of the
Cathedral it was heaped between the buttresses in dirty patches. It
glittered on the leaden roof of the aisles. In the streets it was
kneaded into black mud; it lurked white and glaring in corners.
Women had been up at daybreak sweeping the slush from their
door-steps, and making the causeway before their houses look as
clean as the season permitted. The limes in the palace-garden had
not disclosed a leaf; the buds were only beginning to swell.
It was a bright morning, almost the first really sunny springtide
day that year, and it was accepted by all as a glad omen of a bright
era opening on France with the elections of that day.
A stream of people poured into the Cathedral through the west
gate and northern portal. The nave was reserved for the electors;
the people of Évreux filled the transepts and aisles. In the centre,
under Cardinal Balue’s tower, sat the nobility, many of them dressed
with studious splendour; the clergy occupied the choir, and
overflowed into the choir-aisles. The third estate sat west of the
central tower. This body of men presented marked contrasts in the
appearance of the members constituting it. Side by side with the
lawyer and surgeon, in good black cloth suits, black satin breeches,
and black silk stockings, sat the peasant delegate in coarse blue
cloth jacket, brown cap,—that cap which has been mounted on the
flag-staff of the Republic as the badge of liberty,—and shoes of
brown leather without heels, laced in front. Next to him a miller, with
a broad-brimmed hat, pinched to make it triangular, a velvet
waistcoat, and a coat set with large mother-of-pearl buttons, and
here and there also a curé in cassock turned green with age, and
black bands, edged with white; for some of the country villages sent
their priests to bear their complaints before the great assembly.
Never had that noble church looked more impressive than on that
March morning. It is peculiarly narrow and lofty, and darkened by
the immense amount of painted glass which fills the windows,—glass
of the highest style of art, and great depth of colour, and thickness
of material.
The bishop occupied his throne, and the Abbé de Cernay, dean of
the chapter, sang the mass of the Holy Ghost, in crimson vestments.
Never, probably, has that grand church resounded with a finer
choral burst of song than when, at the conclusion of the mass, those
seven hundred and fifty priests, with the choir, and a number of the
laity, joined with the thunder of the organ, in the Veni Creator, sung
to the melody composed by good King Robert of France.
The assembly was then constituted in the nave of the Cathedral.
The candles were extinguished, the fumes of incense faded away,
the clergy who had assisted in robes retired to lay aside their
vestments; seats and a table were placed in the nave at the
intersection of the transepts, and M. de Courcy de Montmorin, grand
bailiff of Évreux, took his seat as president. Beside him sat M.
Girardin, lieutenant-general of the bailiwick, and on his left M.
Gozan, procureur of the king. Adrian Buzot, chief secretary, sat pen
in hand at the table. On the right, filling the northern transept, sat
the clergy in a dense black body, with the bishops of Évreux and
Lisieux at their head in purple velvet chairs, studded with gold-
headed nails. The bishops wore their violet cassocks, lace rochets,
and capes, over which hung their episcopal crosses. In the south
transept were placed the nobles; and the third estate filled the first
three bays of the nave below the cross.
As soon as the assembly was seated, and silence had been
established, the grand bailiff rose. He was a venerable man, of noble
appearance, with a fresh complexion, bright clear grey eyes, and a
flowing beard whiter than the late snow without. Raising his chapel
from his blanched head as he began his speech, he replaced it
again. His voice, at first trembling and scarcely audible in that vast
building, gradually acquired tone, and was, towards the close of the
address, heard by every one in that great concourse.
‘I give thanks to Heaven,’ said the old man, lifting his cap and
looking upwards, ‘that my life has been prolonged to this moment,
which opens before us, under the auspices of a beloved monarch, a
perspective of happiness, which we should hardly have ventured to
hope for.
‘What an epoch in our annals, and, indeed, in those of humanity!
A sovereign consults his people on the means of assuring their
felicity, and assembles around him all those gifted with political
knowledge, to strengthen, or rather, to relay the bases of general
prosperity.
‘Already, from one end of France to the other, those social ideas
which establish the rights of man and citizenship on true and solid
foundations have been disseminated. Government, far from
attempting to hinder the spread of these ideas, has allowed them a
liberty in accordance with its own generous purposes.
‘It is for us, gentlemen, to show ourselves worthy of this noble
confidence reposed in us by our sovereign; it is for us to second the
views of a monarch who consecrates for ever his power, by showing
that he desires to endear it to his subjects.
‘Experience has taught kings, as it has their subjects, that this
alone is the means of protecting and securing the royal prerogative
from the seductions of their ministers, who too frequently have
stamped the decrees of their selfish passions, their errors, and their
caprice, with the seal of a cherished and sacred authority.
‘In order that we may arrive at that patriotic aim, dear to our
hearts, we have to endeavour to maintain concord and mutual
consideration between the three orders. Let us then from this
moment suppress our own petty, selfish interests, and subordinate
them to that dominant interest which should engross and elevate
every soul—the public weal.
‘The clergy and the nobility will feel that the grandest of all
privileges is that of seeing the person and property of each under
national security, under the protection of public liberty, the only
protective power which is durable and infallible.
‘The third estate will remember the fraternal joy with which all
orders have hailed the success of the third in obtaining its demands.
Let it not envy its elder brethren those honorific prerogatives,
rendered legitimate by their antiquity, and which, in every monarchy,
accompany those who have rendered service to their country, and
whose families are venerable through their age.
‘Generous citizens of all orders, you whom patriotism animates,
you know all the abuses, and you will demand their reform at the
ensuing council of the nation.
‘I do not agitate the question of the limit of the powers given to
our deputies. Public opinion has decided that; in order that they may
operate efficaciously, they must be, if not wholly unlimited, at least
very extensive.
‘Such are the ideas, gentlemen, which I submit to your
consideration.
‘I assure you solemnly of the sincerity with which I offer up my
prayers for the public welfare. This hope—so sweet, yet so late in
coming to me, now far advanced in years, is the consolation of my
age, rejuvenated by the light of a new era which promises to dawn,
inspiring with hope us who stand on the brink of eternity, and which
will be the glory of our posterity. We shall lay the foundations,
another generation will rejoice in the superstructure. I thank God
that this feeble hand is called even to the preparatory work, and,
gentlemen, I conclude with the words of the Psalmist: “Respice in
servos tuos, et in opera tua, et dirige filios eorum.”’
The venerable bailiff sat down; a thrill of emotion ran through the
assembly. In perfect silence, the roll-call and verification of powers
was begun.
Amongst those names first proclaimed, in the order of the nobility,
was that of Louis-Stanislas Xavier, son of France, Duke of Anjou,
Alençon and Vendôme, Count of Perche, Maine and Senonches, Lord
of the bailiwicks of Orbec and Bernay. This prince, who was
afterwards Louis XVIII, was represented by the Marquis of
Chambray.
When the names of the clergy were read, Monseigneur de
Narbonne turned his ear towards Adrian Buzot.
‘Robert Thomas Lindet, curate of S. Cross, at Bernay.’
‘I object,’ said the bishop, raising his hand.
The secretary turned to him, and asked his reason.
‘He is disqualified from appearing. He is under inhibition.’
Lindet sprang to his feet and worked his way to the front. ‘I
maintain,’ said he, ‘that an inhibition does not disqualify me from
appearing.’
The bishop leaned back in his velvet chair, crossed his feet, folded
his hands, and looked at the president.
‘I have been inhibited without just cause, without having been
given a hearing, or allowed to clear myself of imputations maliciously
cast upon me.’
‘M. Lindet,’ said the grand bailiff, ‘we cannot enter upon the
question of the rights of the inhibition; we are solely concerned with
the question, whether that said inhibition incapacitates you from
voting.’
‘Quite so,’ the prelate interjected; then his cold grey eye rested
upon Lindet, who returned the look with one of defiance.
M. de Courcy whispered with the Procureur du Roi.
‘I think,’ said the bishop, in a formal tone, ‘that, whatever may be
the decision on the legality of your appearing, M. Lindet, there can
be but one opinion on its propriety. If you have not the decency to
remain in retirement, when lying under rebuke for scandalous and
immoral conduct, you will probably not be shamed by anything I
may say.’
‘My Lord,’ began the curé, ‘I protest—’ but he was interrupted by
the president, who, nodding to M. Gozan, the agent for the king,
said:
‘The objection raised by monseigneur appears to me not to
invalidate the claim of M. Lindet to have a voice in the redaction of
the cahiers and the election of the clerical delegates. The order of
his Majesty makes no provision for the case of a clerk under
censure, and silence on this point may fairly be construed in his
favour. The sentence upon him was purely spiritual, his status as
stipendiary curate remains unaltered. If he have a grievance, an
opportunity is graciously afforded him by his Majesty of declaring it.
The ends proposed would be frustrated, if all those who had
grievances were precluded by an exercise of authority on the part of
their lords, feudal or spiritual, from expressing them.’
The bishop coloured, bowed stiffly, and began to converse in a low
tone with M. de la Ferronays, bishop of Lisieux.
The preliminary work of calling over the names of electors and
delegates occupied the session of that day. At four o’clock in the
afternoon it was dissolved, and the vast concourse began to flow out
at the Cathedral doors.
But it was observed by the bishops, that the clergy showed no
signs of moving from their places.
M. de Narbonne rose from his violet velvet chair, and with a smile
at his brother prelate, and then at the dean, suggested that they
should retire through the private entrance in the south transept to
the palace garden.
He was about to cross before the table at which Adrian Buzot was
still engaged with his papers, when Thomas Lindet, standing on his
chair, addressed him.
‘My Lord! you have this morning publicly attacked my character, by
asserting that my conduct has been “scandalous and immoral.” I
demand of you, before these my brother priests, to state the
grounds upon which you base that charge.’
The bishop, taking the arm of his suffragan, did not even turn to
look at the curé, but began to speak rapidly to his brother prelate.
‘My Lord! are you going to answer me, or are you not?’ again
asked Lindet. ‘I appeal to you as a Christian—not as a bishop. You
have damaged my character. State frankly your reasons for doing so.
Give me an opportunity of clearing myself.’ He had spoken calmly so
far, but all at once his natural impetuosity overpowered him, and he
burst forth with the sentence: ‘Stay! you have just genuflected
towards the Host! you have bent the knee in homage to Him who is
Mercy and Justice, whose minister you are. In His name I demand
justice. Mercy I have long ago ceased to expect.’
‘I had rather be keeper of a lunatic asylum,’ said the Bishop of
Lisieux, ‘than be custos of a herd of wild curés.’
The Bishop of Évreux laughed aloud. The laugh echoed through
the aisles, and was heard by the priests, as he laid his hand on the
private door.
The dense black mass of clerics rose, and the bishop darted
through the door with purple cheek and blazing eye, as a hiss, long
and fierce, broke from that body of priests he shepherded.
‘Barbarians! blackguards!’ said the bishop, shaking his fist at the
Cathedral, as he shut the door behind him and quenched that
terrible sound. ‘Wait! I have chastised you hitherto with whips; when
these States-General are over, I shall thrash you into subserviency
with scorpions.’
CHAPTER XVI.
ebookgate.com