Saturday, December 6, 2008

Geneva for Claims Based Security

It appears that Microsoft Project Zermatt is released with the name of Geneva. I say this because this also deals with Claims Based Security Model as was introduced in Project Zermatt.

T-SQL and MINUS operator

SELECT statement is an integral part of SQL. The result obtained by a SELECT statement has always been referred as SET. In this way, it should support all SET operations.

What I was amazed to know that T-SQL does not support MINUS operator. MINUS is one of the SET operations. There are definitely some workarounds that you can think of. But all of them asks you to change the natural way of getting the result set using some TECHNIQUES which I don't like.

What do you say about this? Do you want to support this or you have some alternate thoughts about this?

Windows Workflow Foundation (Windows WF) - Lesson 1

In my recent quest to implement Model Driven Engineering in all my designs, I am trying to use the features of Windows Workflow Foundation. I will be sharing you with the material that I understand. This is the first in the series of discussion, I will be sharing with you.

Workflow Types:
There are two types of workflow. They are as follows:

1. Sequential workflow
2. State machine based workflow

The difference between a sequential workflow and state machine based workflow is the same as the difference between a flowchart and graph.

Workflow Authoring Modes:
There are four authoring modes of workflow:

1. Markup only:
It is based on XAML which defines workflow structure logic and data flow.

2. Markup and Code:
XAML defines workflow and code beside defines extra logic. The code is written in a .net compliant language e.g. VB.net or C#.

3. Code Only:
The workflow is created by code in constructor.

4. Application generated:
Application creates activity tee and serializes into XAML or code (C# or VB.net)

Workflow developed through these authoring tools are compiled through a workflow compiler. The compiler for workflow is wfc.exe. The workflow compiler passes this on to C# or VB compiler, depending on the language used by developer, which compiles the code in the workflow. A .net assembly is generated with *.ctor extension which defines the workflow.

Inversion of Control (Dependency Injection)

There are three types of Inversion of Control. They are as follows:

1. IoC Type I (Interface Injection)
2. IoC Type II (Setter Injection)
3. IoC Type III (Constructor Injection)

Though it is difficult to remember these types but I recommend you to remember these as these are commonly used during conversation between software architecture designers. This is part of architect’s language.

In Inversion of control the library only does part job by specifying an abstract solution. For the rest of the solution, they have to rely on the code using that library. i.e. generic code has to call to application specific code. It is explained as Hollywood principle: “Don’t call us, we will call you”. So, in Inversion of control based frameworks, it is the reusable code which calls application specific client code.

Inversion of control is about calling user code from library code. Earlier we used to do this in the form of function pointers. In this case, library defines only the abstract implementation of task and more concrete implementation is provided by the user code. Other option to provide decoupling is the Service Locator option. The difference is the way they provide the implementation class to the user of the library. Service locator hides the implementation classes but at least you need to be able to see the locator. So instead of many couplings, you have this additional coupling with the locator.

Inversion of control is not a new concept but it has already been there. Event driven programming is one application of Inversion of Control. You can see that you define event handlers which are then called by the framework following the Hollywood principle. In Microsoft world, this concept is presented as dependency injection. In functional programming, monad is an example of IoC.