循环设计需要帮助
我正在编写一个小型网络应用程序来跟踪许多“票证”。
用户可以为工单设置重复规则,工单将根据重复规则自动创建。例如,用户可以设置规则以在每月的第二个星期一创建票证。
我目前的建议是使用 iCalenlar 格式(RFC 2445/5545),规则与 iCal 格式中的 RRULE 相同。我还必须编写一个 Windows 服务来检查重复情况并在数据/时间到期时创建票证。
我的问题是我做得对吗?使用 iCal 格式是最有效的重复方法吗?有没有其他方法可以完成此类工作?对我当前的设计有什么批评吗?
谢谢。
I'm writing a small web application that keeps track a number of "tickets".
The users can set recurrence rules to tickets and the tickets will be created automatically based on the recurrence rules. For example, a user can set a rule to create a ticket every second Monday of every month.
My current propose is to use the iCalenlar format(RFC 2445/5545), the rule will be same as RRULE in iCal format. I will also have to write a Windows Service to check the recurrence and create tickets if the data/time is due.
My question is whether I am doing it right? Is using iCal format the most efficient way to do recurrence? Are there any alternatives to do this kind of work? Any critiques on my current design?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
iCal 的 RRULE 语法是描述重复的好方法,前提是它允许表达应用程序中所需的所有重复规则。
然而,iCal 仅提供语法。您需要设计和实现一个系统来计算实际实例并相应地安排票证创建。这很难做到正确。您可以尝试使用现有的日历软件来实现此目的,但我会研究专门为满足您的需要而设计的软件:即 cron 或 Windows 任务计划程序。
The RRULE syntax of iCal is a good way to describe recurrence, provided that it allows to express all recurrence rules you need in your application.
However, iCal just provides the syntax. You'll need to design and implement a system that calculates the actual instances and schedules ticket creation accordingly. This is difficult to get right. You could try to use existing calendaring software for this, but I'd look into software that is designed to do what you need instead: namely cron or the Windows Task Scheduler.
只是一个想法:
为您的票证添加一个属性“有效时间”,并提前预先创建其中一些票证...这样,如果您需要创建许多同时创建的票证,您就不会遇到麻烦时间...(但是,如果您的系统只需要处理少量票证,则不需要这个)
just an idea:
add an attribute to your tickets "Valid after " and pre-create some of them ahead of time ... that way you won't get into trouble if you need to create many tickets that would be created at the same time... (however you won't need this if your system will have to handle just a small amount of tickets)