Skip to content

Sabelo710/SARSCustomsRiskEngine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SARSCustomsRiskEngine Documentation

How To Run Application

Download Visual Studio Community Edition: https://visualstudio.microsoft.com/vs/community/

Install the C# Console package from the installer.

Clone the project

git clone https://github.com/Sabelo710/SARSCustomsRiskEngine.git

Enter the SARSCustomsRiskEngine folder

cd SARSCustomsRiskEngine

Open the Visual Studio solution's file: SARSCustomsRiskEngine.sln (should be done after successfully installing Visual Studio above)

Start the application

1-c#-start-app 2-c#-app-running

Architecture Overview

  1. Layered & Plug-in Architecture
    The code is split into thin horizontal layers that only depend downward, enabling independent evolution and testability.

    Copy

    ┌────────────┐  CLI / UI / Web API (thin, replaceable)
    │  Program   │
    ├────────────┤
    │  Results   │  DTO returned to callers (RpnParseResult)
    ├────────────┤
    │  Parsers   │  Tokenizer + AST builder (RpnParser)
    ├────────────┤
    │   Nodes    │  Concrete AST nodes (OperandNode, OperatorNode)
    ├────────────┤
    │Abstractions│  Contracts (ExpressionNode)
    ├────────────┤
    │  Models    │  Immutable value objects (Operand, Operator)
    └────────────┘
    
  2. Domain-Driven Building Blocks

    • Value ObjectsOperand, Operator encapsulate scalar values & behavior.

    • Entities / NodesOperandNode, OperatorNode form a small Expression Tree aggregate.

    • Domain ServiceRpnParser orchestrates tokenization and tree construction.

    • Anti-Corruption LayerRpnParseException prevents leaking low-level parsing errors.

  3. Open/Closed Design

    • New operators: extend Operator.cs only.

    • New syntax (e.g., infix): add another parser class; reuse existing nodes & models.

  4. Testability

    • Every public type is small, sealed, and has single responsibility → trivial unit tests.

    • No static state; parser is instantiable and side-effect free.

  5. Deployment Flexibility

    • Core assembly (*.Core) can be packaged as NuGet and reused in web APIs, Azure Functions, or Blazor apps.

    • CLI (Program.cs) is a thin adapter that can be swapped for any other host.

In short, the architecture is a micro-domain layer with clean boundaries, minimal surface, and maximal extensibility.

About

The SARS Customs Risk Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages