TO DO: Kata 1: Timestamp as secondary index
The example system provides a single key for retrieval of a Contact: it's unique ID. For this Kata, we will first implement a secondary key for Contacts that consists of a timestamp represented as a long value. For example, (new Date()).getValue() returns the current time as a long value. This timestamp could mean a variety of things in practice, such as the time the contact was created, or the contact's birthday, etc., but we won't worry about that for now.
Write unit tests to make sure that your secondary index works correctly, and that in particular you can retrieve a set of Contacts whose timestamps fall within a specified range.
Once implemented, extend the ContactClient system with two new commands:
- get-timestamp: returns the Contact with the given timestamp, if such a Contact exists.
- get-range: returns the set of Contacts with timestamps between two specified values.
Note that all of the sensor data in the Solar Decathlon system will have timestamps associated with them, and a frequent operation on the database will be to retrieve the sensor data instances during a given time period, so this kata will help you understand how to do that.
RESULT: This Kata was very confusing at first specifically the relation that we need to use for the secondary index. We decided to chose ONE_TO_ONE. It took us about half an hour to decide on this. We first tried to use ONE_TO_MANY but it needs an array or collection to hold the key. This made the addition of secondary key a lot harder. Since I don't any experience with databases, I over think this simple problem and cost me to consume more time finishing this Kata. It took me more than 2 hours to finish this Kata.
TO DO: Kata 2: Wicket, REST, and BerkeleyDB
Create a client-server system for managing contacts that:
- Provides a Wicket client. The wicket client should consist of a single page, and allow the user to store a contact given its info, and retrieve a contact given its unique ID. The Wicket client code should invoke an underlying Restlet-based module to send a request to a ContactDB server to put or get data.
- Provides a Restlet and BerkeleyDB server. The server should accept and process requests using Restlet, and use BerkeleyDB to persist the Contacts.
Download: Berkeley DB Katas