Interface ProductCategory

All Superinterfaces:
BusinessObject
All Known Implementing Classes:
ProductCategoryBean

public interface ProductCategory extends BusinessObject
Interface representing a product within a category in the system.

When the application needs to create an instance that implements ProductCategory, BusinessObjectFactory finds the name of the Java class to instantiate from the "productCategoryImplementer" setting in the appComponents.properties file.

The default "productCategoryImplementer" is ProductCategoryBean.

Why is this a separate entity in the domain model? It was added while integrating Hibernate into the application. Our choices under Hibernate are to: (1) Use a birectional <many-to-many> mapping, which would not require a separate ProductCategory class. In this case the productCategoryOrder field would have to be represented as the index column in a <list> element. We voted this down because we felt making the productCategoryOrder field refer to a strict indexed ordering (no gaps or repetitions) is too restrictive when it comes to managing data imports and updates in the Administrator. (2) We could represent the relationship using a collection of components, ie a <composite-element> element in the Hibernate mapping. But, this requires us to create the ProductCategory class anyway, since the composite-element would have to refer to a real class. (3) Our preference is to define the ProductCategory element as a separate entity, with two many-to-one relationships on either side. The major advantage is it has maximum flexibility in terms of future growth, in case new columns need to be added to the relationship table.

Author:
David Tobey
  • Method Details

    • getProductCategoryID

      int getProductCategoryID()
    • setProductCategoryID

      void setProductCategoryID(int productCategoryID)
    • getCategoryID

      int getCategoryID()
    • setCategoryID

      void setCategoryID(int categoryID)
    • getProductID

      int getProductID()
    • setProductID

      void setProductID(int productID)
    • getProductCategoryOrder

      int getProductCategoryOrder()
    • setProductCategoryOrder

      void setProductCategoryOrder(int productCategoryOrder)
    • getProduct

      Product getProduct()
    • setProduct

      void setProduct(Product product)
    • getCategory

      Category getCategory()
    • setCategory

      void setCategory(Category category)