CSE 490c/303 Homework Release Notes

This is a piece of Homework 7. If you haven't come here by first reading that, this page won't make much sense.
This is it - you're flying solo.

Your team is in total control of what you end up building. We have some expectations about the amount of effort put in on this, but what to do with that effort is up to you. "Build a cseBay" is the full spec.

Setup

cvs update will fetch all of the files used in my mockup of cseBay, except for processTemplate.pm (which is the milestone 2 assignment).

What To Do

You have free rein. Your group needs to design what pages you'll have, then it needs to implement them.

The sample code and template pages should provide a lot of guidance about how to accomplish things. The big things missing are HTML forms (that let users enter data, e.g., to create a new cseBay account) and SQL database updates (e.g., to enter new bids). I've added some links to the documentation page, but it's (intentionally) minimal.

Take the design phase seriously. You should try to map out what you want your site to be/do in some detail, so that you can map out what needs to get done in some detail. Then decide on a "schedule", which in such a short period really means an order in which to try to do things, and an assignment of responsiblities among the team members.

Try to figure out what your "biggest risks" are up front. Typically, these are the things you know least about -- anything you have no idea at all how to do at this point would be a candidate, for instance. Try to minimize your risks by attacking them first. Get far enough along on each thing you don't understand that you understand it, even if you don't do a complete implementation. (For instance, if you don't know about HTML forms, try experimenting with them until you do, even if you haven't built quite exactly the final forms you'll need. Then move on to the next risk.)

Especially while you're whittling down the risks, communication among the team members is crucial. Best is to work in the same location. No matter what, you'll almost certainly want to be in touch with each other regularly (every couple of hours of work time, I'd guess, at least). Once the risks are conquered, it's more likely that you can make working independently for long periods of time.

The SQL Database

(The DB is the MySQL flavor of SQL. Only under circumstances that would normally indicate some kind of misunderstanding should that information be of any relevance to you, though.)

The SQL database requires use of an account that it manages, that is, an account that has nothing to do with your CSE login name or password. You'll find the account to use (name and password), as well the as the DB name and location (host machine), in the sample code you fetched with the cvs update.

You will all have the permissions required to modify, add, or delete any entries the in DB. You will all be using data from a single DB. That means that any changes you make will be seen by everyone. We don't anticipate that this will cause any problems that aren't just part of normal life using a DB, but it does mean that your code may need to be more than usually prepared to deal with problems - DB data that doesn't make sense. Everyone will be debugging, so somewhat arbitrary things could happen to the DB data.

Note: The database has been designed so that nothing is ever deleted from the DB. Instead, the things that one might imagine deleting have a "valid bit" associated with them. We don't delete anything from the DB, we simply mark it as invalid.

Note:!!!! It's harder than you might expect to put the DB back into a reasonable state if you do delete something. For instance, say you test creating a new user, then you test having that user list some items for sale and maybe make some bids herself, and then you delete that user. The DB will be littered with references to the user, who no longer exists. That's probably not good, and fixing it may or may not be complicated.

One thing you don't have permission to do is change the DB schma. You have to live with what we set up, the three following tables:

users (that's the table's name)
Field name (DB column)Use
idA unique-for-all-time integer identifying a user
firstnameOddly enough, a first name
lastnameDitto
nicknameA cseBay user name for this person
passwordTheir cseBay password, in plain text
ratingUser feedback total
validIf 0, this record has been (logically) deleted.

items
FieldUse
idA unique-for-all-time integer identifying an item
ownerThe (integer) unique id of the user listing this item
titleThe one-line description of the item
descriptionan arbitrary chunk of HTML supplied by the cseBay user
starttimeThe time at which this item was listed, in the units used by perl's time function (seconds since 1900 began).
Note:If you're running code on a Mac, it looks like your times as provided by perl may be off 3 or 4 years from the ones stored in the DB. (See the perl doc.)
endtimeThe time at which this item's auction ends
highbidThe amount of the highest bid for this item so far, as a double (e.g., 20.25)
validIf 0, this record has been (logically) deleted, probably because the auction expired.

bids
FieldUse
item_idThe unique id of the item this bid is for
bidder_idThe unique id of the user making this bid
amountAs a double
bidtimeWhen the bid was placed

Because of a bad decision made years ago, bids do not have valid bits. There is no way to delete them logically as it stands, and because of the massive amount of legacy code that has built up it's unthinkable to change the schema to add a valid bit now.

You may not end up using all these fields. For instance, if user ratings is low on (or maybe completely off of) your priority list, you may not get to it, and won't have any code using that field.

The DB Data

Most of the links in the sample data are live -- if you click on them, you're headed to real, commercial sites, where money is real money. (That's just an undoubtedly unnecessary heads up.)

Useful Tool

MySQL Control Center lets you look at and modify the DB. That's handy, as it gives you a way to determine whether your code has in fact fetched the right data, etc.

Tempting but Maybe Not Useful Tool

Mozilla has an HTML editor -- Window menu, Composer. It seems like Composer would make it easy to create new .template files -- you just create and save them using Composer, then rip off the head (up through <body>) and tail (</body></html>) and you've got a template.

The problem is that while you can use Composer to create templates, you can't use it to edit the templates -- even if you put the head and tail back on, there's those pesky lines with braces at each end to worry about. (Composer will at the very least break them, if not break itself when it sees them.)

I still think Composer might be of some use, though. If there's some look you want your page to have but you don't know the HTML for it, it's often easier to create a sample in Composer and look at the HTML it has created than to find, read, and understand documentation (the search part of which usually requires knowing the name of some HTML tag you don't know the name of).

The bots

There are two bots running:

The Distributed Sample Code

Distributed as is, with no guarantees or warrantees of any sort. (One bug was left in intentionally, but it's minor and you probably won't ever see it as things have turned out. If you want to know more about it, I'm happy to explain in person, but it would be ineffective to try to do it in writing here.)