Jump to content

[SOLVED] Building a Calendar Class w/ DB


jos.

Recommended Posts

I am still in the design phase of my calendar class and the portion in question simply changes the color of the day number when a National holiday is displayed

 

all static holiday will be in a DB table and this table will be queried at the beginning of the creation of each month and the dates/Holiday Names will be stored in an array.

 

If a day of the month matches a day in the array on the smaller calendar the date will change color if the larger calendar is used then the name of the Holiday will be displayed as well...

 

Which would be using better practice as well as being more resource conservative?

A) Calculate all special dates (easter,ashWeds,GoodFri,MemorialDay,LaborDay,ThanksGiving etc..) for the next 100 years and store the dates for them each in their respective holiday table and use a query search for them during the creation of months

 

this method would be accurate and reusable seeing as how I could reapply the Holiday DB yet very non-flexible also this would mean more communication between the script and the MySQL server.

 

B) Build a class that calculates these special dates on the fly for each month when that month is displayed.

 

this method would be accurate and reusable and flexible but would require more processing when going from month to month...

 

My goal in this project is to better understand OO principles and design, so please when you state an opinion explain why the method you would choose is more efficient.

 

Thank you.

 

Jos.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.