Domain Model translated from an Excel Sheet

0
Hello and thanks in advance, I created an Excel sheet. It basically is a statistic of multiple questions for multiple users. It has four sheets: User (UserID, FirstName, LastName, Email, Username, Password) Question (QuestionID, QuestionText) Answer (AnswerID, QuestionID, AnswerText) UserAnswer (UserID, AnswerID)   Is the Domain Model below a good representation of the excel sheets? If not, what needs to be fixed?  
asked
1 answers
1

First, I think that the best advice that I can give is to check out the AppStore app Questionnaire, app 116433.  This is widely used and probably fits your needs and much more.

Concerning your domain model, you probably started doubting your design because you can not clearly imagine the what and why of UserAnswer. Since UserAnswer has no attributes, and two incoming 1-* associations, you can delete it and directly associate User with Answer with one *-* (many to many) association. Each association between two entities is, in the database, a single database table with nothing more than two id-fields referring to the object-id's of each associated table.

Still, this domain model will not do, since each user can get an association with multiple answers to one question, which might not be your intention. Also, if in a later test/course/exam the same user gets the same question, how are you going to distinguish the two? Not possible now. So another entity should be inserted. But have a look at the Questionnaire app and you will find that others have paved the path for you long time ago.

 

answered