Java Reference
In-Depth Information
interface
DBManager
conveys requests from the package
Market
to package
MarketDB
.
The complete class diagram is shown in Figure 14.11. The classes belong-
ing to different packages are separated by a dashed line. All the packages
contain a limited set of classes. The best package is
MarketDB
: it contains the
BManager
interface, the
VolatileDB
interface that implements an in-memory
database, and four data classes:
Item
,
Employee
,
Customer
and
Transaction
The data classes do not perform any operations; they only contain the infor-
mation relative to an entity stored in the database.
Each operation of the employee on the graphical user interface triggers a
sequence of interactions that span all four packages. As an example we can
examine in detail the scenario related to the Connect use case, which is
shown in Figure 14.12.
When the employee at the counter pushes the “Connect” button (after
filling in the code and password fields) the graphical user interface invokes
the
btConnect_actionPerformed
method. This method takes the values of
code and password and calls the
LocalProxy
, through the
MarketProxy
inter-
face. The local proxy asks the server for authentication (through the
Market
interface) which takes place in two stages: first the employee information is
CounterUI
CounterUI
Counter
1
0
proxy
1
LocalProxy
MarketProxy
*
0
market
1
BasicServer
Market
1
MarketDB
0
dbm
1
VolatileDB
DBManager
Item
Employee
Customer
Transaction
Figure 14.11
Complete class diagram