Question: 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

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:

Property Name

Type

Access

Description/ Notes

Code

String

R/W

Unique to each catalog entry

Description

String

R/W

Title of album

Price

double

R/W

Price of album

Release Date

java.time.LocalDate

R/W

Date album was released note: uses new Java8 time class

Years Released

int

RO

number of whole years from release date, or

-1 if future release;

-2 if no release date is set (i.e. releaseDate == null)

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:

System

User

1. Displays Product Entry Form

2. Enters product information and presses submit button

3. System creates new product

4. System gets product information from request and sets product values

5. System displays Product Information Form displaying new product

end of 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!