jos. Posted December 30, 2007 Share Posted December 30, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/83727-solved-building-a-calendar-class-w-db/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.