Doubt Spring MVC Controller

0

I'm studying Spring MVC, and I'm developing a system that will contain questions and answers. How do I get the Controller, I create one for QuestionsController and one for AnswersController, or only 1 for the two

    
asked by anonymous 16.05.2017 / 20:31

2 answers

1

On your system, the user will ask a question and you will return the answer on the same request, right?

If it is, you will only have one Controller, it will receive the user request with the question, you will process it in a Service, if you need to save something in the database use the Repository and return the response to the control that it will return the response in the request.

    
22.05.2017 / 20:02
0

It depends on how you are modeling the system. You could for example have a single entity to manage the issues, so it would address both the answers and the questions.

    
16.05.2017 / 21:38