Sams Teach Yourself C++ in 21 Days

(singke) #1
For each of these domain objects, you need to capture essential data, such as the name of
the object (for example, customer, account, and so on), whether the object is an actor, the
object’s principal attributes and behavior, and so forth. Many modeling tools support cap-
turing this information in “class” descriptions. Figure 11.4 shows how this information is
captured with the Rational Rose modeling tool.

340 Day 11


FIGURE11.4
Rational Rose.

It is important to realize that what is being described here is notthe class that will be
used in the design (even though there will probably be similar classes used in the
design), but rather classes of objects in the requirements domain. This is documentation
of what the requirements will demand of the system, not documentation of how the sys-
tem will meet those requirements.
You can diagram the relationship among the objects in the domain of the ATM example
using the UML—with the same diagramming conventions that will be used later to
describe the relationships among classes in the design. This is one of the great strengths
of the UML: You can use the similar representations at every stage of the project.
For example, you can capture that checking accounts and savings accounts are both spe-
cializations of the more general concept of bank account by using the UML conventions
for classes and generalization relationships, as shown in Figure 11.5.
In the diagram in Figure 11.5, the boxes represent the various domain objects, and the
line with an arrowhead indicates generalization. The UML specifies that this line is
drawn from the specializedclass to the more general “base” class. Thus, both Checking
Account and Savings Account point up to Bank Account, indicating that each is a spe-
cialized form of Bank Account.
Free download pdf