Text and Binary Files
Text files
Interface with file I/O
The ProductDAO interface
public interface ProductDAO extends ProductReader, ProductWriter, ProductConstants {}
The ProductReader interface
import java.util.ArrayList; public interface ProductReader { Product getProduct(String code); ArrayListgetProducts(); }
The ProductWriter interface
public interface ProductWriter { boolean addProduct(Product p); boolean updateProduct(Product p); boolean deleteProduct(Product p); }
The ProductConstants interface
public interface ProductConstants { int CODE_SIZE = 4; int DESCRIPTION_SIZE = 40; }