471,066 Members | 1,246 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Recurring appointments philosophy

Hi All

I am writing a program for a gymnasium for membership control

It is the first time I have had to deal with appointment diaries and I want
to know the best way to store recurring appointments

1. Do I calculate and save all future appointments as table records at the
time of creation of the Recurring appointment or ..
2. Do I just save the details and create the appointments in code whenever
the need to be displayed in a diary page
Nov 21 '05 #1
1 2272

I am doing up a doctor's office system for a friend so I am working on
this too. I haven't gotten as far as designing this part yet but from
other calendar systems I see requirements for

- Being able to alter all the recurring entries at once - say change
them all from 1:00pm to 1:15
- Being able to alter specfic entries without impacting the others -
say change next week's to 1:15 but leave all the others at 1:00.
This much has lead me so far to

1) Create a 'Repeating Appointment' entry and place in the

- If we only generate and store the individual appointment entries
then we create an amount of extra work for ourselves
if we ever want to do a mass change. basically we'll need to
recreate this entry so we may as well store it now.

2) Create enties for each appointment instance and place in the
appointment table, FK to the recurring appointment

3) If we want to modify an individual entry then we need to update the
appointment instance

- here is one reason why I prefer the pre-create rather than
create on the fly. In the on the fly approach, if we modify a specific
appointment instance then when we generate all the appointment
instances from the recurring appointment we'll need to subtract this
'real' appointment. It gets even worse if we delete a specfic
appointment because we now need a placeholder to show a deleted
appointment to be subtracted from the recurring appointment.

4) if we want to do a mass update, some properties we will want to
change on everything, even the modified appointments (say a location or
a doctor / trainer) others we shall want to leave as modified. e.g. If
we want to change the time for all of them but have already moved the
appointment for 10/12 back half an hour because the client/patient can
only make it at that time, well then we'll want to skip that one but
modify all the others.

- one may want to offer an option to update the already modified
entries on a case by case basis.

2 tables

RecurringAppointment - details of the recurring appointments

Appointment - Holds all the appointment details, a modified flag and a
FK to the RecurringAppointment table
Modified is an optimization idea and may not be
neccessary (or even a good idea - still whiteboarding all this)
When a Recurring Appointment is created
Add one entry recurring and n entries to appointment

Modify an instance
Modify entry in appoinrment, update the modified flag

Modify all
Modify all entries with the specific FK - don't update modified
for each appointment with the modified flag set, query whether to
update the value. Offer a yes/no to all option

Delete Instance
delete entry from appointment table

Delete all
Delete entry from recurring
Delete all entries (including modified) from appointments (or offer
choice for each modified - depends on reqs)

As I said, I am working on the same type of problem so I would be very
interested in comments on the above and/or any suggestions people may


Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Shabam | last post: by
1 post views Thread by VB Programmer | last post: by
1 post views Thread by keri | last post: by
reply views Thread by Stephen B. Burris Jr. | last post: by
1 post views Thread by TC | last post: by
reply views Thread by =?Utf-8?B?TWVlbWEgSnVkeQ==?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.