VOOZH about

URL: https://www.nuget.org/packages/Fluent.Calculations.DotNetGraph/

⇱ NuGet Gallery | Fluent.Calculations.DotNetGraph 1.1.0-aplha.59




👁 Image
Fluent.Calculations.DotNetGraph 1.1.0-aplha.59

This is a prerelease version of Fluent.Calculations.DotNetGraph.
dotnet add package Fluent.Calculations.DotNetGraph --version 1.1.0-aplha.59
 
 
NuGet\Install-Package Fluent.Calculations.DotNetGraph -Version 1.1.0-aplha.59
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Fluent.Calculations.DotNetGraph" Version="1.1.0-aplha.59" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fluent.Calculations.DotNetGraph" Version="1.1.0-aplha.59" />
 
Directory.Packages.props
<PackageReference Include="Fluent.Calculations.DotNetGraph" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Fluent.Calculations.DotNetGraph --version 1.1.0-aplha.59
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Fluent.Calculations.DotNetGraph, 1.1.0-aplha.59"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Fluent.Calculations.DotNetGraph@1.1.0-aplha.59
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Fluent.Calculations.DotNetGraph&version=1.1.0-aplha.59&prerelease
 
Install as a Cake Addin
#tool nuget:?package=Fluent.Calculations.DotNetGraph&version=1.1.0-aplha.59&prerelease
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

👁 Logo

👁 Quality gate
👁 SonarCloud

👁 Quality Gate Status
👁 Maintainability Rating

👁 Nuget
👁 Nuget (with prereleases)
👁 Nuget
👁 GPLv3 License

Fluent Calculations

One of the more powerful ways to make a program readable is to break the calculations up into intermediate values that are held in variables with meaningful names. - Robert C. Martin, Clean Code, A Handbook of Agile Craftsmanship

<div align="justify"> By following this principle together wit Fluent Calculations library we gain an ability to write readable calculations as well as get insights at runtime. </div>

Motivation

<div align="justify"> <p> Having worked on many line of business and some finance applications authors have observed a common difficulty of understating and communicating non-trivial business logic or calculations. </p><p> Validating the correctness of financial calculations, like tax calculations for example, involves a lot of effort on analyst or tester side. For a developer pinpointing problems from just the final result is challenging, thus often we resort to manual debugging. </p><p> TDD falls short of communicating more complex test cases to business people as it relies on quite granular decomposition. Splitting up some algorithms is not always a good option too, due to loss of the original conciseness. Troubleshooting calculations happening in a production environment is impossible without deploying some manual logging that makes code noisy and less readable. </p> <p> This project attempts to provide a clean way to get an <b>"X-ray"</b> of calculations or business logic. </p> </div>

The Goal

Spend minutes of programming to save hours of debugging and testing.

Features

  • Number (Decimal) and Condition (Boolean) datatype are supported,
  • Seamlessly use C# math and logic operators,
  • Build isolated calculation components,
  • Close to no boilerplate code,
  • Serialize calculation tree to JSON,
  • Generate DOT graph output of your calculations,
  • Render graph as an image.

Get Started

Fluent.Calculations can be installed using the Nuget package manager or the dotnet CLI.

dotnet add package Fluent.Calculations.Primitives

Documentation

Usage/Examples

Basic demo calculation:

public class Demo : EvaluationScope<Number>
{
 Number
 A = Number.Of(1),
 B = Number.Of(2),
 C = Number.Of(3);

 Number D => Evaluate(() => A + B);

 Number E => Evaluate(() => D * C);

 public override Number Return() => E;
}

Number result = new Demo().ToResult();

The result value can be :

<img src="../assets/example/fluent-calculations-demo.dot.png" alt="Demo calculation graph rendering" width="280" height="auto">

Challenges

  • Explore ways to introduce concept of units (Meters, Kilograms, etc.).
  • Expand a list of supported operations and math functions.
  • Explore ways to optimize lambda expression compilation.
  • Explore a ways to reuse existing calculations and attempt to benefit from :
    • Cache compiled expressions,
    • Cache evaluation results,
    • Partial execution depending on changed parameters.
  • Explore thread-safety aspects.

License

GNU General Public License v3.0

Authors

🚀 About The Team

We are bunch of .NET practitioners always looking for ways to make code great.

Give it a star ⭐

Loving it? Show your support by giving this project a star!

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Fluent.Calculations.DotNetGraph:

Package Downloads
Fluent.Calculations.Graphviz

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0-aplha.59 185 3/24/2024
1.1.0-aplha.58 138 3/24/2024
1.1.0-aplha.57 138 3/24/2024
1.1.0-aplha.56 146 3/24/2024
1.1.0-aplha.55 130 3/23/2024
1.1.0-aplha.54 137 3/23/2024
1.1.0-aplha.53 129 3/23/2024
1.1.0-aplha.52 131 3/21/2024
1.1.0-aplha.51 139 2/24/2024
1.1.0-aplha.50 139 2/22/2024
1.1.0-aplha.49 195 1/11/2024
1.1.0-aplha.48 182 12/30/2023
1.1.0-aplha.47 149 12/30/2023
1.1.0-aplha.46 152 12/30/2023
1.1.0-aplha.45 142 12/30/2023
1.1.0-aplha.44 151 12/30/2023
1.1.0-aplha.43 146 12/30/2023
1.1.0-aplha.42 151 12/30/2023
1.1.0-aplha.41 137 12/30/2023
1.1.0-aplha.40 156 12/28/2023
Loading failed