Using the IView interface in an MVC app

Hey guys. .I just ran across something interesting. Something I wish I had noticed much earlier. The IView interface. Aparently, the View() controller method offers an overload which takes this as a parameter. This means that I can actually implement my original concept of class only views. Or rather, instead of injecting data into a predefined template, I can construct variable templates around the data, and then write it out. All I did was create a base view class that exposed some common methods and properties, then ran with it.

Basically what happens, is that the base view loads the default (master) info for locale, phrases, skin and templates, and then overwrites those values with any locale or skin specific data (if any), from the db.

This allows administrators to add, edit, or remove any locale, phrase, skin or template from the system while online.

Using resx files wasn’t really a good solution for me as they are compiled, and I didn’t want the end user to have to do that everything they added a phrase to the system.

In addition, creating skins and fallbacks (defaults) using the filesystem was a bit unwieldy in my opinion, and it cluttered the directories.

This way, everything is in the db.