Java Reference
In-Depth Information
It is possible to run a simplified test running both the client and the server
on the same machine. In this case a single application contains all the
import Counter.SocketProxy;
import CounterUI.*;
import Market.StubFactory;
import Market.BasicServer;
import MarketDB.VolatileDB;
public class TestSocket {
public static void main(String[] args) {
// instantiate the server components
BasicServer server # new BasicServer(new VolatileDB());
StubFactory factory # new StubFactory(server);
( new Thread(factory)).start();
// instantiate the client components
CounterFrame counter # new CounterFrame(
new SocketProxy("localhost"));;
BarCodeReaderUI reader # new BarCodeReaderUI();
Prototype 4: Data persistence
This prototype addresses the last concern: the persistence of data. Infor-
mation on product availability and history of acquisitions must be kept
permanently. The former information is required so that new supplies can
be ordered, the latter so that statistical analyses can be performed.
The main issue in this prototype is the selection of the information that has
to be made persistent. The pertinent information has been identified in
Section 14.5.1 and described in Figure 14.9; we don't need to add anything.
The persistence solution to be adopted must guarantee ease of access to
specific information. For instance, given a key we should be able to access
the corresponding employee. In addition it should be possible to store the
associations between product data.
Decision point
What kind of persistent storage do we use?
Search WWH ::

Custom Search