Difference between revisions of "DIT085 Ed 2015 Practical Phase 1"
From CERES
(Created page with "The first phase of this project concerns test-driven development of the kernel of our WhatsUpGU server. Before we start test-driven development, we need to fix the interface o...") |
|||
Line 3: | Line 3: | ||
should provide the following functionalities: | should provide the following functionalities: | ||
− | * Add: adding a string message from a given Id (the sender's telephone number) for a given ID (the recipients telephone number); the message is supposed to be stored at the server side until it is fetched by the recipient. For simplicity, we assume that the message is stored in the memory. Upon successful addition of the message a unique positive integer as the identifier of the added message is returned; upon failure a value indicating error (0 or a negative number is returned). | + | * Add: adding a non-empty string message from a given Id (the sender's telephone number) for a given ID (the recipients telephone number); the message is supposed to be stored at the server side until it is fetched by the recipient. For simplicity, we assume that the message is stored in the memory. Upon successful addition of the message a unique positive integer as the identifier of the added message is returned; upon failure a value indicating error (0 or a negative number is returned). |
+ | * Delete: the sender of the message can delete the message before it is fetched by the recipient. To do this, the sender should provide the Id of an existing message. If the message exists (and it is not yet fetched), the message is deleted and the Id of the message (a positive integer) is returned. Otherwise 0 or a negative number indicating the reason for the error is returned. | ||
− | * | + | * Replace: like in the previous item, the sender of the message can modify the message before it is fetched by the recipient. To do this, the sender should provide the Id of an existing message and a new non-empty string to replace the existing message. If the message exists (and it is not yet fetched), the message is replaced by the new string and the Id of the message (a positive integer) is returned. Otherwise 0 or a negative number indicating the reason for the error is returned. |
− | + | * Fetch: when a cell-phone gets connected to the Internet, it contacts the server and fetches the messages sent to it since its last time online. | |
− | + | ||
− | * Fetch: | + |
Revision as of 07:51, 12 January 2015
The first phase of this project concerns test-driven development of the kernel of our WhatsUpGU server. Before we start test-driven development, we need to fix the interface of the to-be-implemented module, which should provide the following functionalities:
- Add: adding a non-empty string message from a given Id (the sender's telephone number) for a given ID (the recipients telephone number); the message is supposed to be stored at the server side until it is fetched by the recipient. For simplicity, we assume that the message is stored in the memory. Upon successful addition of the message a unique positive integer as the identifier of the added message is returned; upon failure a value indicating error (0 or a negative number is returned).
- Delete: the sender of the message can delete the message before it is fetched by the recipient. To do this, the sender should provide the Id of an existing message. If the message exists (and it is not yet fetched), the message is deleted and the Id of the message (a positive integer) is returned. Otherwise 0 or a negative number indicating the reason for the error is returned.
- Replace: like in the previous item, the sender of the message can modify the message before it is fetched by the recipient. To do this, the sender should provide the Id of an existing message and a new non-empty string to replace the existing message. If the message exists (and it is not yet fetched), the message is replaced by the new string and the Id of the message (a positive integer) is returned. Otherwise 0 or a negative number indicating the reason for the error is returned.
- Fetch: when a cell-phone gets connected to the Internet, it contacts the server and fetches the messages sent to it since its last time online.