Problem
We will create a web-based application to maintain products for an online music catalog. Your task is to create a Java Bean that adheres to the following conventions:
has a zero-argument constructor
has properties whose values can only be accessed by accessor methods
is Serializable, that is, implements the java.io.Serializable interface.
Specification
The bean must have the following features:
Project Name | aaannn_HW2_ProductMaint,
where aaa – your initials, nnn – last 3 digits of your tech ID |
||||||||||||||||||||||||
Package Prefix | classes you create must be in packages that begin with the prefix: edu.metrostate.ics425.aaannn.prodmaint where aaa – your initials, nnn – last 3 digits of your tech ID note: per Java coding conventions characters in the package name should be all lower-case |
||||||||||||||||||||||||
Class | Name: ProductBean.java
Implements: edu.metrostate.ics.prodmaint.model.Product Properties:
Overrides: equals(Object) : so that products with the same code are equal (Case insensitive) hashCode() : should almost always be overridden to comply with relationship with equals (see Javadoc on Object) toString() : for convenience have it display something meaningful about the product Note: no main method is specified or required |
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Demo App (optional) | So you can test your bean without using a main method, I would recommend creating a demo application with the following use-case:
Note: no validation is required for this test app |
Provided:
edu.metrostate.ics425.Product.java – the Product interface. Note: do not change its package.
NOTE: this is Java Netbeans