I'm creating a website for an event that is coming up. It has some functionality related to the event (such as "send me a reminder"), other stuff that takes place during the event, and finally some stuff that comes after the event.

I need to start working on code that takes place during the event and after the event, plus some fixes for the current site (which is already live). What is the best way to approach this problem?

Some solutions that occur to me are creating branches for each state and merging stuff as needed. Other one is hiding and showing functionality based on the date, i.e

if (currentDate < eventDay) { reminder.show(); }


  • What is your actual question?
    – back2dos
    Feb 8, 2011 at 10:14

3 Answers 3


If the three versions of your website are quite different, it would probably be easier to indeed have them ready as three different packages. The major disadvantage of that method is that you will have to promptly replace a version with the next at a specific moment, which could prove more or less difficult to do.

Another arguably better solution is to make the website aware of its transformation and able to do so automatically. If you choose so, I would most certainly not cripple the code with if statements, but rather have a unique point of entry that would dispatch to the appropriate version depending on the date and time. The different versions could still easily use a common codebase, but would be completely independent from each other.

Frameworks exist in most web-able languages that should provide everything you need to implement such a central dispatcher.

Example: For Java, frameworks such as Spring MVC make it quite easy to do.

  • 1
    Ah, the unique "point of entry + dispatch" concept cleared up my ideas. Thanks! Feb 8, 2011 at 18:56

Me personally I would use the second solution you stated...

if (currentDate < eventDay) { reminder.show();}.

That would certainly help keep your butt covered from any hiccups or data problems.


It may be worth looking at making the date sensitive stuff data driven, and not insert the data into the database until the chosen time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.