【发布时间】:2011-02-12 14:55:41
【问题描述】:
我的任务是将我们拥有的 Web 应用程序平台从 ASP.NET 移植/重构到 MVC.NET。理想情况下,我可以使用所有现有平台的配置来确定所呈现网站的属性。
在System.Web.Caching.Cache 中保留一个包含我们所有各种页面配置数据的 SiteConfiguration 对象是否是 RESTful?当用户访问我们的网站时需要加载很多设置,因此每个用户每次访问时都必须加载相同的设置是低效的。
SiteConfiguration 对象包含的一些数据如下,它决定了哪些母版页/站点配置/样式/用户控件可供客户端使用,
public string SiteTheme { get; set; }
public string Region { private get; set; }
public string DateFormat { get; set; }
public string NumberFormat { get; set; }
public int WrapperType { private get; set; }
public string LabelFileName { get; set; }
public LabelFile LabelFile { get; set; }
// the following two are the heavy ones
// PageConfiguration contains lots of configuration data for each panel on the page
public IList<PageConfiguration> Pages { get; set; }
// This contains all the configurations for the factsheets we produce
public List<ConfiguredFactsheet> ConfiguredFactsheets { get; set; }
我想有一个这样的 URL 结构:
www.MySite1.com/PageTemplate/UserControl/
域决定了创建的 SiteConfiguration 对象,其中 MySite1.com 是 SiteId = 1,MySite2.com 是 SiteId = 2。(反过来,各种页面的样式、配置等)
PageTemplate 是将要呈现的视图,它只是定义了我将要注入 UserControls 的布局
如果我完全错过了这里的 RESTful 点,有人可以告诉我吗?我想将平台重构为 MVC,因为它更好地工作,但我想把它做对,但最少要重新发明轮子,否则它不会得到批准。有其他建议吗?
编辑:区域?" 使用 ASP.NET MVC 2 区域是否可行,其中每个区域代表一个不同的站点,包含 css、javascript 等?
【问题讨论】:
-
在 github 中是否有关于它的完整示例(ASP.NET WeForms 和 ASP.NET MVC)?
标签: asp.net asp.net-mvc architecture rest