如何最好地处理例外以重复日历事件 [英] How to best handle exception to repeating calendar events

查看:149
本文介绍了如何最好地处理例外以重复日历事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要我实现日历的项目。我试图想出一个非常灵活的系统:可以处理重复事件,重复的异常等。我已经查看了像iCal,Lotus Notes和Mozilla等应用程序的模式,以了解如何去实现这样的系统。目前,我有麻烦决定什么是最好的方式来处理重复事件的例外。我使用的数据库相当有点,但没有真正优化的一切,所以我不知道哪些方法的两个我将考虑最佳的整体性能和查询/搜索能力的经验:

I'm working on a project that will require me to implement a calendar. I'm trying to come up with a system that is very flexible: can handle repeating events, exceptions to repeats, etc. I've looked at the schema for applications like iCal, Lotus Notes, and Mozilla to get an idea of how to go about implementing such a system. Currently I'm having trouble deciding what is the best way to handle exceptions to repeating events. I've used databases quite a bit but don't have a ton of experience with really optimizing everything so I'm not sure which method of the two I'm considering would be optimal in terms of overall performance and ability to query/search:


  1. 中断重复事件。因此,改变重复事件的当前行的结束日期,插入一个包含异常的新行,并添加继续旧序列的另一行。

  2. 只需添加例外。因此,添加一个新行,其中包含一些字段,表示它为覆盖。

这里是为什么我不能决定。方法一将导致更多的行,因为每个编辑需要2个额外的行,通过第二种方法只应用于一行。另一方面,我认为查询查找事件会更加简单,因此可能更快(?)使用第一种方法。第二种方法似乎需要在应用程序服务器上进行更多的计算,因为一旦你得到数据,你必须删除两行的交集。我知道数据库通常是网站的瓶颈,虽然我相信很多你认为或许是好的,因为你的项目可能永远不会足够大的效率差异真的很重要,我仍然想实现最佳解决方案。那么,你会选择什么方法,或者你会做一些完全不同的事情吗?

So here is why I can't decide. Method one will result in a lot more rows since each edit requires 2 extra rows as apposed to only one row by the second method. On the other hand I think the query to find an event would be much simper, and thus possibly faster(?) using the first method. The second method seems like it will require more calculating on the application server since once you get the data you'll have to remove the intersection of the two rows. I know databases are often the bottleneck for websites and while I'm sure a lot of you are thinking either is fine because your project will probably never get large enough for the difference in efficiency to really matter, I'd still like to implement the best solution. So what method would you guys pick, or would you do something completely different?

另外,我将使用MySQL和PHP。如果有其他技术,你认为更适合这一点,特别是在数据库领域,请提及它。

Also, as a side note I'll be using MySQL and PHP. If there is another technology that you think would be better suited for this, especially in the database area, please mention it.

感谢您的建议。

推荐答案

我决定只输入一个异常行,并使用代码从重复集中删除它们。这将是一段时间,我完成之前,但我会尝试,并记得回到这里与一些性能结果,当它完成后。

I've decided to just enter a row with the exceptions and use code to remove them from the repeating set. It'll be awhile before I'm done with it but I'll try and remember to post back here with some performance results when it's all done.

这篇关于如何最好地处理例外以重复日历事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆