Asp.Net MVC 与 Castle MonoRail

发布于 2024-07-08 13:29:54 字数 235 浏览 10 评论 0原文

我有一些使用 Asp.Net 构建应用程序的经验,但现在 MVC 框架变得更流行。 我想尝试使用 Asp.Net MVC 或 Castle MonoRail 构建新的多语言 Web 应用程序,但我不知道哪一个对我有好处。 我不喜欢 Web 表单视图引擎,但我喜欢 Asp.Net MVC 中的路由功能。

  • 谁能说说它们之间的优缺点吗?
  • 哪个 ViewEngine 更适合覆盖主模板?

I've some experiences on build application with Asp.Net, but now MVC frameworks become more popular. I would like to try building new multilingual web application using with Asp.Net MVC or Castle MonoRail but I don't know which one is good for me. I don't like the web form view engine, but I like routing feature in Asp.Net MVC.

  • Could anyone tells about pros and cons between those?
  • Which ViewEngine is the better as well for overriding the master template?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

是伱的 2024-07-15 13:29:54

作为单轨铁路的拥护者,我不得不说您可能应该选择 ASP.NET MVC。 老实说,ASP.NET MVC 将在三年内成为默认架构这一简单事实可能会改变它。 这个等式在一年前有所不同,仅仅是因为与 MonoRail 相比,默认架构存在严重的生产力问题。

如果你想谈论技术优点和缺点:

  • ASP.NET AJAX 是一团糟(避免它),但他们现在有了 jQuery。 事实上,jQuery 支持比任何其他环境都要好。 当然,只有通过 IDE 与标准视图引擎的集成才能完全实现这一点。
  • 有一些美观的改进(例如,模型信息的传递方式比单轨铁路更干净、更明显)。

另外,不要立即放弃标准视图引擎。 您不必像使用 ASP.NET 那样向其添加控件,您可以使用与 Brail 非常相似的方式对其进行编码,仅使用 C# 而不是 Boo。

有些东西实在是丑陋
* 以对象作为参数的方法的数量。 祝你好运,找到他们所期望的文档。
* 微软更喜欢抽象类而不是接口。 他们有他们的理由,但我还是不喜欢。

此外,从很多方面来说,MonoRail 仍然是更完整的平台。 例如,ASP.NET 中没有验证或分页的抽象。 此外,对于绑定到模型实际上没有任何帮助。 与单轨列车相比,这些助手的功能非常少。

但总的来说,我认为 ASP.NET MVC 是赢家。

Speaking as an advocate of monorail, I've got to say you should probably go for ASP.NET MVC. To be honest, the simple fact that ASP.NET MVC is going to become the default architecture within three years should probably swing it. This equation was different a year ago, simply because the default architecture had serious productivity problems compared to MonoRail.

If you want to talk technical advantages and disadvantages:

  • ASP.NET AJAX is a mess (avoid it), but they've now got jQuery. In fact, the jQuery support is better than any other environment. Of course, you only fully get that with IDE integration with the standard view engine.
  • There are some aesthetic improvements (for instance, the way model information is passed around is much cleaner and more obvious than Monorail).

Also, don't dismiss the standard view engine out of hand. You don't have to throw controls at it like you did with ASP.NET, you can code it in a pretty similar manner to Brail, only using C# instead of Boo.

There are things that are just plain ugly
* the number of methods that take object for a parameter. Good luck finding the documentation on what exactly they expect.
* Microsoft's fondness for abstract classes over interfaces. They have their reasons, but I still dislike it.

Also, in many ways, MonoRail remains the more complete platform. There's no abstraction for validation or paging in ASP.NET, for instance. Also, there's not really any help for binding to a model. The helpers have very little functionality compared to their Monorail equivalents.

Overall, though, I think ASP.NET MVC is a winner.

坦然微笑 2024-07-15 13:29:54

MonoRail 和 ASP.NET MVC 从根本上来说非常相似,您应该可以很好地使用其中任何一种。 MonoRail 存在的时间要长得多,因此具有更多更高级别的功能。

ASP.NET MVC 的主要优势是它的路由引擎,公平地说,MonoRail 几乎有一个等效的路由引擎,并且经过一些修改,您可以将 ASP.NET MVC 路由引擎与 MonoRail 一起使用,因为路由引擎并不是真正在 ASP 中.NET MVC,但在 System.Web.Routing 中(在 .NET 3.5 SP1 中发布)。 ASP.NET MVC 以及与 Visual Studio 的集成也是一个优点,并且随着我们接近 v1 的 RTM,它可能会变得更好。

MvcContrib 项目包含一些很棒的视图引擎,例如 Spark、NHaml 和 Brail。 没有人可以被认为是“最好的”,个人最喜欢的是 Spark。 有关 Spark 的更多信息:http://dev.dejardin.org/documentation/syntax

WebForms 引擎具有智能感知功能,据我所知,这是所有替代视图引擎所缺乏的一个巨大优势。

MonoRail and ASP.NET MVC are fundamentally very similar, you should be well off using either one of them. MonoRail has existed much longer and has therefore more higher level features.

The main strength of ASP.NET MVC is it's routeing engine, to be fair MonoRail has pretty much an equivalent routing engine, and with some modification you can use the ASP.NET MVC routing engine with MonoRail as the routing engine is not really in ASP.NET MVC but in System.Web.Routing (Released in .NET 3.5 SP1). ASP.NET MVC and integration with Visual studio is also a plus, and will probably get better as we approach RTM of v1.

The MvcContrib project contains some great view engines, like Spark, NHaml and Brail. No one could be considered "Best", A personal favourite is Spark. For more on spark: http://dev.dejardin.org/documentation/syntax

The WebForms engine has intellisense which is a great advantage that to my knowledge all alternative view engines lack.

萤火眠眠 2024-07-15 13:29:54

除了 Microsoft 的受欢迎程度和支持之外,ASP.NET MVC 仍然缺乏 Monorail 长期以来所拥有的一些核心功能,例如控制器组织(区域)、本机 ViewComponents 和可以使用 IoC 来命名最重要的过滤器。

我有一些使用所有这些功能的大型应用程序,但我很难将它们移植到 ASP.NET MVC。

我已经使用单轨铁路几年了,虽然 MVC 看起来很有前途,而且它的灵活性很棒,但我仍然觉得很尴尬,对于我尝试做的所有其他事情,事实证明它不存在,我必须插入一点MvcContrib 的一部分,SharpArchitecture 的另一部分,我自己构建它,你就明白了。 单轨铁路更容易使用(就是现在)。

我预计未来几个月情况会变得更好,因为一些提议的解决方案将开始与其他解决方案相抗衡并变得更加主流。 嘿,选择的多样性固然很好,但请相信我,您不会想回到 3 年前的 Java 世界,那里有如此多的 Web 框架,您可以为每个不同的页面使用一个框架来构建您的网站!

与此同时,我会慢慢地将我的 MR 应用程序移植到 MVC,以防万一。

Apart from perceived popularity and support from Microsoft, ASP.NET MVC still lacks some core features that Monorail has had for a long time like controller organization (Areas), native ViewComponents and Filters that can use IoC to name the most important ones.

I have some big applications that use all of these features and I've had a hard time porting them to ASP.NET MVC.

I have worked with Monorail for some years now and while MVC looks promising and it's flexibility is awesome, I still find it akward that for every other thing I try to do, turns out it isn't there and I have to either plug a little piece of MvcContrib, another piece of SharpArchitecture, build it myself, you get the picture. Monorail is so much easier to work with (right now, that is).

I expect things will get better in the next few of months as some proposed solutions will begin to rise against others and become more mainstream. Hey, diversity of options is good but trust me, you don't want to be in Java-land 3 years ago where there were so many web frameworks that you could build your site using one for every different page!

In the meantime I will keep slowly porting my MR apps to MVC, just in case.

明媚如初 2024-07-15 13:29:54
  1. 我认为 MVC 轻而易举地获胜。 它的功能集非常相似,但将是两者中更“流行”的一个(因此通常在整个开发社区中得到更广泛的支持、记录和扩展)。 此外,在我看来,新的 ViewEngine (Razor) 和 IDE 改进对我来说也很重要,并且提高了选择 MVC 而不是 monorail 的价值。

  2. 我已经使用了几乎所有常见的 ViewEngine,但最终还是推出了自己的 ViewEngine(利用出色的 StringTemplate 模板引擎为其创建了一个开源项目。 在我看来,ST 是真正的关注点分离。 结果,我发现自己编写了更好的应用程序,并且标签汤少得多。 如果你选择踢引擎上的轮胎。 到目前为止,我使用它部署的项目非常幸运。 话虽这么说,Razor (MVC 3) 看起来相当令人印象深刻。

  1. I think MVC wins hands down. Its feature set is very similar, but is going to be the more "popular" of the two (and thus typically more widely supported, documented and extended throughout the development community). In addition, the new ViewEngine (Razor).. and IDE improvements factor in for me, and boost the value of choosing MVC over monorail, in my opinion.

  2. I've used pretty much all the common ViewEngines, but wound up rolling my own (created an OpenSource Project for it) utilizing the awesome StringTemplate template engine. ST is a true separation of concerns, IMO. I find myself writing better apps as a result, with MUCH less tag soup. I also threw out a quick intro and reference guide if you choose to kick the tires on the engine. I've had awesome luck on projects I've deployed thus far using it. That being said, Razor (MVC 3) looks pretty impressive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文