简体   繁体   English

MVC 4的多租户架构

[英]Multi-Tenant Architecture for MVC 4

I need to create/publish a complex MVC site to several clients, each with mostly shared functionality but also custom stuff, such as client specific controllers / views / business logic etc. Most insist on hosting the site themselves, and have functionality they don't want others to know about. 我需要为多个客户端创建/发布一个复杂的MVC网站,每个客户端都具有大部分共享的功能,而且还具有自定义内容,例如客户端特定的控制器/视图/业务逻辑等。大多数客户端坚持自己托管该网站,并且拥有自己没有的功能。不想让别人知道。

Following reading this SO post and this , I've created a means for MVC Multi-tenancy, which seems to handle most scenarios. 继读这个SO后这个 ,我已经创造了MVC多租户,这似乎处理大多数情况下的一种手段。

As I can't attach to Stack Overflow, I have posted it here (no need to read it all - it's mostly screenshots!). 由于我无法附加到Stack Overflow,因此我将其张贴在此处 (无需全部阅读-大部分为屏幕截图!)。

The basis is to have a generic project, referenced by several client projects. 基础是要有一个通用项目,并由几个客户项目引用。 The client project can then have a similar structure to the generic and take precedence when I wish to use overriding code/controls/views. 然后,客户端项目可以具有与通用项目相似的结构,并且在我希望使用覆盖代码/控件/视图时具有优先权。

As it's the foundation of the whole thing, I don't want to implement something only to find everyone else does it in an easier/ better way. 因为这是整个过程的基础,所以我不想实施某件事,只是发现其他所有人都以一种更轻松/更好的方式来做。

My question is a bit wooly, but simple - Is there a better way? 我的问题有点毛躁,但很简单-有更好的方法吗?

Your architecture seems about right. 您的体系结构似乎是正确的。 I would just say that you have to be really careful about the generic thing and how the client's addons will talk to the core application. 我只想说,您必须非常小心通用的内容以及客户端的插件如何与核心应用程序通信。

I would do that by having a base project in the CVS with client's specific branchs referencing it (as in git submodule) so everyone can beenfit from the core. 我可以通过在CVS中有一个基础项目来实现这一点,并在客户端的特定分支中引用它(例如git子模块中的内容),这样每个人都可以从核心中适应。

Rolling out production and QA versions are also something that must be dealt with caution as you can end up with different version far from each other depending on the client. 推出生产版本和质量检查版本也是必须谨慎的事情,因为最终可能会获得不同版本,彼此之间的差异取决于客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM