帮助.net web代码共享设计
我们有许多相互关联的系统,它们共享一个公共服务层。此外,它们还是一些常见的UI组件。为了减少剪切和粘贴,我们希望打包代码以便在所有当前和未来的项目中使用。目前,我们需要集成的项目是 ASP.net webforms 和 MVC 3 解决方案。我希望人们能够提出“最佳”的继续方式。
一种实现是创建一个单独的 Web 项目 (mvc) 并让它与其他应用程序共享一个公共会话。该模型的好处是,升级到通用组件不需要重新安装所有调用通用元素的应用程序。不幸的是,公共组件(用户和组织管理)的代码分离并不那么简单。
另一种方法是将代码包装在 nuget 包中。对于 WebForms 项目,我可以使用 AddMvc3ToWebForms 进行包装。对于直接的 MVC 项目,它可以作为文件夹安装。
还有其他选择吗?我很想获得一个更具可插入性的解决方案(例如,MEFContrib),但我对 MVC 不太熟悉,无法确定如何做到这一点。
任何想法将不胜感激..
We have a number of interrelated systems that share a common service layer. In addition, they are a number of common UI components. To reduce cut and paste, we'd like to package up the code for use in all current and future projects. Currently, the projects that we'll need to integrate with are ASP.net webforms and MVC 3 solutions. I'd like folks input on the "best" way to proceed.
One implementation would be to create a separate web project (mvc) and have it share a common session with the other applications. The benefit to this model would be that upgrades to the common component would not require all the applications call the common elements to be re-installed. Unluckily, code separation for the common components (user and org management) isn't so simple.
Another method would be to wrap the code in a nuget package. For the WebForms projects, I could be wrapped with the AddMvc3ToWebForms. For the straight MVC projects it could just be installed as a folder.
any other alternatives? I'd love to get a more plugable solution (e.g., MEFContrib) but I'm not familar enough with MVC to determine how to do it.
Any ideas would be appreciated..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您使用“网络服务”或“wcf”。通过(甚至不需要)用户名和密码身份验证来创建与其他应用程序关联的 Web 服务非常容易。看一下这个链接
I suggest you to use "web service" or "wcf". It's very easy to create a web service to associate with other applications via (or even without) a user name and password authentication. Take a look on this link