Project 3

For this project you will work on the code repository created by one of the other teams for Project 2. You will extend and improve this implementation in several ways, as described below.

New Features

Implement support for the following new requests:

/statuses/remove

Method: POST
Parameters:

tweet_idUnique identifier for a tweet.

Deletes the tweet specified by tweet_id, so that it will never be returned by future /statuses/home_timeline.json or /statuses/user_timeline.json requests. The tweet must be removed from storage so that it no longer occupies space either in memory or on disk.

/users/set_quotas

Method: POST
Parameters:

my_idIdentifier for a user.
day_quotaAn integer value giving the maximum number of tweets that user my_id may create in any calendar day (a period running from midnight to midnight). A value of zero means that there is no daily limit.
week_quotaAn integer value giving the maximum number of tweets that user my_id may create in any seven consecutive calendar days. A value of zero means that there is no weekly limit.
month_quotaAn integer value giving the maximum number of tweets that user my_id may create in any 30 consecutive calendar days. A value of zero means that there is no monthly limit.

This request updates the quotas for the given user. If this request has never been invoked for a user, the default values for all of the user's limits are 0 (i.e. no limit on tweets). If a user attempts to create a tweet that would exceed any of the quotas, the tweet creation request will be rejected with an error.

Refactoring

You will probably need to make some architectural changes to the existing implementation in order to support the new features. You may also discover things in the existing implementation that can be improved. Feel free to make changes to improve the structure of the existing code. Even if the new features can be implemented with no architectural changes, find at least a couple of places where you can make improvements by refactoring. You should spend at least 25% of your total time for this project on refactoring; focus on a few changes that are most important for the new features, or that have the biggest impact on overall complexity.

When you are refactoring, work within the existing code base; do not copy code from your own Project 2. For example, it is not OK to do wholesale replacement of major modules with the corresponding modules from your Project 2. Look for improvements that conform to (much of?) the existing architecture and style.

In your work for this project, don't take the quick-and-dirty approach of making the fewest possible code changes to implement the new features. Instead, try to produce a result that looks like it was designed from the beginning to support the new features, with a clean and simple implementation. This is a good general approach to use any time you are enhancing existing code. If you take the fewest-possible-code-changes approach, the code will get more complex and harder to read with each change.

Create a file refactoring in the top-level project directory that summarizes the major architectural changes you made during this project.

Unit tests

Create Junit tests for all of the new methods you wrote for this project, as well as any existing methods in which you made major changes. You need not write unit tests for existing methods that you did not change substantially.

You should use a code coverage tool to help ensure that you have tested all of the functionality of your new methods. I recommend EclEmma, if you are using Eclipse: I have found it to be easy to use and pretty powerful. If you have some other coverage tool that you prefer, that's fine also.

Submitting Your Project

To submit your project, create another issue on cs190codereview.appspot.com as follows:

Once you have created the code review, check to make sure it is visible at cs190codereview.appspot.com.

Late Days

If you are planning to use late days for this project, please send me an email before the project deadline so that I know your plans. Send me another email once you eventually upload your code review.