Restaurant application

T

Tony

Hi,

I'm writing an application for a restaurant. Part of the application is
the table scheduling, but I'm not sure how to store the available
reservations. If I prefill these for the next year, it is going to take
up a lot of space in the database.

Thanks for the help.

Tony
 
J

Jeffrey Schwab

Tony wrote:

I'm writing an application for a restaurant. Part of the application is
the table scheduling, but I'm not sure how to store the available
reservations. If I prefill these for the next year, it is going to take
up a lot of space in the database.

Can't you just add rows to your Reservations table as the reservations
are made? Why would you prefill?
 
T

tom fredriksen

Tony said:
Hi,

I'm writing an application for a restaurant. Part of the application is
the table scheduling, but I'm not sure how to store the available
reservations. If I prefill these for the next year, it is going to take
up a lot of space in the database.

It depends a bit on how you represent the information in the program and
how you want to manipulate it.

1:
with a database where you only have search results in program memory you
just represent it as a reservation table with the information date,
time, timespan, table_num, customer_name etc
you do simple seraches which returns some rows which you add in an
ArrayList and display. You could search for all reservations on a
certain date or on a date for table num x, etc

2:
if you want to hold it in memory (todays and tomorrows reservations) and
perform in-memory searches you need to create a memory representation
that can perform such operations quickly and easily, ex.

- have an object representing a reservation. it contains the table
number, the date/time and timespan (the timespan depends on the policy
of the restaurant as some restaurants only have one reservation for the
table for the whole evening, while others have several)
- then you have two indexes: date and table which will hold a reference
to the reservation

You would of course store it aswell, but for that you only need to
serialise it to either a file format, binary or xml or you could use
javaspace, bbdb, or a sql or oo db.

/tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top