ASP.NET MVC 3结构 - 去查看另一个项目 [英] ASP.NET MVC 3 Structure - Go to view in another project

查看:113
本文介绍了ASP.NET MVC 3结构 - 去查看另一个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下项目设置

A计划(主)


  1. 商业

  2. 数据

  3. 查看(asp.net MVC 3项目)

项目ñ


  1. 商业

  2. 数据

  3. 查看(asp.net MVC 3项目)

我如何从项目来电项目N和从N回A.查看基本上我想要做的是包中的每个项目N至有自己独立的MVC因为它来自不同的来源和插在主项目,然后只是把它定位到正确的观点。

How can I call from Project A the View in Project N and from N back to A. Essentially what I'm trying to do is package each Project N to have its own individual MVC as it comes from different sources and plug it in to the main project and then just have it navigate to the correct view.

可以这样做?还是有更好的方式来做到这一点?

Can this be done? Or is there a better way to do this?

推荐答案

我sugest另一种方法如果可能的话。如果我理解正确的话,这些项目在某种程度上IKE的插件,但让他们耦合,他们现在还没有独立的applications.Also他们每个人。它,让我们说靠谱,但我只用1 asp.net mvc的项目(Web UI中)。所有这一切都属于其他项目,我想让他们佣工(pretty很多小部件)的UI位。这意味着,每个项目只包含将被用于构建一个视图助手。

I do sugest another approach if possible. if I understood correctly, those projects are somehow ike plugins but they are not standalone applications.Also they now about each others so they are coupled. It's, let's say tricky, but I would use only 1 asp.net mvc project (the web ui). All the UI bits which belong to other projects I'd make them helpers (pretty much widgets). This means, that each project contains only the helpers which will be used to construct a view.

我觉得这是一个有点一个结构问题,如果你只是想保持每个项目的意见,只是在不同的装配收留他们着想。去小部件方式,它似乎mkore的工作,但我认为你获得最大程度的控制,你想分离的水平。唯一的一点是你没有全景定义的,但你为什么会想在不同的地方全视图(谐音,布局),如果他们将在一个地方只用?!

I think it's a bit of an architectural problem if you only want to keep the views in each project just for the sake of hosting them in a different assembly. Going the widgets' way it might seem mkore work, but I think you gain the most control and the separation level you want. The only thing is you don't have full Views defined, but why you would want to have full Views (partials, layouts) in separate places if they will be used in one place only?!

现在,如果每个项目确实是一个插件,独立于其他插件,然后编译意见会是最好的方式。但是,如果项目B知道项目n中的观点,那么我认为上述方案比较适合。这或整个应用程序太过度设计。分离效果好,当它不创建一个全新的丛林中进行导航。

Now, if each project is indeed a plugin, independent of other plugins, then going with compiled views is the best way. But if Project B knows about the view of Project N, then I think the above solution is more suitable. That or the whole app is too over engineered. Separation is good when it doesn't create a whole new jungle to navigate it.

这篇关于ASP.NET MVC 3结构 - 去查看另一个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆