Reservation system for resources for 365days?

Posted on 2004-11-16
Last Modified: 2010-07-27
How to design a reservation system for resources that user can book any time & day they select?

Currently, my application design only do booking for today. As:

I am using a JTable to populate a list of resources with details for user to view. It also indicate the block of time that other user had booked. I joined the workstation table, pc table, peripheral table, and timeslot table. When a user booking is successful it will insert the name of the user to the block of time booked in this timeslot table.

I do have a Reservation table where by it stores all the reservation details such as the date, time, the workstation reserved, user id etc.

However, I can't possibly create a timeslot table for the 365days. It didn't make sense.  How is such system(reservation system) implemented for real/in the market?

Question by:coffee_bean
    LVL 35

    Accepted Solution

    Can't you just have a booking table which stores:

    Start Date/Time
    End Date/Time
    Person ID

    Then you can find bookings for a particular day, as that day will have StartTime <= today and EndTime >= today
    LVL 13

    Assisted Solution

    I think you need a more complex solution. Use a booking table as above, supplement this with rules (which you can implement as you prefer, code or data) related to which days are bookable (eg. not weekends / public holidays), the hours that can be booked (eg. 9am to 5pm), the length of time bookable etc....

    Then validate your user entry through these rules -- when valid update your table. You can also use these rules to present available timeslots, current bookings etc. to the user.

    You don't need to create all those timeslots, you define the rules related to timeslots and implement through a mix of rules and data....

    Author Comment

    Hi TimYates, I already had the booking table.
    >>I do have a Reservation table where by it stores all the reservation details such as the date, time, the workstation reserved, user id etc.

    Here is a screenshot of my resource reservation  if it's helps. It's still very basic at the moment.

    You see my table has the time block (columns) and information of the user who booked at that timeslot.
    I can do so becos I had a table (timeslot) that is created to handle reservation for that day. Whenever user successfully reserve a workstation, the name +id of the user is inserted into the timeslot table.  

    As said, I can't create a timeslot for 365days. So how am I suppose to create a table view of the resources, their timeslot availability and info of the user who booked on that slot??
    LVL 35

    Expert Comment

    I still don't get what you mean :-(

    What do you mean by "I can't create a timeslot for 365days"

    Sorry...  It's probably too early in the morning ;-)

    Author Comment

    i meant Timeslot table inside Microsoft Access database.
    This timeslot table is where I had columns of the time (eg0830,0930 ...etc)

    Timeslot table is one of the tables I used it to joined it with workstation table, pc table, peripheral table. so that I can display the columns of timeslot together with other workstation details. Whenever user successfully reserve a workstation, it will insert their name and user id into this Timeslot table.

    Screenshot if it helps.
    LVL 35

    Expert Comment

    Yeah, what I meant was instead of creating a table with a column for every time over a year, and a row for every resource, just create a table where it has a start time, and end time, and a resource id...

    You can then find timeslots for a specified time by using a "where" clause in your SQL

    Author Comment

    no no this qn has not been abondon. I will close this question myself. Thanks.


    Author Comment

    Tim Yates, bochgoch

    Thanks for the advice. I have closed this qn.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now