Every now and then I face some feature that would be better if I put some recurring hability in it.
To make it clear let me use a known example. In Google Calendar, when I set an event as recurring let´s say every monday, it will show it every Monday. I can keep rolling the weeks forward and it will show the event.
I don´t really believe that they create the event in the database for every monday until the eternity :-), nor they create it until some far far away year.
I´d like to know if there´s some well known pattern for doing such a thing or any guide with best practices.
Thank You.
As far as I’m concerned, Martin Fowler has the definitive word on how to describe recurrences from a data modelling point of view. Once you’ve captured recurrences, you just need to provide code to retrieve events for a given date(time).