diff --git a/doc/adr/.adr-dir b/doc/adr/.adr-dir new file mode 100644 index 0000000..75f9eba --- /dev/null +++ b/doc/adr/.adr-dir @@ -0,0 +1 @@ +result-return \ No newline at end of file diff --git a/doc/adr/result-return/0001-record-architecture-decisions.md b/doc/adr/result-return/0001-record-architecture-decisions.md new file mode 100644 index 0000000..3f0cbaa --- /dev/null +++ b/doc/adr/result-return/0001-record-architecture-decisions.md @@ -0,0 +1,26 @@ +# 1. Record architecture decisions + +Date: 2021-11-21 + +## Status + +Accepted + +## Context + +We need to create modern and domain oriented result type to descrbe domains failures. +Indeed: + +- Domain failures and code errors are not really the same issues. +- We need to have infrastructure logger and code. +- We need to catch the problem of having domain failures with rich expressivity without using exception. + +## Decision + +Create Result class that is a specialization of a monade to describe success and failures. +This class will contains a gobal logger. +This class should be build time as possible using meta programation. + +## Consequences + +We need to use `Result` as return type of domain functions if the method can fail.