Right now this works because we are using an InMemoryCommandBus implementation. But, if we change the CommandBus implementation to one where we cannot expect the execution of the code (for example if we store this command in Kafka for later consumption), the implementation of this controller wouldn't work at all (because the use case will never get executed in this request, and it will never throw).
Tengo un commandBus en el controller y adem谩s necesito un commandBus en el aplication service para poder lanzar un caso de uso de otro m贸dulo dentro del mismo context, pero al a帽adir ese segundo commandBus me salta el error: RangeError: Maximum call stack size exceeded
No estoy muy familiarizado con la inyecci贸n de dependencias y no sabr铆a como solucionar este problema de dependencia circular,
驴Hay alguna forma de solucionarlo?
Este error viene dado cuando desde cualquier fichero de ruta se hace el import container from '.. /config/dependency-injection'
/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/node_modules/node-dependency-injection/dist/lib/Loader/YamlFileLoader.js:73
throw new _ServiceFileNotFoundException"default";
^
Error
at new ServiceFileNotFoundException (/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/node_modules/node-dependency-injection/dist/lib/Exception/ServiceFileNotFoundException.js:45:19)
at YamlFileLoader.load (/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/node_modules/node-dependency-injection/dist/lib/Loader/YamlFileLoader.js:73:15)
at Object. (/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/dist/src/apps/mmc/config/dependency-injection/index.js:7:8)
at Module._compile (internal/modules/cjs/loader.js:1151:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1040:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (/var/www/vhosts/chatastro.com/develop.api.chatdevelop.com/dist/src/apps/mmc/routes/authRoute.js:6:32) {
name: 'ServiceFileNotFoundException'
}
`
I have a question regarding the responsability of incrementing the total in CousesCounter, Shouldn't this be on domain layer?
like tell the CoursesCounter to increment and let it to deside if this needs to be done or not, sounds to me like a bussines logic, but I could be wrong.
Hi, good job with the project. I believe that domain entities should have a private constructor. Right now we are able to create instances from those classes by static methods which are correct but we are also able to do it by calling new - in that way domain events would not be published.