Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 11-Feb-17 1:39am
v2

1 solution

What exactly did you search for? See create rest spring mvc - Google Search[^].
 
Share this answer
 
Comments
Jignesh Khatri 11-Feb-17 7:44am    
@Richard I have searched it and have got blurred idea. Please read the question details carefully, you will come to know that what exactly my doubt is.
Richard MacCutchan 11-Feb-17 8:23am    
Quote: "Please explain me whole scenario"

This forum is for Quick Answers, not complete tutorials.
Jignesh Khatri 11-Feb-17 8:54am    
I am not at all demanding complete tutorial. I know how to write code. I just have few issues regarding Spring MVC. I just want to know that how can I access POJO (getter-setters) in Spring REST controller, as well as android app as well as website. Also do I need to make separate REST controller for all the database tables?
Richard MacCutchan 11-Feb-17 9:08am    
I do not know the answers, you need to go and study some of the links I found for you. And here is another one that you could easily have found for yourself: Understanding POJO[^].
Jignesh Khatri 11-Feb-17 9:55am    
That's not relevant to my question. But thanks for your try!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900