factory, factory itel ?
:
Validate(Config). , Config . Validate Config, . .
There is no separate verification method. Instead, validation occurs within the build method when necessary. The construction method is allowed to refuse and return either a constructed object or a result indicating an error.
The second option can be well implemented using monads with almost zero code and overhead.
source
share