1

It seems to be the view and controllers are rigidly defined, but the model is highly nebulous. For instance, views go in views folder, controllers have the word controller in their name and have controller annotation, but models...?

What is the standard or de facto or at least the recommended way of implementing the model in Spring MVC and where is it located in the directory structure?

How does the model tie in with the controller? Does the model have direct access to the database? Thanks

asked Aug 18, 2016 at 18:08
10
  • 1
    The Model is everything that is not a Controller or a View. That can include a Data Access Layer, a Service Layer, a Business Logic Layer, Aggregate Roots, and maybe even some DTO's and ViewModel objects. If you want to put all that in a "Model" folder, that's as good a strategy as any. Commented Aug 18, 2016 at 18:16
  • Which of these model elements generally constitute a barebones model that interfaces with a database? Commented Aug 18, 2016 at 18:48
  • In other words what would be the bare minimum I would need to implement a model. I imagine I'd need a data access layer for sure. What else? Commented Aug 18, 2016 at 18:54
  • That's all you'd really need for a basic application. Commented Aug 18, 2016 at 19:12
  • 1
    Ah, c'mon. Think for yourself! Don't let other people do your thinking for you. There's no value in a software developer that can't make their own decisions. Commented Aug 18, 2016 at 19:54

1 Answer 1

-2

Robert Harvey's answer "The Model is everything that is not a Controller or a View. That can include a Data Access Layer, a Service Layer, a Business Logic Layer, Aggregate Roots, and maybe even some DTO's and ViewModel objects. If you want to put all that in a "Model" folder, that's as good a strategy as any."

answered Sep 1, 2016 at 10:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.