Download E-books DSLs in Boo: Domain Specific Languages in .NET PDF

By Ayende Rahien

A general-purpose language like C# is designed to address all programming initiatives. in contrast, the constitution and syntax of a Domain-Specific Language are designed to compare a selected purposes quarter. A DSL is designed for clarity and straightforward programming of repeating difficulties. utilizing the leading edge Boo language, it is a breeze to create a DSL in your software area that works on .NET and doesn't sacrifice functionality.

DSLs in Boo exhibits you ways to layout, expand, and evolve DSLs for .NET through concentrating on ways and styles. You learn how to outline an app in phrases that fit the area, and to exploit Boo to construct DSLs that generate effective executables. and also you will not care for the awkward XML-laden syntax many DSLs require. The publication concentrates on writing inner (textual) DSLs that permit effortless extensibility of the appliance and framework. And if you happen to have no idea Boo, do not worry-you'll study here the entire concepts you need.

buy of the print e-book comes with a proposal of a unfastened PDF, ePub, and Kindle e-book from Manning. additionally on hand is all code from the e-book.

Show description

Read Online or Download DSLs in Boo: Domain Specific Languages in .NET PDF

Best Programming books

Working Effectively with Legacy Code

Get extra from your legacy structures: extra functionality, performance, reliability, and manageability Is your code effortless to alter? are you able to get approximately prompt suggestions should you do swap it? Do you realize it? If the reply to any of those questions isn't any, you have got legacy code, and it's draining money and time clear of your improvement efforts.

Clean Code: A Handbook of Agile Software Craftsmanship

Even undesirable code can functionality. but when code isn’t fresh, it could actually deliver a improvement association to its knees. each year, numerous hours and important assets are misplaced as a result of poorly written code. however it doesn’t need to be that manner. famous software program professional Robert C. Martin offers a progressive paradigm with fresh Code: A guide of Agile software program Craftsmanship .

Implementation Patterns

“Kent is a grasp at growing code that communicates good, is straightforward to appreciate, and is a excitement to learn. each bankruptcy of this booklet comprises very good reasons and insights into the smaller yet vital judgements we continually need to make whilst developing caliber code and sessions. ” –Erich Gamma, IBM exceptional Engineer   “Many groups have a grasp developer who makes a swift flow of fine judgements all day lengthy.

Agile Testing: A Practical Guide for Testers and Agile Teams

Te>Two of the industry’s so much skilled agile checking out practitioners and specialists, Lisa Crispin and Janet Gregory, have teamed as much as deliver you the definitive solutions to those questions etc. In Agile trying out, Crispin and Gregory outline agile trying out and illustrate the tester’s function with examples from genuine agile groups.

Additional resources for DSLs in Boo: Domain Specific Languages in .NET

Show sample text content

Thirteen. directory eight. thirteen The implementation of the with key-phrase ///

/// A key-phrase /// The situation that we’re trying out. /// Execute the script after which try out its country. ///

/// The module identify we are utilizing /// because the beginning requirement /// Action that established the country lower than the /// unique module public void with(string moduleName, motion motion) { Assert. IsNotEmpty(Script, "No script was once targeted for testing"); ruleUnderTest = dslFactory. Create( Script, new RequirementsInformation(0, moduleName)); ruleUnderTest. Evaluate(); currentModuleName = moduleName; action(); } In directory eight. thirteen, we create and execute the desired DSL after which use the final parameter of the with process, that's a delegate that comprises the activities to ensure the present nation. directory eight. 14 exhibits one of many verification keyword phrases, should_require. The implementation of should_have_no_requirements is the same, so I won’t exhibit it. directory eight. 14 The implementation of 1 of the verification keyword phrases in our checking out DSL ///

/// A key-phrase /// look forward to finding the desired module as required for the present module ///

public void should_require(string requiredModule) { // look for the ideal module SystemModule module = ruleUnderTest. Modules. locate( delegate(SystemModule m) { go back m. identify == currentModuleName; }); // Fail if now not chanced on if (module == null) { Assert. Fail("Expected to have module: " + currentModuleName + " yet couldn't locate it within the registered modules"); } Testing the DSL scripts one hundred sixty five // look for the predicted requirement foreach (string requirement in module. requisites) { if (requirement == requiredModule) go back; } // now not stumbled on, we fail the try out Assert. Fail(currentModuleName + " must have a demand on " + requiredModule + " yet did not. "); } We use equipment like should_have_no_requirements and should_require to summary the verification procedure, which provides us a high-level language to specific the exams. This process considerably reduces the quantity of attempt required to check DSL scripts. We’re no longer performed but A observe of warning. The checking out DSL created right here can attempt just a restricted set of situations. with a purpose to attempt a script with common sense in it, you must expand it. for instance, what we've thus far couldn’t attempt the subsequent script: specification @vacations: calls for @scheduling_work calls for @external_connections if UserCount > 50 Extending the trying out DSL to help this is often effortless adequate, yet I’ll depart that as an workout for you (the answer is within the pattern code). If you’d like a touch, this can be the syntax I used: script "quotes/WithLogic. boo" with @vacations, UserCount=51: should_require @scheduling_work should_require @external_connections with @vacations, UserCount=49: should_require @scheduling_work should_not_require @external_connections Now that we’ve outfitted the trying out DSL, are we performed? now not really. We nonetheless need to determine how one can execute it.

Rated 4.85 of 5 – based on 12 votes