Managing Multiple Web Sites
I've been currently managing a couple of web sites for different organizations, which I volunteer to do web work for. It can be hard to manage multiple sites for the same organization, especially with the redundancy you see. I've been looking at ways of reducing it, and here are a couple of things that I found.
- If you can, use a VirtualPathProvider; you can have multiple sites all in the same provider, which use the same bin, App_Code, and other folders. However, it's not that straight-forward to setup, and the lack of separation of certain folders may deter it. See more at: http://msdn2.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx
- Name the files the same that you would use; for instance, name the master page the same (I use site.master) so that if you can copy/paste pages over to the new site (copying whole functionality), you have less to change in the future.
- I've been duplicating tables/views/stored procedures to isolate changes; however, it is useful to create a custom provider to handle the functionality, if it is widely used. For a working example, check out the example at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnetprovmod_prt9.asp. It is some work, but if you reuse that functionality a lot, it really pays off.
- Reuse in custom controls works well; however, it can be time consuming.
- Only create custom features when you definitely have duplication; "i may in the future" is probably not worth doing until it actually occurs. There was a statistic out that users actually use 10% of the system 90% of the time, so some code isn't worth writing. Though, if you are doing it for learning, it doesn't hurt.
These were the ones that I found. I will add as I remember or find new ideas. Any comments on ideas are welcome.