Customer Appl Design Summary ------------------------------ Entity classes ----------------------------- class Location { String city; initial value = "New York City" min length = 2 (if not null) max length = 40 Rules: the city may be null, but not empty the city must not contain any XSS attacks (JavaScript tags) String country; initial value = "United States of America" min length = 1 (if not null) max length = 40 Rules: the country may be null, but not empty the country must not contain any XSS attacks (JavaScript tags) } class CustomerEntity { int id; initial value = 1 min = 1 max = Integer.MAX Rules: the id must be greater than zero } class Customer extends CustomerEntity { String firstName; initial value = "John" min length = 1 max length = 40 Rules: the firstName must not be null, or empty the firstName must not contain any XSS attacks (JavaScript tags) String lastName; initial value = "Smith" min length = 1 max length = 40 Rules: the lastName must not be null, or empty the lastName must not contain any XSS attacks (JavaScript tags) Location location = Rules: the location must not be null String phone; initial value = null min length = 1 (if not null) max length = 20 Rules: the phone may be null, but not empty the phone must not contain any XSS attacks (JavaScript tags) } class Order extends CustomerEntity { Date orderDate; initial value = Rules: the orderDate must be current date or earlier int customerId; initial value = 1 min = 1 max = Integer.MAX Rules: the customerId must be greater than zero double totalAmount; initial value = 0.00 min = 0.00 max = Double.MAX Rules: the totalAmount must be 0.00 or greater the totalAmount is the sum of the subTotal for all the itemsForThisOrder String orderNumber; initial value = null min length = 2 max length = 10 Rules: the orderNumber may be null, but not empty the orderNumber must not contain any XSS attacks (JavaScript tags) List itemsForThisOrder; initial value = } class OrderItem extends CustomerEntity { int orderId; initial value = 1 min = 1 max = Integer.MAX Rules: the orderId must be greater than zero int productId; initial value = 1 min = 1 max = Integer.MAX Rules: the productId must be greater than zero double unitPrice = 1.00 min = 1.00 max = Double.MAX Rules: the unitPrice must be 1.00 or greater int quantity; initial value = 1 min = 1 max = Integer.MAX Rules: the quantity must be greater than zero double subTotal = min = 1.00 max = Double.MAX Rules: the subTotal must be greater than zero } class Product extends CustomerEntity { String name; initial value = "unknown" min length = 1 max length = 50 Rules: the name must not be null, or empty the name must not contain any XSS attacks (JavaScript tags) int supplierId; initial value = 1 min = 1 max = Integer.MAX Rules: the supplierId must be greater than zero double unitPrice = 0.01 min = 0.01 max = Double.MAX Rules: the unitPrice must be 0.01 or greater String packaging; initial value = null min length = 2 max length = 30 Rules: the packaging may be null, but not empty the packaging must not contain any XSS attacks (JavaScript tags) boolean discontinued; initial value = false } class Supplier extends CustomerEntity { String company; initial value = "unknown" min length = 1 max length = 40 Rules: the company must not be null, or empty the company must not contain any XSS attacks (JavaScript tags) String contact; initial value = null min length = 1 (if not null) max length = 50 Rules: the contact may be null, but not empty the contact must not contain any XSS attacks (JavaScript tags) Location location = Rules: the location must not be null String phone; initial value = null min length = 1 (if not null) max length = 30 Rules: the phone may be null, but not empty the phone must not contain any XSS attacks (JavaScript tags) String fax; initial value = null min length = 1 (if not null) max length = 30 Rules: the fax may be null, but not empty the fax must not contain any XSS attacks (JavaScript tags) } Action classes -------------------- CustomerDAO List findCustomersByName(String firstName, String lastName) List findAllCustomers() Customer findCustomerById(int id) void addCustomer(Customer customer) void updateCustomer(Customer customer) void deleteCustomer(Customer customer) void deleteCustomer(int id) OrderDAO List findOrdersByCustomer(Customer customer) List findOrdersByOrderDate(Date orderDate) Order findOrderById(int id) List findOrdersByOrderNumber(String orderNumber) void addOrder(Order order) void updateOrder(Order order) void deleteOrder(Order order) void deleteOrder(int id) ProductDAO List findAllProducts() Product findProductById(int id) List findProductsBySupplier(Supplier supplier) void addProduct(Product product) void updateProduct(Product product) void deleteProduct(Product product) void deleteProduct(int id) SupplierDAO List findAllSuppliers() List findSuppliersByCompanyName(String companyName) Supplier findSupplierById(int id) void addSupplier(Supplier supplier) void updateSupplier(Supplier supplier) void deleteSupplier(Supplier supplier) void deleteSupplier(int id)