Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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(); }

Ideas?

share|improve this question
    
What is your actual question? –  back2dos Feb 8 '11 at 10:14
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
1  
Ah, the unique "point of entry + dispatch" concept cleared up my ideas. Thanks! –  Duopixel Feb 8 '11 at 18:56
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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