The Product Class

I l @ ve RuBoard

The Product Class

Now that you have customers, it would be nice if they could buy something. For that, you need the products. Again, the Books for Geeks folks have no doubt supplied you with the product data: title, author(s), ISBN, price, and descriptive text. But there is also hierarchical information in the form of categories that you need to model. This is shown in Figure 5.5.

Figure 5.5. Products and categories.

graphics/05fig05.gif

One question that the client has not yet been asked and that now needs to be posed is this: Can a product live in more than one category? The answer, in this case, is yes. For example, a book like this that deals with Java, Web sites, and databases might end up in all three categories. This doesn't affect the ERD much, but it does mean that the database schema will be more complicated. This type of after-the-fact need for details is common in the early stage of a project; you will rarely remember to ask everything that you need to know on the first pass. Of course, the danger lies in details that you haven't asked about by the time the project ends.

I l @ ve RuBoard


MySQL and JSP Web Applications. Data-Driven Programming Using Tomcat and MySQL
MySQL and JSP Web Applications: Data-Driven Programming Using Tomcat and MySQL
ISBN: 0672323095
EAN: 2147483647
Year: 2002
Pages: 203
Authors: James Turner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net