How to turn on/off code modules?

Posted by Safran Ali on Programmers See other posts from Programmers or by Safran Ali
Published on 2012-10-18T09:17:46Z Indexed on 2012/10/18 11:14 UTC
Read the original article Hit count: 425

I am trying to run multiple sites using single code base and code base consist of the following module (i.e. classes)

  • User module
  • Q & A module
  • Faq module

and each class works on MVC pattern i.e. it consist of

  • Entity class
  • Helper class (i.e. static class)
  • View (i.e. pages and controls)

and let's say I have 2 sites site1.com and site2.com. And I am trying to achieve following functionality

  • site1.com can have User, Q & A and Faq module up and running
  • site2.com can have User and Q & A module live while Faq module is switched off but it can be turned-on if needed, so my query here is what is the best way to achieve such functionality

Do I introduce a flag bit that I check on every page and control belonging to that module? It's more like CMS where you can turn on/off different features. I am trying to get my head around it, please provide me with an example or point out if I am taking the wrong approach.

© Programmers or respective owner

Related posts about c#

Related posts about code-reuse