Re: How to model Recurring events?

From: Thomas Muller <ttm_at_online.no>
Date: Sat, 21 Jul 2001 23:31:11 GMT
Message-ID: <9gg463$dol$1_at_news6.svr.pol.co.uk>


Hi Satish,

I've had similar problems before, and I find that the Unix crontab representation works very well. If you're not familiar with the crontab pattern, here is a short explanation

A crontab consists of five fields each specifying an integer pattern as follows:

Each of these patterns may be either an asterisk (meaning all legal values) or a list of elements separated by commas. An element is either a number or two numbers separated by a minus sign (meaning an inclusive range). Note that the specification of days may be made by two fields (day of the month and day of the week). Both are adhered to if specified as a list of elements.

I've added a couple of fields: timezone (the timzone the crontab operate within), and valid timeset (the timeset the crontab is valid).

Actually the Crontab is a class that implements the more general TimeSet interface which basically is a set of explicit moments and/or periods of time.

The Crontab leaves you with complete flexibility for modelling recurring events.

Now have do you store this in a relational database? Well, you could just keep is as a text value in a column relevant for the events. In order to speed up queries you would definately have the code running in the database itself, e.g PL/SQL / Java for Oracle. You might want to split that various field to different columns, but I'm not sure how much you would gain.

--

Thomas


"Satish Kamatkar" <satish_at_marathimitra.com> wrote in message
news:20df3b70.0106121938.11423974_at_posting.google.com...

| Hi -
|
| I am about design a data model for a Calendar application. Here are
| some basic requirements:
|
| 1...In this application events (Appointments - like in Outlook) can be
| created. These events can be one time or they can be recurring. The
| recurrance can be finite or infinite. i.e an event can occur every
| Monday for current year OR an event can occur every day until end of
| time.
|
| 2...Also user should be able to manage (modify/delete) each occurance
| of a recurring event indivisually. The modification/updates to any
| particular occurance of an event must not affect other occurances.
|
| My question would be what kind of tables/logic would be best to achive
| this functionality?
|
| Any thoughts?
|
| Thanks,
|
| Satish
Received on Sun Jul 22 2001 - 01:31:11 CEST

Original text of this message