Class ProductDesc
problem_domain

public class ProductDesc
This class represents the catalog-like description of the product being sold.

If you need to track quantity and aren't selling specific "thing"-like products (that is, ones that are serialized), then add a quantityOnHand attribute to this class.

Stereotype:
description
Author:
TogetherSoft
persistent
Version:
1.0
See Also:  Node Documentation

Field Summary
private Product
private BigDecimal
defaultPrice
Default price.
private String
description
Some prose describing the product in all its glory.
private String
itemNumber
This is the unique identifying number.
private String
name
Product name.
private Vector
priceObjects
List of prices.
private int
type
Use it if you need to identify Products as specific types.
Constructor Summary
ProductDesc(String anItemNum)
Constructor requires all parameters.
Method Summary
void
BigDecimal
calcPriceForQty(int qty)
By passing in the qty, we can efficiently do quantity discounts at this level in the object model.
int
BigDecimal
BigDecimal
String
String
String
BigDecimal
getPrice()
This will check if there are any Price objects, returning that price, else the default price.
Enumeration
static Vector
listProductDescs()
This is a class-level method used to return a list of all available product descriptions currently in the persistent store.
void
void
setDefaultPrice(BigDecimal aDefaultPrice)
void
setDescription(String aDescription)
void
setItemNumber(String anItemNumber)
void
setName(String aName)
Field Detail
type
private int type
Use it if you need to identify Products as specific types.
rdbLogicalType:
INTEGER

name
private String name
Product name. For example: Goetze's Caramel Cremes
rdbLogicalType:
VARCHAR

itemNumber
private String itemNumber
This is the unique identifying number. Something like a UPC for retail products.
rdbLogicalType:
VARCHAR

defaultPrice
private BigDecimal defaultPrice
Default price.
rdbLogicalType:
NUMERIC

description
private String description
Some prose describing the product in all its glory.
rdbLogicalType:
VARCHAR

priceObjects
private Vector priceObjects
List of prices. If this list has elements, then they are checked. Otherwise, the default price is used.

supplierCardinality:
1..*
associates:
ProductPrice

attribute1
private Product attribute1
Constructor Detail
ProductDesc
public ProductDesc(String anItemNum)
Constructor requires all parameters. Type is defaulted to 0 since we aren't using it.
Method Detail
calcQtySold
public int calcQtySold()

calcTotalSales
public BigDecimal calcTotalSales()

getPrice
public BigDecimal getPrice()
This will check if there are any Price objects, returning that price, else the default price.

calcPriceForQty
public BigDecimal calcPriceForQty(int qty)
By passing in the qty, we can efficiently do quantity discounts at this level in the object model.

listProductDescs
public static Vector listProductDescs()
This is a class-level method used to return a list of all available product descriptions currently in the persistent store.

addPriceObject
public void addPriceObject(ProductPrice priceObj)

removePriceObject
public void removePriceObject(ProductPrice priceObj)

listPriceObjects
public Enumeration listPriceObjects()

getItemNumber
public String getItemNumber()

setItemNumber
public void setItemNumber(String anItemNumber)

getName
public String getName()

setName
public void setName(String aName)

getDescription
public String getDescription()

setDescription
public void setDescription(String aDescription)

getDefaultPrice
public BigDecimal getDefaultPrice()

setDefaultPrice
public void setDefaultPrice(BigDecimal aDefaultPrice)