Tuesday, July 10, 2007

Make the safe update in asp.net project.

When a project gets complicated, it become increasingly challenging to make any updates to it, especially for the project which you didn't start to work with. I was put into such a situation recently. The clients require that I make a lot of changes to an existing web applications, and they want all the new features I develop will be turned on a specific day. They also want to have the option to turn all the new features off and keep the original state.

If it's all business logic changing wrapped in a dll, it should be much easier. The challenges are that the project also involves a lot of user interface changes. If I try to make the individual element or control on a page visible/invisible based on certain conditions, it will become very messy and difficult to maintain in the future. For example, if the clients want to completely get rid of all the old features, leaving all those checking codes there will be very confusing for the people who will work on the projects in the future.

I end up putting all the old features on a page into a user control, and all my new improvements combined with the original codes in another user control like the followingFeatureTurning

 

In the code behind, I can swap between the old codes and new codes by setting one user control visible and the other invisible. And in the future, when the clients don't want the old features anymore, the old codes can be completely taken out.

No comments: