concept Authorization dsl in category .net

appears as: Authorization DSL, The Authorization DSL, n Authorization DSL
DSLs in Boo: Domain-Specific Languages in .NET

This is an excerpt from Manning's book DSLs in Boo: Domain-Specific Languages in .NET.

Figure 4.3. The Authorization class, the gateway to the Authorization DSL

The Authorization DSL is a more declarative example than the Message-Routing DSL. While the syntax is very imperative, the end result of the Authorization DSL is a value that is then processed by the application.

The specification could use some more work, but let’s try to define the requirements we have for the Authorization DSL:

Listing 7.2. Using the CustomizeCompiler method to add the implicit base class
// Customize the compiler for the Authorization DSL protected override void CustomizeCompiler( BooCompiler compiler, CompilerPipeline pipeline, Uri[] urls) { // The compiler should allow late-bound semantics compiler.Parameters.Ducky = true; pipeline.Insert(1, new ImplicitBaseClassCompilerStep( // The base type typeof(AuthorizationRule), // The method to override "CheckAuthorization", // Import the following namespaces "BDSLiB.Authorization")); pipeline.Insert(2, new AutoReferenceFilesCompilerStep()); }