Coder Social home page Coder Social logo

rohitkvv / oat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/oat

0.0 1.0 0.0 90.15 MB

Object Analysis Toolkit is a C# library for analyzing objects using Rules.

License: MIT License

C# 76.02% Smalltalk 0.01% HTML 22.08% CSS 1.24% JavaScript 0.66%

oat's Introduction

Object Analysis Toolkit

CodeQL Nuget Nuget

Object Analysis Toolkit (OAT) is a rules driven metaprogramming engine for arbitrary C# objects.

Getting OAT

OAT is available on NuGet as Microsoft.CST.OAT.

OAT Blazor runs in your browser and allows you to Author Rules and test them in a Sandbox using Objects instantiated from your provided Assembly.

Documentation

Documentation for usage is on the Wiki.

Documentation for the API is available on GitHub Pages

Overview

  • Rules contain a object Target, an int Severity, a string boolean Expression and a List of Clauses which are applied to the targeted object.
  • Clauses perform a specified Operation on a specified Field of the Target. The Field can be any property or subproperty or field of the object. For example, SomeFieldOfTarget.SomeObject.SomeProperty.
  • Clauses can also Capture the result of their operation, to be returned with the applied Rule.
  • The Operation set can be expanded with delegates.
  • The object types supported by existing operations can also be expanded with delegates.

Basic Usage

The basic usage of OAT is applying rules to targets using the Analyze function.

object target;
IEnumerable<Rule> rules;
var analyzer = new Analyzer();
var rulesWhichApply = analyzer.Analyze(rules,target);

Capturing

OAT also supports capturing and returning results of clauses.

object target;
IEnumerable<Rule> rules;
var analyzer = new Analyzer();
var res = analyzer.GetCaptures(rules, target);

Detailed Usage

A full walkthrough including creating a custom operation and validating your custom operation rules and capturing Clause values is available on the wiki.

Authoring Rules

Detailed information on how to author rules is available on on the wiki.

Delegates

Documentation for implementing each delegate is available on the wiki.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.