Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Restaurant application

Thread view: 
Tony - 24 Feb 2006 03:31 GMT
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
Jeffrey Schwab - 24 Feb 2006 12:29 GMT
> 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?
tom fredriksen - 24 Feb 2006 16:10 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.