久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  1. <tfoot id='8pJMH'></tfoot>
    <legend id='8pJMH'><style id='8pJMH'><dir id='8pJMH'><q id='8pJMH'></q></dir></style></legend>
  2. <small id='8pJMH'></small><noframes id='8pJMH'>

      <bdo id='8pJMH'></bdo><ul id='8pJMH'></ul>

      <i id='8pJMH'><tr id='8pJMH'><dt id='8pJMH'><q id='8pJMH'><span id='8pJMH'><b id='8pJMH'><form id='8pJMH'><ins id='8pJMH'></ins><ul id='8pJMH'></ul><sub id='8pJMH'></sub></form><legend id='8pJMH'></legend><bdo id='8pJMH'><pre id='8pJMH'><center id='8pJMH'></center></pre></bdo></b><th id='8pJMH'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8pJMH'><tfoot id='8pJMH'></tfoot><dl id='8pJMH'><fieldset id='8pJMH'></fieldset></dl></div>

      在構建日歷應用程序時,我應該在我的數據庫中

      Should I store dates or recurrence rules in my database when building a calendar app?(在構建日歷應用程序時,我應該在我的數據庫中存儲日期或重復規則嗎?)
        <tbody id='YlheQ'></tbody>
      <i id='YlheQ'><tr id='YlheQ'><dt id='YlheQ'><q id='YlheQ'><span id='YlheQ'><b id='YlheQ'><form id='YlheQ'><ins id='YlheQ'></ins><ul id='YlheQ'></ul><sub id='YlheQ'></sub></form><legend id='YlheQ'></legend><bdo id='YlheQ'><pre id='YlheQ'><center id='YlheQ'></center></pre></bdo></b><th id='YlheQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='YlheQ'><tfoot id='YlheQ'></tfoot><dl id='YlheQ'><fieldset id='YlheQ'></fieldset></dl></div>

      <tfoot id='YlheQ'></tfoot>

      <small id='YlheQ'></small><noframes id='YlheQ'>

    1. <legend id='YlheQ'><style id='YlheQ'><dir id='YlheQ'><q id='YlheQ'></q></dir></style></legend>

      • <bdo id='YlheQ'></bdo><ul id='YlheQ'></ul>

                本文介紹了在構建日歷應用程序時,我應該在我的數據庫中存儲日期或重復規則嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在構建一個日歷網站 (ASP.NET MVC) 應用程序(想想 Outlook 的簡單版本),我想開始支持重復出現的日歷事件(每月、每年等)

                I am building a calendar website (ASP.NET MVC) application (think simple version of outlook) and i want to start supporting calendar events that are recurring (monthly, yearly, etc)

                現在我在我的存儲實際日期,但我想弄清楚如果重復,繼續存儲日期是否有意義(有一些明顯的截止),或者我應該存儲重復選項并生成日期在飛行中.

                right now I am storing actual dates in my but I wanted to figure out if, with recurrence, does it make sense to continue to store dates (with some obvious cutoff), or should I store the recurrence options and generate the dates on the fly.

                這讓我想到了 Outlook、谷歌郵件等是如何做到這一點的,或者任何其他支持定期日歷項目的服??務.

                It got me thinking how outlook, google mail, etc does this or any other service that supports recurring calendar items.

                對此有什么建議嗎?

                推薦答案

                將您的數據分為兩部分:規范"數據(重復規則)和服務"(生成日期;除了重新生成之外只讀).如果規范數據發生更改,請在該點重新生成服務"數據.對于無限重復,保留一些實例并在用完時生成更多實例(例如,如果用戶查看 2020 年的日歷).

                Separate your data into two parts: the "canonical" data (the recurrence rule) and "serving" (generated dates; read-only aside from regeneration). If the canonical data changes, regenerate the "serving" data at that point. For infinite recurrences, keep some number of instances and generate more if you run out (e.g. if the user looks at their calendar for 2020).

                如果您有無限的處理器速度,您只需要規范數據 - 但實際上,對每個頁面視圖上的所有重復規則進行所有日期/時間處理可能是太費時了……所以你要犧牲一些存儲(和復雜性)來保存重復的計算.與大量事件所需的計算相比,存儲通常非常便宜.如果您需要存儲事件的日期,那真的非常便宜 - 您可以輕松地使用 4 字節整數來表示日期,然后從中生成完整的日期/時間,假設您重復都是基于日期的.對于基于時間的重復(例如每三個小時"),您可以使用完整的 UTC 瞬間 - 只要您可能需要,8 個字節就可以將其表示為非常精細的分辨率.

                If you had infinite processor speed, you'd only need the canonical data - but in reality, doing all the date/time processing for all the recurrence rules on every page view is likely to be too time-consuming... so you trade off some storage (and complexity) to save that repeated computation. Storage is usually pretty cheap, compared with the computation required for a large number of events. If you only need to store the dates of the events, that's really very cheap - you could easily use a 4 byte integer to represent a date, and then generate a complete date/time from that, assuming your recurrences are all date based. For time-based recurrences (e.g. "every three hours") you could full UTC instants - 8 bytes will represent that down to a pretty fine resolution for as long as you're likely to need.

                不過,您需要小心保持有效性 - 如果定期會議今天發生變化,那么過去發生 時它不會改變......所以您可能希望擁有有關實際發生重復時間的規范只讀數據.顯然,您不希望它永遠保留過去,因此您可能希望垃圾收集"超過幾年的事件,具體取決于您的存儲限制.

                You need to be careful about maintaining validity though - if a recurring meeting changes today, that doesn't change when it has happened in the past... so you probably want to also have canonical read-only data about when recurrences actually occurred. Obviously you won't want that to keep the past forever, so you probably want to "garbage collect" events more than a few years old, depending on your storage limitations.

                您可能還需要能夠逐次添加注釋和例外情況(例如,由于公共假期,今天沒有舉行會議"或移至下午 4 點").當您更改重復時,這變得真的有趣 - 如果您將每個星期一"更改為每個星期二",您是否保留例外情況?當您從每天"變為每周"時,您甚至如何匹配異常?這些不是直接與存儲有關的問題 - 但存儲決策將影響實施您決定的任何策略的難易程度.

                You may also need the ability to add notes and exceptions (e.g. "meeting doesn't occur today due to a public holiday" or "moved to 4pm") on a per-occurrence basis. That becomes really fun when you change the recurrence - if you change "every Monday" to "every Tuesday" do you keep the exceptions or not? How do you even match up the exceptions when you change from "every day" to "every week"? These aren't questions which are directly about storage - but the storage decisions will affect how easy it is to implement whatever policy you decide on.

                這篇關于在構建日歷應用程序時,我應該在我的數據庫中存儲日期或重復規則嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                Parse malformed XML(解析格式錯誤的 XML)
                  <i id='muvbX'><tr id='muvbX'><dt id='muvbX'><q id='muvbX'><span id='muvbX'><b id='muvbX'><form id='muvbX'><ins id='muvbX'></ins><ul id='muvbX'></ul><sub id='muvbX'></sub></form><legend id='muvbX'></legend><bdo id='muvbX'><pre id='muvbX'><center id='muvbX'></center></pre></bdo></b><th id='muvbX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='muvbX'><tfoot id='muvbX'></tfoot><dl id='muvbX'><fieldset id='muvbX'></fieldset></dl></div>
                1. <tfoot id='muvbX'></tfoot>
                  • <bdo id='muvbX'></bdo><ul id='muvbX'></ul>
                        <tbody id='muvbX'></tbody>
                      <legend id='muvbX'><style id='muvbX'><dir id='muvbX'><q id='muvbX'></q></dir></style></legend>

                      1. <small id='muvbX'></small><noframes id='muvbX'>

                        • 主站蜘蛛池模板: 日韩精品一区二区三区四区 | 99久久99 | 伊人久久综合 | 国产精品美女久久久久aⅴ国产馆 | 精品麻豆剧传媒av国产九九九 | 午夜天堂精品久久久久 | 一区二区中文 | 91在线看 | 欧美日韩在线观看一区 | 亚洲激情在线观看 | 国产精品久久毛片av大全日韩 | 久久爱一区 | 日韩一区二区三区av | 欧美视频在线播放 | 人碰人操| 亚洲综合无码一区二区 | 国产精品精品视频一区二区三区 | 亚洲综合伊人 | 91欧美精品成人综合在线观看 | 日韩高清三区 | 欧美国产大片 | 欧美亚洲视频在线观看 | 国产一区二区在线视频 | 亚洲视频手机在线 | 97久久国产 | 国产精品一区二 | 91福利在线观看视频 | 国产精品久久久久久久久久久久久 | 欧美亚洲国产精品 | 91pron在线| 999久久久久久久久6666 | 欧美性tv | 日本人做爰大片免费观看一老师 | 91麻豆精品国产91久久久久久 | 精品一区免费 | 91人人澡人人爽 | 亚洲色图在线观看 | 亚洲精品av在线 | 日本一区二区在线视频 | 欧美成年黄网站色视频 | 亚洲欧美一区二区三区视频 |