.NET 和 WCSF 的指南和设计决策

发布于 2024-11-08 23:40:41 字数 427 浏览 2 评论 0原文

我们已经开始将 .NET 胖客户端应用程序迁移到 Web。工作范围 仅限于将 winforms UI 迁移到 Web UI。在将早期的 Web 服务包装层剥离为表示组件后,业务逻辑组件将按原样重用,并且业务组件将在 IIS 上并置。我们决定使用 WCSF 来实现这一目的。我想验证一些架构/设计决策,

  1. 我们是否需要使用 JS 框架,例如 jQuery、DOJO 等 AJAX?或者 ASP.NET 控件是否有足够的内置支持来处理所有基于 JS 的前端验证、AJAX 表单提交、错误消息显示等。

  2. 使用基础模块有什么问题吗?在启动期间加载和缓存所有模块是否会使应用程序变得沉重?

  3. 对所有服务功能使用静态方法/类是一个好方法吗?或者我们应该使用具有服务依赖性的非静态类/方法?

我是 .NET 新手:)

We have started migration of a .NET thick client application to web. The scope of the work
is restricted to migrating the winforms UI to web UI. The biz logic components will be reused as-is after striping the earlier web service wrapper layer as the presentation components and the biz components will get collocated on IIS. We have decided to use WCSF for the purpose. I would like to validate some of the arch/design decisions,

  1. Do we need to use a JS framework, e.g. jQuery, DOJO etc. for AJAX ? Or are the ASP.NET controls has adequate in-built support to take of all JS based front-end validations, AJAX form submits, error message displays etc.

  2. Is there any concern in using foundation modules ? Does it make the application heavy by loading and caching all modules during startup ?

  3. Is using static method / class for all service functionalities a good approach? Or should we non-static class / method with service dependency instead ?

I am new to .NET :)

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

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

发布评论

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

评论(2

梦里°也失望 2024-11-15 23:40:41

您的个人资料表明,尽管您可能是 .NET 新手,但您却是一位经验丰富的 Java 开发人员。

1 - 我同意 TomTom 的观点,即您不需要 JS 框架,但 ASP.NET WebForms 验证控件非常有限。您很快就会发现自己需要编写自定义 JS,并且从一开始就有一个像 jQuery 这样的框架将会有很大帮助。使用 jQuery 的选择器,当有人单击某个按钮时禁用所有按钮以防止双重回发之类的事情变得更加容易。

也就是说,另一种选择是从 Telerik、DevExpress 或 Infragistics 等公司购买一些第三方控件。有一个免费、开源、社区维护的 AJAX 控件集,称为 ASP.NET AJAX Control Toolkit,此处: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite。默认的 ASP.NET 控件非常基本。

2 - 所有 ASP.NET 应用程序在更新后首次访问时加载到内存中时都不可避免地需要一段启动时间,例如典型的业务线应用程序大约需要 10 - 20 秒。我还没有调查 WCSF 的模块加载器会增加多少时间,但无论如何它都会成为初始加载的一部分。通常,您在更新 ASP.NET 站点后访问一次以强制进行初始加载,这样客户端就不必这样做。在这种情况下,WCSF 添加的任何时间对于客户来说都无关紧要。

3 - 对服务使用静态方法的一个缺点是您无法将它们添加到 .NET 中的接口。如果您使用 WCSF,我强烈建议使用其 DI 功能来解析接口,这意味着仅使用非静态事物。对于非静态事物,例如只能运行一次而无法更新成员变量的构造函数/初始化程序,也更难遇到单元测试问题。

Your profile suggests that while you may be new to .NET you are an experienced Java developer.

1 - I agree with TomTom that you don't NEED a JS framework, but ASP.NET WebForms validation controls are pretty limited. You'll quickly find yourself needing to write custom JS, and having a framework like jQuery in place from the beginning will help alot. Things like disabling all buttons when someone clicks one to prevent double postbacks gets much easier with jQuery's selectors.

That said, an alternative would be to buy some 3rd party controls from companies like Telerik, DevExpress or Infragistics. There is a free, open source, community-maintained set of AJAX controls called the ASP.NET AJAX Control Toolkit, here: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite. The default ASP.NET controls are pretty basic.

2 - All ASP.NET apps have an unavoidable startup time when they're loaded into memory on the first visit after an update, say about 10 - 20 seconds for a typical line of business app. I haven't investigated how much more time WCSF's module loader adds but it'll be part of the initial load anyway. Typically, you visit your ASP.NET site once after updating it to force the initial load so that clients don't have to. Any time WCSF adds really won't matter to clients in this case.

3 - One downside to using static methods for services is that you can't add them to interfaces in .NET. If you're using WCSF I'd strongly suggest using its DI features to resolve interfaces, which means use only non-static things. It's also harder to run into unit testing issues with non-static things e.g. constructors/initializers that only get run once with no way to update member variables.

烟─花易冷 2024-11-15 23:40:41

我是 .NET 新手:)

听起来更像是初级开发人员。

回复 3:不好的方法。使用依赖注入器,并在 90% 的情况下避免静态方法。你放弃了很多灵活性。顺便说一句,这就是我的初级开发人员方法的来源 - 静态方法和“修复”多年来一直是标准 IT 架构,与 .NET 无关。

回复 1:你不需要使用 JS 框架。您也不需要购买汽车,可以建造自己的汽车。但这并不符合成本效益。网络应用程序?首先学习 .NET...事实是,Microsoft 在版本 3 中提供了名为 MVC 的新子框架,它使得开发优秀的软件变得更加简单(可测试的后端)并且更适合 Web 应用程序。 MS 的 ASP.NET 内部标准控件和整个 WebForm 框架都有限,并且有自己的一系列问题。也就是说,如果您知道自己在做什么 - JQuery 方面(集成)和单元测试/架构方面,MVC 是最有用的。

回复 2:你关心什么;)就像:即使这会让他们在学业上变慢,但这并不真正相关。也就是说,什么是基础模块?我在 ASP.NET 框架或 IIS 文档中都没有看到这个词。

I am new to .NET :)

Sounds more likea junior deveoper.

Re 3: bad approach. Use an dependency injector, and avoid static methods in 90% of the cases. You give up a lot of flexibility. This is btw where my junior developer approachcomes from - static methods and the "healing" are standard IT architecture for years now and not related to .NET.

Re 1: you do not NEED to use a JS framework. You also dont need to buy a car and can build your own. It is not cost effective though. Web application? LEARN .NET first.... like thefact that there is this new sub-framework from Microsoft called MVC in version 3 that makes developing good software sasier (testable backend) and is more suited for web aplications. MS internal standard controls for asp.net and the whole webform framework hare limited and have their own set of problems. That said, MVC is most usefull if you know what you are doing - JQuery wise (integrated) and unit test / architecture wise.

Re 2: what do you care ;) As in: even if it makes them academically slower, it is not really relevant. That said, what are foundation modules? I dont see that word in either the ASP.NET framework or the IIS documentaition.

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