Java Reference
In-Depth Information
Tip Before inspecting the Denny's DVDs DBClient.java source code available for download, try writing
the class yourself and see how close your interface is to the one used in the sample project. Since you will
also be given the interface in the actual assignment, this exercise should be performed just for fun.
Listing 3-1. The DBClient Interface
package sampleproject.db;
import java.io.*;
import java.util.regex.*;
import java.util.*;
/**
* An interface implemented by classes that provide access to the DVD
* data store, including DVDDatabase.
*
* @author Denny's DVDs
* @version 2.0
*/
public interface DBClient {
/**
* Adds a DVD to the database or inventory.
*
* @param dvd The DVD item to add to inventory.
* @return Indicates the success/failure of the add operation.
* @throws IOException Indicates there is a problem accessing the database.
*/
public boolean addDVD(DVD dvd) throws IOException;
/**
* Locates a DVD using the UPC identification number.
*
* @param UPC The UPC of the DVD to locate.
* @return The DVD object which matches the UPC.
* @throws IOException if there is a problem accessing the data.
*/
public DVD getDVD(String UPC)throws IOException;
/**
* Changes existing information of a DVD item.
* Modifications can occur on any of the attributes of DVD except UPC.
* The UPC is used to identify the DVD to be modified.
Search WWH ::




Custom Search