From 193b7f4dcac89db3b9f66f81be3fbaa0af1bfbcc Mon Sep 17 00:00:00 2001 From: Dauliac Date: Mon, 22 Nov 2021 13:45:06 +0200 Subject: [PATCH] =?UTF-8?q?[=F0=9F=93=9D]=20Add=20either=20result=20adr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/adr/.adr-dir | 1 + .../0001-record-architecture-decisions.md | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 doc/adr/.adr-dir create mode 100644 doc/adr/result-return/0001-record-architecture-decisions.md 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.