Understanding event-driven in a Spring MVC application

849 Views Asked by At

I've read the code from this Spring MVC application:

https://github.com/spring-guides/tut-rest/tree/master/6/complete/src/main/java/com/yummynoodlebar/core/events

I don't understand the role of those classes from events folder. How can I catch such a event in another place in application?

Another thing which I don't understand at this application, is why they doesn't use command-query separation somewhere at service layer. They used CQS on their rest controllers. I'm not agree with that, instead, they should use CQS on service-layer to provide a easy way to add validation or other core operations to their services. This link describes what I'm talking about CQS separation on service layer.

If you have suggestions about how to implement the CQS pattern described in the link from above, please tell it.

0

There are 0 best solutions below