vendredi 18 décembre 2020

Designing classes for a scenario

This is a design question. A program runs the back end of a website like Piazza.
Some of the messages are posted by regular users (students), displaying the name of the author
and time that is was posted. Other messages are posted by admin users (instructors and TAs) and
contain the same information as well as the number of times the message has been edited by the original author.
When a message is posted, it appears with tags afterwards. Tags are strings that
start with an @ sign. They are chosen by author of the message.
The system that keeps track of each message, its tags, who posted it, and links together
messages that are part of the same conversation is called the Message Board.
A user can request to only see posts with a particular tag. For example, a user can search
all messages that discuss design patterns by searching for@designPatterns.

  1. Should classes UserMessage and AdminMessage implement the same interface?
  2. Should classes UserMessage and AdminMessage extend a class other than object ?

Aucun commentaire:

Enregistrer un commentaire