0

I'm working on a project for a friend and I've come across a difficult decision. The project consists of essays, each of which can be challenged, and also commented on. The thing is this, only one person is able to challenge the essay, and then everybody else is locked out and can only comment.

The rebuttals can only be two responses deep, 2,000 words for the first and 500 words for the second. At that point, no more rebuttals - the rest of the discussion takes place in the comments (fixed length of n chars, unlike rebuttals) if the viewers feel the topic wasn't exhausted.

So I initially decided that rebuttals and comments were structurally the same thing, and I would merely add a boolean field within my comments table to indicate if the comment is_rebuttal. But I'm feeling a bit unsure about that direction.

What would the collective-you suggest? Each essay can have a discussion between two people only, and both only get to speak 2 times. Very similar to comments, but separate.

Sampson
  • 265,109
  • 74
  • 539
  • 565
  • So is it like a conversation? Person A writes something, Person B disagrees, then Person A can reply to Person B and Person B can reply to Person A's reply, after which everything said by anyone is a comment? – nilamo Jun 28 '09 at 02:02
  • Correct, Nilamo. Person A has published an essay. Person B contests some of the facts, and the debate begins. It is "exhausted" after two publications from each thereafter, and the only communication permitted is done so through "comments," which are distinct from the debate itself. – Sampson Jun 28 '09 at 02:04
  • So comments can be entered at time after the essay posted, right? Whether or not rebuttals are entered is irrelevant? – hythlodayr Jun 28 '09 at 02:19
  • Comments can be posted before a rebuttal is posted, and after. A comment is only treated as a rebuttal if the user selects "Dispute this Essay," before anybody else. – Sampson Jun 28 '09 at 02:23

3 Answers3

1

Well, hard to say without knowing more about the system. But I'd say, from what you write, yes, rebuttals & comments are similar and should be put into a single table.

My motto always is: When in doubt, use the simplest method. Which here is clearly a single table.

If later it turns out that separate tables are more useful, you can always refactor.

sleske
  • 81,358
  • 34
  • 189
  • 227
  • So identifying "Rebuttal B" would be an issue of checking Is_Rebuttal, Comment_ID, Comment_DateTime, and Comment_Author_ID? – Sampson Jun 28 '09 at 02:06
1

So I'd probably have a table for 'conversations', with fields for the essay poster's userID, the single responder (initially NULL) and probably a title or abstract. Another table would contain 'essays' with fields for the essay or rebutter's userID, the conversationID, the body of the post, and a post count to put them in order. Finally, I'd have a 'comments' table with comment posters userIDs, essayID's to link them to essay posts, commentID's to put them in thread mode (if that's apropriate) and of course the comment body.

SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304
  • +1 i like the idea of a separate meta conversation table, with the ability to title the debate in question. i also enjoy the bitwise aspect of your answer: 1 table OR 2 tables? 3 tables. – akf Jun 28 '09 at 03:13
  • I think this way a lot. Usually it's A simple matter of modeling each of the 'things', and if the things are in some sort of groups, then you need to model those too. – SingleNegationElimination Jun 28 '09 at 03:32
0

If comments and rebuttals have different maximum lengths, and different restrictions on how many you can have per essay, they sound like very different things to me. Your schema will be clearer if you create two tables for entities with different limitations, and establish different column and referential constraints.

Mike Daniels
  • 8,582
  • 2
  • 31
  • 44
  • They do have their differences, yes. I suppose I should compare similarities/differences a bit more thoroughly. Thanks. – Sampson Jun 28 '09 at 02:08