views:

516

answers:

4

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?

+1  A: 

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.

tuinstoel
+3  A: 

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.

Drejc
+1. Whenever I have seen the XML / XSLT approach for a web application, it has been to adequately separate concerns. MVC does a great job at accomplishing this.
joseph.ferris
+1  A: 

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.

santiiiii
+1  A: 

One pro:

  1. You can make XSLT-templates that produces HTML for the browser or XAML for WPF/Silverlight.
tuinstoel