Sunday, April 14, 2013

Missing CLR -- Part 2 of 2: mdq.xmlTransform


Intro

In my previous post I raised the question of a possible missing CLR on MSDN's Master Data Services CLR Functions page. It turns out that there was a missing CLR (there are actually quite a few new CLRs not listed but this is a topic for another time). The missing guy I'm talking about is, IMHO, the baddest CLR ever. Before I talk about this nasty new CLR let me, first, say a couple things about functional programming; it will matter in a moment. I promise.


Functional Programming

Functional Programming (FP) is very power full and elegant stuff. At Wikipedia, functional programming is defined as follows (emphasis mine):

In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state.[1] Functional programming has its roots in lambda calculus, a formal system developed in the 1930s to investigate computability, the Entscheidungsproblem, function definition, function application, and recursion. Many functional programming languages can be viewed as elaborations on the lambda calculus.

In the MSDN article I posted earlier today: Functional Programming vs. Imperative Programming FP is described a little differently (emphasis mine):

The functional programming paradigm was explicitly created to support a pure functional approach to problem solving. Functional programming is a form of declarative programming.

The article continues by discussing Functional Programming Using XSLT.

Many XSLT developers are familiar with the pure functional approach. The most effective way to develop an XSLT style sheet is to treat each template as an isolated, composable transformation.The order of execution is completely de-emphasized. XSLT does not allow side effects (with the exception that escaping mechanisms for executing procedural code can introduce side effects that result in functional impurity).


Is XSLT a Functional Programming Language?

There are some that still argue that XSLT is not a functional programming language. I disagree. In a November, 2001 article by Dimitre Novatchev titled, The Functional Programming Language XSLT - A proof through examples Novatchev demonstrates beyond any doubt that XSLT is a functional programming language by implementing many major functional programming design patterns. There were 35 functions in total that illustrated the usefulness of higher order functions using XSLT 1.0.


And the missing CLR is…

So, why all the blather about functional programming? Because the mysterious magical missing CLR is mdq.XmlTransform, you can read more about it here. Why is this thing "the baddest CLR ever?" mdq.XmlTransform is the baddest CLR ever because it does not just solve a specific problem, it extends your SQL server instance to support a whole new, super-powerful functional programming language. Furthermore, it does so without requiring you to compile any new code for each new function. Now you can implement pure functions in SQL server: functions where tasks can be executed asynchronously and where the order of execution can be completely de-emphasized. All this using a well-tested, reliable and proven open-source language which has been used with great success since last century. Not too Kludgy, eh?

The other bonus is that this bad dog was developed, tested, QA’d and deployed by Microsoft (so you know it's good!). It's so good in fact that, beginning with SQL Server 2008 R2, it ships with Microsoft's new EIM software: Master Data Services and Data Quality Services. This CLR is solid, trustworthy and does more for your SQL server instance than any CLR I have ever seen.

Come back soon for some examples of what you can do with this guy and thanks for reading.


Click to enlarge:

--ab

The new xmlsqlninja logo ('X-M-L'-'See-Quel' 'ninja')


Last Updated: 4/19/2013 (code cleanup)

No comments:

Post a Comment