CSCI 5931A
Advanced Database Development
Fall 1998
Suggested Solution To Homework
#1
This Rational
Rose file contains a suggested use case diagram and a class diagram
for the problem.
Notes:
-
The top level use case is quite simple.
-
Choices should be modeled as a class, not an attribute.
-
Multiple post times are possible for a voting problem.
-
A derived variable, IsCurrent, is used as a quick way to
indicate which voting problem is 'current'.
An example relation schema:
-
Person(PersonId, FirstName, LastName, EMailAddress)
-
Adminstrator(PersonId, AccountName, Password)
-
PersonID is a foreign key of Person(PersonID).
-
PersonID is a candidate key of Administrator.
-
Alternatively, PersonID can be the primary key.
-
Vote(VoteID, PersonID, VoteTime, IPAddress, ChoiceID,
VotingProblemID)
-
PersonID is a foreign key of Person(PersonID).
-
ChoiceID is a foreign key of Choice(ChoiceID).
-
VotingProblemID is a foreign key of VotingProblem(VotingProblemID).
-
Comment(CommentID, VoteID, Description).
-
Alternatively, Comment may be an attribute in Vote.
-
VoteID is a foreign key of Vote(VoteID).
-
VotingProblem(VotingProblemID, SetterID, SetDate,
Question, IsCurrent)
-
SetterID is a foreign key of Administrator(PersonID).
-
Choice(ChoiceID, Order, Description, VotingProblemID)
-
VotingProblemID is a foreign key of VotingProblem(VotingProblemID).
-
Keyword(KeywordID, Name, Description)
-
ProblemKeyword(VotingProblemID, KeywordID)
-
VotingProblemID is a foreign key of VotingProblem(VotingProblemID).
-
KeywordID is a foreign key of Keyword(KeywordID).
-
PostTime(PostTimeID, StartTime, EndTime, VotingProblemID)
-
VotingProblemID is a foreign key of VotingProblem(VotingProblemID).