With all this information on hand regarding the conduit’s role of moving data to and from the handheld, it is time to return to the Sales conduit. We will extend it so that our shell from the previous chapter also supports “Desktop overwrites handheld” and “Handheld overwrites desktop.” We are postponing full syncing until Chapter 16.
For our conduit, we’ve got to define what it means to do each type of overwriting. Here’s the logic that we think makes sense for the Sales application:
The products database and the customers database are completely overwritten from the desktop; nothing happens to the orders database.
The products are ignored (since they can’t have changed on the handheld). The customers and orders databases are copied to the desktop. Any archived customers are appended to a separate file; deleted customers are removed from the handheld.
The end result is that the customer database is moved both to and from the handheld. The product database is sent to the handheld and the order database is sent to the desktop. Figure 15-2 shows you where each type of data is moving.
We store data on the desktop as tab-delimited text files.
The customers will be stored in a file named Customers.txt ...