Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My school programming club is setting up a tutoring program. We have 12 tutors who specialize in a range of different languages, and each is available for a different set of hours each day of the week. I want to set up a web interface where students can select the language they need help in, and then be shown a list of the time spans each day that there is a tutor in that language available to help them.

My main question at this point is how I should go about storing tutor availability data - should I use a database (and if so, how), or should I simply store availabilities as fields in POJO "Tutor" objects. If the latter would be best, what data-type should I use? Can I get by simply storing them as strings or should I use joda or java.util Date objects? The task that seems particularly tricky to me at this point is combining availabilities of multiple tutors into a single time-span for each day - i.e., if I have one tutor available from 10-2 and one available from 12-4, I want a single line saying "10-4" to be presented to the user.

I'm just beginning to design my approach to this task, so I'm very open to general suggestions and/or having unforeseen problems pointed out to me.

I would like to use a Java JApplet as my web interface.

share|improve this question
I'd not recommend Applets due to the large number of security concerns and the fact many browser manufacturers are switching them off. Something like GWT might be a good pick in this case. – Martijn Verburg Mar 14 '13 at 11:45
up vote 1 down vote accepted

In a tutor availability table store triplets of tutor_id, start_available, end_available with the latter two being some sort of date/time.

Have a query that joins from tutor availability through the tutor_id to a table for specific skills, and returns that availability information sorted by start_available, then end_available. Do the merge in code. (If you really want you can push that to the database using analytic queries, but you'll probably find code easier.)

The details of converting between the database representation and an in memory representation that you can easily manipulate are up to you and your ORM. I am not personally a Java programmer, but suggests that joda is a reasonable option.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.