架构批判:SQL Server FOR XML 转换为 XSLT 以实现丰富的 HTML 界面

发布于 2024-07-10 18:46:38 字数 196 浏览 5 评论 0原文

我可以获得有关以下架构的一些建设性反馈吗?

简化架构摘要:

从 SQL Server 返回 XML(使用 FOR XML)并将其直接传递到 XSL 转换中以生成丰富的 HTML 网站。

优点和缺点是什么?与传统的 3 层 ASP.NET 体系结构相比,这样的系统有何缺点?

Can I get some constructive feedback about the following architecture?

Simplified Architecture Summary:

Return XML from your SQL Server (using FOR XML) and pass it straight into a XSL transform to produce a rich HTML web site.

What are the pro’s and con’s of such a system when compared with a conventional 3-tier ASP.NET architecture?

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

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

发布评论

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

评论(4

猫性小仙女 2024-07-17 18:46:38

我们曾经做过这样的事情。 它适用于非常简单的页面。 但是一旦你想包含一些客户端 javascript 和类似的东西,你就注定失败了。

生成的输出隐藏在 XSLT 样式表中,很难阅读、维护和修复错误。

测试是可以做的,但也比以前付出更多的努力。

MVC 模式和类似模式更适合这种场景。

We have done something like this. And it works for very simple pages. But as soon as you would like to include some client side javascript and similar, you are doomed.

The generated output is hidden in the XSLT stylesheets and it is very hard to read, maintain and fix bugs.

Testing can be done, but also with much more effort than before.

The MVC pattern and similar is much better suited for such a scenario.

绳情 2024-07-17 18:46:38

两个缺点。

  1. 使用 C# 或 VB.net 进行数据操作变得更加困难,因为您没有具有属性(代码智能感知)的类,而是 xml 文档。

  2. 有内置的 asp.net 控件用于数据输入验证(客户端和服务器端)。 如果您使用 XSLT 生成 HTML 页面,则无法使用它们。

Two cons.

  1. Data manipulation with C# or VB.net becomes harder because you don't have classes with properties (code intellisense) but xml-documents.

  2. There are built in asp.net controls for data entry validation (both client side and server side). You can't use them if you use XSLT to produce your HTML-page.

锦欢 2024-07-17 18:46:38

我在一个项目中做过类似的事情。 我发现该架构非常简洁且可扩展,但我只会建议您在内部恰好拥有大量 XSLT 专业知识的情况下使用它。

我们有一些 XSLT 模板和一个使用 XSLT 参数执行转换的通用 C# 类。 我们获得了非常好的性能,但是对于新开发人员来说,该应用程序可能很难维护。

I've done something similar in a project. I find the architecture very clean and scalable, but I would only advise you to use it if you happen to have lots of XSLT expertise in house.

We have a few XSLT templates, and a generic c# class that performs the transformation, using XSLT parameters. We get very good performance but, for new developers, the app can be hard to maintain.

演多会厌 2024-07-17 18:46:38

专业人士之一:

  1. 您可以制作 XSLT 模板,为浏览器生成 HTML,或者为 WPF/Silverlight 生成 XAML。

One pro:

  1. You can make XSLT-templates that produces HTML for the browser or XAML for WPF/Silverlight.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文