Open kafka-yu opened 5 years ago
Does it mean that we don't need a Task class?
No need TaskService class, still need Task class
I think we can try it out. But I think there is no need to refactor the current code to this model at the moment. We can apply this paradigm in the next controller or model we are going to implement. What do you think?
Yeah that’s try it in next stage
Currently, we use Service/Repository architecture, it is ok for now and for a short long time.
But considering for long-term development and features growing, perhaps it could not handle them very well. Let's have a try to use CQRS (https://martinfowler.com/bliki/CQRS.html) design pattern? Then we separate query and operation into their own bus- IQueryBus, and ICommandBus. In API controller, we send a query to IQueryBus, it returns data we want. we send a command to ICommandBus, which will handle CUD actions, and then return the response.
Take Task controller for example: 1.[GET] /api/task/1