D
D
dmitriy2021-05-27 10:03:26
PHP
dmitriy, 2021-05-27 10:03:26

How correct is it to use a facade for commands?

To implement Application Layer scripts, I use commands and handlers,

$commandBus->handle( new LoadFileFromSource($loadParamDto));

and everything would be fine, but there is some problem in using, let's say there is no convenience in documenting when you connect the service and see public methods, in this case you have to open the documentation (wiki) or the source directory to see the entire list of commands and handlers.
Therefore, I came to the implementation of facade classes in each logical package, which provides an API to the package commands.
$fileFacade->loadFileFromSource($loadParamDto);

I would like to know how you document commands, events in your systems, how kosher is it to use a facade?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question