Creating XML Taxonomies - Our Parents
(Page 3 of 4 )
What information might we need for our reports? For starters, let's look at all of the information we can obtain about the objects we are selling, albums. Here is a list of data we could obtain from each:
Artist Who is the album made by/who are the musicians playing on the album?
Genre What type of music is it? Is it rock, country, rap?
Format Is the album a vinyl album? Is it a CD? Is it a digital format?
Price How much does it cost?
Unique ID Every album we sell must have a unique key to identify it and ensure there is no duplication. For instance, there may be many albums by the Rolling Stones, and many albums named Tooty Fruity. How do we differentiate them using only one field? A unique key is required. Real world examples of unique keys are social security numbers, bank account numbers, or the ISBN of a book.
Label Which record label put out the album?
Length How long is the album in terms of minutes?
Release When was the album released?
We will stop there. As you can see, the list can get out of hand quickly. And that is just a list of categories/parents for the albums.
In our taxonomy we will also want to know things about the person buying our albums. We could use the information to send them newsletters, or suggest music based off of previous purchases. It would also help to prevent transaction fraud. Here are some fields of data that we may wish to collect:
First Name The first name of the buyer
Last Name The last name of the buyer
Address The address of the buyer
Email The buyers email address
Phone number This will act as the users unique key. In the grand scheme of things, this could cause problems of course. If more than one person lives in the same house and uses the same number, for instance, or if the person abandons the phone number and someone else picks it up, there could be issues. We might actually want to create a customer number instead, so lets go ahead and do so.
CustomerID a unique number to identify the customer
Again, we could have gone crazy and added more fields. Address could have been broken down to State, City, Zip Code, etc, and when developing your own application, you might wish to break it down in this manner. This would give you more of a geographical feel for your customers. If you ever wanted a list of everyone from a certain city for instance, you would need that City field.
Lastly, we are going to want to know information about the transaction itself. Here are some fields:
Unique ID This is the same field we used in our first section. We will use it here to tie the album to the sale.
Price How much does it cost?
Coupon Is there a coupon being used or a special sale?
Shipping How much does shipping cost?
TotalPrice What is the total price after coupons/sales and shipping have been calculated?
Date Date the transaction occurred
Type Retail or Internet sale?
Next: What's Next? >>
More XML Tutorials Articles
More By James Payne