架构新的ASP.NET Web应用程序 [英] Architecture for new ASP.NET web application

查看:256
本文介绍了架构新的ASP.NET Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我维护一个应用程序,它目前只是一个web服务(与WCF建)和后端数据库。 Web服务是建立在层与LINQ到SQL数据访问与部分核心功能,在自己的组装和包含WCF code。该Web服务组件顶部。核心组件还负责处理所有的业务逻辑规则(很少实际上)。

I'm maintaining an application which currently is just a web service (built with WCF) and a database backend. The web service is built in layers with a linq-to-sql data access part with core functionality in an own assembly and on top of that the web service assembly which contains the WCF code. The core assembly also handles all business logic rules (very few actually).

现在客户想要的应用程序,而不是仅仅通过它消耗的Web服务的其他应用程序访问它的Web界面。我很失去了对现代Web应用程序的设计,所以我想对使用什么样的体系结构和框架的Web应用程序的一些建议。 Web应用程序将使用与业务规则相同的核心组件和LINQ到SQL数据访问层作为Web服务。

The customer now wants a Web interface for the application instead of just accessing it through other applications which are consuming the web service. I'm quite lost on modern web application design, so I would like some advice on what architecture and frameworks to use for the web application. The web application will be using the same core assembly with business rules and the linq-to-sql data access layer as the web service.

我想过一些概念是:


  • ASP.NET MVC(或MVC-2)

  • Web表单

  • AJAX控件 - 乐亭可能在AJAX控件通过JSON访问现有的Web服务

是否有更多的概念,我应该考虑?哪一个是最好的一个新的项目?

的开发工具包括Visual Studio 2008团队版为开发针对.NET 3.5。升级到Visual Studio 2010的premium(或者甚至旗舰版)是可能的,如果它给人带来任何好处。

The development tools are Visual Studio 2008 Team Edition for Developers targeting .NET 3.5. An upgrade to Visual Studio 2010 Premium (or maybe even Ultimate) is possible if it gives any benefits.

推荐答案

绝对挖成的 ASP.NET MVC2

我们所有的项目目前正在使用ASP.NET MVC2开发。这不只是高的可扩展的。它的高度的测试的的为好。这导致更好的方式维护应用在长期的。

All of our projects are now being developed using ASP.NET MVC2. It's not just highly scalable. It's highly testable as well. Which leads to way better maintainable apps in the long term.

的WebForms与MVC2点 - (讲出来的经验):

WebForms vs. MVC2 points - (speaking out of experience):

可扩展性:

在我们公司,我们有很多的使用,然后被我们需要我们的客户更新,改变的WebForms应用程序。

In our company we had a lot of applications using WebForms which then were updated and changed by us as needed by our customers.

我觉得你的客户将被要求在不久的将来应用更多的变化。使得其他服务的调用,也许你将不得不返工最终产品的零部件,以满足他们的愿望。

I think your customer will be requesting more changes on the application in near future. Making calls to other services, and maybe you'll have to rework parts of the final product to match their wishes.

和与即将推出的云计算和的的Windows Azure平台你可能需要跟上你的code。

And with the upcoming Cloud Computing and the Windows Azure platform you'll probably need to keep up with your code.

ASP.NET MVC绝对支持能够扩展您的应用程序你想要的任何时间的概念。

ASP.NET MVC absolutely supports the concept of being able to scale up your application any time you want.

我记得我们的一个客户走了我的电话问我延期对他们的应用程序(他们有一个会员管理系统)和功能将包含像一个链接的东西到当前视图导出为 CSV 文件,以便他们可以做的东西办公用它(主要是串行字母)。

I remember one of our customers walking up on me asking me for an extension for their app (they have a member management system) and the feature would contain something like a link to export the current view as a csv file so they could do office stuff with it (mostly serial letters).

这是不是一个真正的大问题设置,配备了。 (花了约2小时,包括编写测试) - 让我们去测试:

It wasn't really a big problem setting that feature up. (took around 2 hours including writing tests) - let's go to tests:

可测性:

使用的WebForms 我们实际上都没有太大的兴趣写作测试,因为它是一个纯粹的痛苦这样做。
我记得写一些测试,至少有一些证据,但让我们丢弃的话题。(:P)

Using WebForms we didn't really have much interest writing tests because it was a pure pain to do so. I remember writing some tests to have at least some proofs but let's drop that topic.. (:p)

我们有我们的自定义类的测试,但我们不能真正测试的WebForms内的所有事件处理器。

We had tests for our custom classes but we couldn't really test all the EventHandlers within the WebForms.

我们的codeBase的方式是更清洁和保护利用感谢这个测试的环境。我只是检查出一些code的,修改它,运行所有测试和:哦,这打破了奇怪的现象! - 让我们再解决这个问题。此前,我记得坐在我的同事调试并试图找到这些错误了几个小时。

Our CodeBase is way cleaner and saver to use thanks to this testable environment. I just check out some of the code, modify it, run all the tests and: Oh, it broke on strange behavior! - Let's fix that again. Earlier, I remember sitting with my co-worker debugging and trying to find those bugs for hours.

使用ASP.NET MVC2我们现在的缺少测试!
我们要求所有形形色色的人(甚至非Web的)提供的测试情况下,我们可以养活了我们的的TestSuite

With ASP.NET MVC2 we are now lacking tests! We ask all kinds of people (even the non-Web ones) to provide test-cases we could feed into our TestSuite.

和是的,有一些Ajax的控件太:

And yeah, there are some AJAX-Controls too:

AJAXability:

您问AJAX控件以及与ASP.NET MVC一起我强烈建议你检查出的 Telerik的ASP.NET MVC UI控件

You asked about AJAX Controls and in conjunction with ASP.NET MVC I highly recommend you to check out Telerik ASP.NET MVC UI Controls.

如果这不是东西给你,我们还大量运用 jQuery的并的 jQuery UI的

If that isn't something for you, we also make extensive use of jQuery and jQuery UI

使用ASP.NET MVC和HTML视图,这些库不只是使用乐趣,他们只是看起来令人惊讶的美丽。

With ASP.NET MVC and the HTML Views, those libraries aren't just a pleasure to use, they just look amazingly beautiful.

有没有随机HTML的标签ID值自动生成了!

但我最喜欢的是:你终于可以真正重新使用code再次

But what I like most is: You can finally really re-use your code again.

有这么多比只是这些框架,有T4模板系统。自动脚手架为您的的ViewModels / DomainModels 的使用 Html.EditorFor()方法,当然还有很大的并使用的IoC 简单的方法和的 DI 范例。

There is so much more to those frameworks than just that, there is the T4 templating system. Auto-Scaffolding for your ViewModels / DomainModels with the Html.EditorFor() method and of course there is a great and easy way to use the IoC and DI paradigms.

假设你问的问题大多与.NET框架相关的标记,你可能会坚持下去。

Assuming that you have asked the question with mostly .NET Framework related tags, you'll probably stick with it.

只是为了保持完整后,也有一些是一样好(或更好)等框架:

Just to keep the post complete, there are also other frameworks that are just as good (or even better):

  • Ruby on Rails
  • Django
  • CakePHP

和许多许多!

这篇关于架构新的ASP.NET Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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