您是否计划从 ASP.Net Web 表单迁移到 ASP.Net MVC?

发布于 2024-07-11 21:21:05 字数 41 浏览 4 评论 0原文

如果是,什么时候? 您认为迁移当前项目需要多长时间(如果是这样)?

If yes, when? and how much time do you think that the process will take to migrate your current projects (if it's the case)?

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

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

发布评论

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

评论(13

迷离° 2024-07-18 21:21:05

ASP.NET MVC 并不是要取代 WebForms。 它们是不同的技术,并且是为不同的目的而设计的。

笼统地声明我只会使用一种而不使用另一种,这是一种非常狭隘的做法,因为你错过了每种技术的优点和缺点。

Microsoft 致力于这两种技术的发展,并且 WebForms 4.0 中出现了很多不错的新功能。

我将使用 WebForms 和 ASP.NET MVC,但会考虑当前项目的需求,以便为当前实现做出正确的决定

ASP.NET MVC is not meant to replace WebForms. They are different technologies and are designed for different purposes.

Making a blanket statement of saying that I'll only use one and not the other is a very narrow minded approach, as you're missing the pros and cons of each technology.

Microsoft is commited to both technologies going forward and there are quite a few sweet new features coming in WebForms 4.0.

I'll be using WebForms and ASP.NET MVC, but looking at the needs of the current project so that I make the right decision for the current implementation

墟烟 2024-07-18 21:21:05

我已经使用它几个月了。 我非常喜欢 MVC。 转换现有项目可能不现实,具体取决于可用时间。 在我看来,Web Forms 模拟了老 VB 人群的 Windows 窗体开发。 虽然 MVC 不会假装它不是,而是更紧密地遵循 Http 流程。

我在 MVC 中看到的一些优点

1) 它可以通过单元测试进行测试

2) 对 Html 的直接控制。 我们制作网站,我们如何接受无法控制我们所有的html?

3) 没有视图状态包袱

4) 没有控制树来浪费时间渲染

5) 从表单帖子自动绑定模态

6) 它可能相当性感

还有一些缺点

1) 不再有 Web 控件(许多丰富的第 3 方控件是丢失)

2) 开发速度较慢

3) 学习曲线较大

4) 仍处于 Beta 阶段(不过 CTP 很快)

I've been using it for a few months now. I absolutely love MVC. Converting existing projects may not be realistic, depending on available time. As I see it, Web Forms simulates windows forms development for the old VB crowd. While MVC doesn’t pretend it’s something it’s not and follows the Http process more closely.

A few plusses I see in MVC

1) It’s testable with unit tests

2) Direct control over Html. We make websites, how do we accept not being able to control all our html?

3) No viewstate baggage

4) No control tree to waste time rendering

5) Automatic binding of a modal from a form post

6) It can be rather sexy

And a few disadvantages

1) No more web controls (and many rich 3rd party controls are lost)

2) Slower to develop in

3) Large learning curve

4) Still in Beta (CTP soon though)

诗酒趁年少 2024-07-18 21:21:05

是的,对于我的新项目。 但不适用于当前的生产软件。

Yes for my new projects. But not for current production software.

蓝戈者 2024-07-18 21:21:05

是的,以尽可能有序的方式。

MVC 为 .NET 开启了敏捷开发最佳实践的大门。 它专门解决了有关关注点分离和耦合/内聚的问题。 它还允许我们编写更便携的软件,而无需创建对任何特定于供应商的引用或组件的依赖。

毫无疑问,无论您读到什么 PR,它都是 WebForms 和 WPF 的继承者。

Wikipedia 条目 非常清晰,甚至在针对 Microsoft MVC 进行更新之前也是如此。

Yes, in as orderly a fashion as possible.

MVC opens .NET up to the world of Best Practices for Agile development. It specifically addresses concerns about Separation of Concerns, and coupling/cohesion. It also lets us write more-portable software without creating a dependency on any vendor-specific references or components.

It unquestionably is a successor to WebForms, along with WPF, regardless of whatever PR you might read.

The Wikipedia entry is pretty clear, even before being updated for Microsoft's MVC.

梦境 2024-07-18 21:21:05

假设您更喜欢 ASP.NET MVC 而不是 Web 窗体,那么对于处于积极开发/维护状态的系统来说这是值得的。

它们可以并排共存,因此可以迁移应用程序的部分内容(新的或选定的旧应用程序)并查看其运行情况。 如果成功了,就继续吧。

然而,“全有或全无”的迁移可能是灾难性的——在没有快速反馈的情况下进行大量投资是一个巨大的风险。

Assuming you prefer ASP.NET MVC to Web Forms, it's worth it for a system that's in active development/maintenance.

They can coexist side-by-side, so it's possible to migrate parts of the application (new ones, or selected old ones) and see how it works out. If it's a success, keep going.

An "all or nothing" migration could be disastrous, though - investing a lot without quick feedback is a huge risk.

妖妓 2024-07-18 21:21:05

WebForms 用于丰富的 UI

这些可以用 MVC 或 Webforms 来完成。 一年后,丰富的基于 MVC 的工具包将会出现(从技术上讲,如果您喜欢 YUI、ExtJS 等,它们已经存在),并使这个争论无效。

迁移当前项目

将现有的 WebForms 项目迁移到 MVC 没有多大意义。 你会得到什么? 然而,根据您的需求,将 MVC 用于新项目可能会很有意义。

WebForms are for rich UIs

These can be done just the same with MVC or Webforms. A year from now rich MVC based toolkits will arrive (technically they're already here if you like YUI, ExtJS, etc.) and make this argument null and void.

migrate your current projects

Migrating an existing WebForms project to MVC doesn't make a lot of sense. What are you going to gain? Using MVC for a new project however can make a lot of sense depending on your requirements.

淡看悲欢离合 2024-07-18 21:21:05

我一开始就不太喜欢 WebForms,所以使用 MVC 对我来说就像呼吸新鲜空气。 我一直更喜欢关注点分离,因为我可以处理我真正擅长开发的块、逻辑和数据访问,并将演示工作留给具有这种天生能力的团队成员。 我认为 MVC 库使团队可以更轻松地在各个页面上一起工作,因为一个人可以在控制器上工作,另一个人可以在视图上工作。

话虽这么说,当我从事的项目不需要太多关注编码并且更注重显示时,我仍然会回到 WebForms,因为它们更容易实现和启动和跑步。 两者都有自己的地位,我认为其中一个永远不会取代另一个。

I was never really fond of WebForms to begin with so getting to work with MVC was like a breath of fresh air to me. I've always much preferred the separation of concerns as I could work on the chunks that I was really good at developing, the logic and the data access, and leave the presentation work to the members of the team who had that natural ability. I think the MVC library makes it easier for teams to work together on individual pages as one person can work on the controller and the other person can work on the view.

All that being said, when I'm working on projects where I don't need to focus as much on the coding and it is more display oriented, I still go back to the WebForms because they are so much easier to implement and get up and running. Both have their places and I don't think one will ever supersede the other.

红玫瑰 2024-07-18 21:21:05

我已经使用 ASP.NET MVC 几个月了,与 Web 表单相比,我更喜欢它。 但是,我不认为自己会将现有项目迁移到 MVC。 对我来说,这毫无意义。 然而,我所有的新 ASP.NET 项目都将(或应该)使用 MVC 开发,因为它是一个更好(且更灵活)的框架。

I've been using ASP.NET MVC for several months now and I prefer it to Web Forms. However, I don't see myself migrating my existing projects to MVC. For me, it would be rather pointless. However, all of my new ASP.NET projects will (or should be) developed using MVC, as it is a much better (and more flexible) framework.

谜兔 2024-07-18 21:21:05

我个人将 ASP.NET MVC 限制为轻量级前台网站。

但仍将 ASP.NET WebForms 用于右 BackOffice 应用程序,以利用丰富的自定义控件和 Web 窗体的一些其他出色功能。

Personnaly I restricted ASP.NET MVC for lightweight Front Office Web Sites.

But still using ASP.NET WebForms for Righ BackOffice Applications to take advantage of rich custom controls and some of other nice features of Web Forms.

仅此而已 2024-07-18 21:21:05

mvc 的另一个优点是像 jquery 这样的 javascript 更容易实现,所以如果你打算使用大量 js,mvc 可能是最好的选择。

Another plus for mvc is that javascript like jquery is much easier to implement, so if you plan on using a lot of js, mvc might be the way to go.

桃扇骨 2024-07-18 21:21:05

不,没有理由这样做。 这是另一种风格,我不喜欢。 但那只是我的个人意见; 很多人喜欢它,我希望它对他们有用。

No, there's no reason to. It's an alternative style, one I am not fond of. But that's just my opinion; a lot of people like it and I hope it works well for them.

尐偏执 2024-07-18 21:21:05

正如已经说过的,它们并不相互排斥,我在玩游戏时会充分利用两者。

IMO MVC 更适合网站站点,而 WebForms 更适合网络应用程序

例如,该网站完美地展示了 ASP.NET MVC 是一个不错的选择,因为该网站的性质和需要完成的任务; 其他很好的例子是网上商店、项目管理网站(如 Basecamp)或社交网络。

然而,如果您正在开发企业 CRM/ERP 系统,我会坚持使用 WebForms 来获得丰富的控件和更“类似于桌面”的编程模型,因为 CRM 应用程序传统上是桌面应用程序的领域。

As already said, they're not mutually exclusive, and I play to make good use of both.

IMO MVC is better for web sites, while WebForms are better for web applications.

For example, this site is a perfect showcase for where ASP.NET MVC is a good choice because of the nature of the site and what needs to be accomplished; other good examples would be a web store, or a project management site (like Basecamp), or a social network.

If you were developing a corporate CRM/ERP system, however, I'd stick with WebForms to get rich controls and a more "desktop-like" programming model, since a CRM application is traditionally the domain of a desktop application.

筑梦 2024-07-18 21:21:05

ASP.NET MVC 更适合我想要的开发风格,但在它不是 RTM 的情况下,我对相信自己持谨慎态度。 它也有足够的不同,我们的遗留代码将无法与它一起工作。 如果我们一直在实践领域驱动开发,事情可能会更容易,但是......

ASP.NET MVC fits my desired style of development better, but I'm wary of trusting myself to it whilst it's not been RTM. It also is different enough that our legacy code will not work with it. If we had been practising Domain-Driven Development things might have been easier, but ...

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