Interfaces
Application
ProductTextFile class
The code for the ProductTextFile class
public class ProductTextFile implements ProductDAO
{
public ProductTextFile()
{
// code that initializes fields
}
//*************************************************
// Implement the ProductReader interface
//*************************************************
public Product getProduct(String code)
{
// code that returns a Product
}
public String getProductsString()
{
// code that returns a String that lists all products
// this code can use the CODE_SIZE and DESCRIPTION_SIZE
// constants from the ProductConstants interface
// to align the product data
}
//*************************************************
// Implement the ProductWriter interface
//**************************************************
public boolean addProduct(Product p)
{
// code that adds a Product
}
public boolean deleteProduct(Product p)
{
// code that deletes a Product
}
public boolean updateProduct(Product p)
{
// code that updates a Product
}
}