bwatts / Grasp

A .NET Analysis Engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grasp

A runtime in which developers can define, compile, and execute calculations against arbitrary data schemas

When Would You Use It?

You have a project whose problem domain centers around analysis: generating data by examining existing data. A survey system is a common example, as it collects values from users and performs different kinds of calculations on the answers:

  • How many people filled out the entire survey?
  • What is the average value of question 7?
  • What percentage of the survey did Bob complete?
  • Did Mary answer all required questions?
  • What is the total of Joe's answers on page 3?

The results of asking each of these questions becomes a new data point available to future rounds of analysis. This allows a very fine-grained and iterative approach to describing relationships within a set of data.

Thanks to its declarative and compositional nature, Grasp works very well at the core of dynamic systems. Let's say your project involves letting users create their own surveys, complete with calculations and validation; your application, then, doesn't define a survey itself but instead serves as a middleman between its users and Grasp. This neatly sidesteps the problem of inventing a data definition and execution engine (as usually happens in this scenario) and instead allows you to focus on building features for your users.

Surveys are just one example of a form structure; Grasp targets any system which asks questions about data. See the Articles section below for more examples.

Articles

NuGet

PM> Install-Package Grasp

Or from the online gallery:

https://nuget.org/packages/Grasp

Working with the Code

Code Contracts

You will need the Code Contracts tooling to build the solution correctly. The method calls in the System.Diagnostics.Contracts namespace are included in .NET 4; this simply allows Visual Studio to rewrite the assembly after it compiles:

http://msdn.microsoft.com/en-us/devlabs/dd491992

Tests

All tests are written using NUnit 2.5.10.11092. In order to run them, you will need a test runner that supports NUnit 2.5. I recommend the excellent TestDriven.NET.

License

MIT License

Copyright

Copyright © 2012 Bryan Watts

About

A .NET Analysis Engine

License:Other


Languages

Language:C# 100.0%