开发者

ASP.NET: Creating versions of the same website

My new assignment at work is to create a second version of our existing web application. Currently, our application supports only full time brokers, but now we our launching a second site specifically for part time brokers.

The new site will be almost identical to our existing site with the following exceptions:

  • It will have it's own branding.
  • A couple of the user controls used for displaying information will be different (but none of the pages will be different).
  • Our existing users should not have access to the new site and vice versa.
  • It needs to be easy to test both versions 开发者_如何学运维of the website from within Visual Studio easily.
  • We want to reuse as much our existing code as possible.
  • I have 2 weeks to do this.

I'm hoping that this is a common scenario and someone out there has some advice for how to accomplish this.


I really, really don't recommend branching projects or other routes which involve copying what is essentially identical code with the exception of branding and authorization. It will certainly be easier in the short run but, as you said, will become a nightmare very quickly trying to maintain almost-identical code bases.

Your pages can make the decision on what controls to show based who is logged in or even set globally to indicate this is the part-time broker version of the application. You could have a set of views and light logic to handle part time vs. full time brokers. Since the sites are deployed separately, a config setting would be straightforward. If you have other versions of the same site, you may have to give this some thought to ensure it would scale with your other variations.

I would even use the same database as long as you can separate the data appropriate using claims-based (preferred) or role-based authorization or similar.

All this said, there does not seem to be any great reason why you'd want to deviate from using the same code base.


I would create a branch of your code and then work against that. This is of course assuming that you are using version control. You are aren't you?


My first thought would be to

  1. copy the entire source code to another IIS website
  2. script the database over to another database (fresh start for new website)
  3. make necessary adjustments to usercontrols and branding
  4. roll out the new site (as Beta)

In Visual Studio, you can create a new project inside the same solution so that you have access to both projects at the same time.

If you're using Version Control... create a branch, and start customizing from there.

what this will do for you is give definitive separation between the two sites... no users have access across sites, all future customizations will be on a per-site basis, etc.


While I really like the idea CaptainTom posted another solution would be to break off the display layer of your application from the rest of the logic and create a new project that implements the new user experience while sharing the rest of the code

i.e. a FillTimeBrokers project and a PartTimeBrokers project with both implementing their logic from a common Brokers project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜