views:

207

answers:

4

At my current job we have a CMS system that is .NET/SQL Server based. While customizing a couple of the modules for some internal use, I was a little surprised to see that instead of having APIs that returned data via your typical result set that was bound to a DataGrid/DataList/Repeater control, that the APIs returned an XML node/collection, that was then passed to an XSLT transformation and rendered on the page that way.

What are the benefits to using a model like this?

A: 

Using XSLT transformations would enable you to use a different layout and formatting than the standard .Net grid controls. Some people don't approve of using the .Net grids because they can include more HTML than necessary, and because if not managed carefully, they can bloat ViewState.

There was a recent discussion here about the .Net grids being bloatware (but developers use them anyway).

DOK
A: 

The outputted pages can be of any type, like html, php, etc.

Shawn Simon
A: 

By setting up the datasource and xml that the page merely transforms, you have also instantly created a simple 'web service' that can be consumed by other software. For example, it would be trivial to turn that grid into an rss feed or write a program to scrape that data periodically and send a more pressing alert.

Joel Coehoorn
A: 

The XSLT method is very MVC, unit-testing, separate-concerns friendly where ASP.NET controls well... aren't.

caveat: I reject the assumption that MS can write better html/css/js than I can. ASP.NET controls are clunky abominations.

annakata