Skip to content

Transform method on RuleSet #5

Description

@andrewcurioso

Apply currently does three tasks:

  1. It converts input into the correct data type needed for Evaluate()
  2. It applies all the rules (often by running Evaluate()
  3. It either returns an ValidationErrorCollection or converts the results to the correct output type.

This issue has the goal of making it possible to do steps 1 and 2 independently by adding a new method called Transform that converts the input type into the type expected by Evaluate().

This has a number of benefits:

  • Apply cannot be run concurrently because the output value can be changed, making it not thread safe, but Evaluate() can be run concurrently. So by allowing the unsafe portion of Apply() to be run independently we gain the ability to evaluate concurrently.
  • Calling functions have more control over execution.
  • Formalizes the expected behavior of Apply().
  • Allow for more code reuse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions