I am new to Spring MVC architecture and want to create backend, which interacts with database and which I can access it from website and android app. Following is my understanding till now for Spring MVC -
* Model (getter-setter classes)
* Service (classes containing CRUD methods for all tables in database)
* REST controller (one for each service class)
Are the above three points correct?
If yes, than another few issues strike in my mind, that how to access same Model (getter-setter) classes in both website as well as android, which are used by Spring MVC, as these classes are used to transfer data from view to REST controller.
Also is it mandatory to create separate REST controller for each service class? As my database contains 50 tables, than I have to create 50 service classes and 50 REST controller classes. Isn't this sounds something mess? I think am not on the right track. Please explain me whole scenario as to how can I make backend which can be accessed in both android app as well as website.
Thanks in advance.
What I have tried:
I have searched for this issue on internet, and have not found any reliable solution or understanding so far.