English 中文(简体)
设计一个伙伴关系。 NET MVC 3站点,支持客户特定观点的定制,而不点燃
原标题:Designing an ASP.NET MVC 3 site to support customer-specific view customization without forking

I m在大型伙伴关系工作。 NET MVC站点,一家商业服务公司向客户出售。 我们主要向小型和大型机构出售,这样它不会缩小规模。 这些大客户将要求我们作出定制,其中多数比包括定制布局以适应其网站。

我们目前的思路是,即便是跨国激进党以非常简单的控制者来得出自然结论,他们只称之为其他法典(如建议的那样),但这种看法将是一个棘手的问题,因为它们不会很好地掌握这种肥胖症,无论如何,在我们使用时,我们不会与拉汉尔人一样。 它很难将其分类,并说“对于这一客户来说,做的是额外的”;特别是,它很难为同一建筑服务略微不同的超文本。

We can t figure out making either of multi-tenancy and single-tenancy work cleanly, and we don t wish to fork the codebase, even if the customizations for one or more customers are thorough. (To the extent possible, we want to keep the database structure isomorphic across all our customers, which I guess is the way we would do it for multi-tenancy, but every tenant will have to be their own IIS web site because of scale and isolation.) Even if we came up with a way of overlaying a layer of custom views, that would allow for the opportunity of slight logic mismatches within the views.

What s the current state of the art of doing this? What are the war stories? (This could be subjective, but it s mostly objective in that if there s a pattern or an approach that completely cuts this down to its essence, of course that s the right answer. And I think it s an interesting question.)

I am happy to provide more detail.

最佳回答

We ve recently developed a site to support our 5 Regents institutions. Since we have a fixed set of customers, which is very unlikely to grow, we ve made some choices that you might not make. For example, we have a separate database instance per customer. Clearly that doesn t scale very well, but it does simplify the model significantly so for us it works.

我所用的战略是:

  1. 侧重于特征和配置,而不是客户。 我们每个机构都有一套核心特征。 只有少数这些特点可以定制。 对于每个机构来说,我们维持一个网络。 出版场所被用来控制在出版该机构的书目时使用的变革。 观点/控制者使用配置数据,以实施为该机构规定的特征变量。 它不知道哪一个机构,只是说“在提供植被时,不要使用B”。

  2. 专题分为共同和具体网站的内容。 大部分的中央支助事务/薪金是所有机构共同分担的,然而,我们把针对特定地点的特别支助事务排在首位。 这主要是彩色、背景和特定机构的形象(班子等等)。 我们在<代码>连续/主题内将具体网站的主题放在单独的夹中。 组合项目用于确定主题夹,主意在为安保部建造卢尔时将这一组合项目和任何具体网站图像(其中多数,如果不是全部,都在安保部的档案中处理)。

  3. Maintain a strongly-typed configuration class that wraps the standard configuration. Inject this class into controllers, mailers, etc. wherever the configuration is needed. Because we rely on configuration through-out the application we felt that promoting this to a first-class entity within our model was important for readability and maintainability. For non-binary options we typically create enums that map to the setting to avoid string comparisons. For a more complex application or more institutions I would probably even develop a separate configuration section handler and separate the configuration into it s own section or config file. For now, ours uses appsettings as the number of settings is small and they are relatively simple.

希望这一帮助。

问题回答

It sounds like you want to look at multi-tenancy views, there was a good article on the subject by Rob Ashton a while ago.





相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签