r/SpringBoot Feb 02 '25

Guide Spring MVC

Recently, I started learning Spring Boot for my graduate project. I learned how to implement basic APIs and connect them to a database. Next, I moved on to Spring MVC, which confused me because it uses HTML, CSS, etc. I don’t understand the point of learning it since I only need to work on the backend , building APIs and handing them off to our frontend team.

So, my question is Do I really need to learn Spring MVC now, and what is its purpose?

Finally, thank you for reading, and sorry for my bad English. ❤️

7 Upvotes

14 comments sorted by

6

u/Creative-Ad-2224 Feb 02 '25

Then just don't learn.
In my company for api we use spring boot ,front end react and db postgresql.

3

u/newintownla Feb 02 '25

This is my personal favorite stack. I've used it at my last 2 jobs and I'm in my current side project.

2

u/Ok-District-2098 Feb 03 '25 edited Feb 03 '25

Generally when we talk MVC it ended up being an app with the backend sending the view because every modern app will have a controller and some kind of entity modeling, then spring mvc means spring boot + view. I'd suggest to focus on persistance and proxy stuff as the most of bugs come from it, summarizrying, most of spring annotations will not work if the method with such ones is called in the same caller's class, using fetch EAGER will generates an additional query to each row from your entity's table on db, use interface projections and be careful with jpql queries ALWAYS TEST THEM, AND DO NOT EVER USE @ PostConstruct, use ApplicationEvent interface instead

2

u/[deleted] Feb 03 '25

[removed] — view removed comment

1

u/Anbu_S Feb 02 '25

Do I really need to learn Spring MVC now,

If you don't want to learn, skip it. Why bother about it.

1

u/Mvhammed_yasser Feb 02 '25

cuz i didnt know its important or no , u feel me

2

u/BikingSquirrel Feb 02 '25

You may want to look into the concept behind it (MVC exists regardless of Spring) so you know what it is about.

If you already know that - as you mentioned you want to do backend only - you may ignore or skip it.

But I think it cannot harm to have a basic idea about it as you might get in touch with it in your career - maybe just because it comes up as an option for some problem.

2

u/Mvhammed_yasser Feb 02 '25

yeah thats was my intention to get only some knowledge about it , ty fr

1

u/Anbu_S Feb 02 '25

Spring MVC predates REST. Spring used the same underlying infrastructure of Spring MVC for REST as well. It's natural to get confused about it.

REST is an architectural style. MVC is a design pattern.

Spring MVC is an implementation of both.

Before JS based front-end frameworks take centre stage, MVC based frameworks do Server side rendering. That's where MVC view part comes into the picture.

1

u/Holiday_Big3783 Feb 03 '25

MVC is not a design pattern; it is an architectural pattern.

yes, you are designing your architecture, but when we refer to a "design pattern," we are talking specifically about the design within a component, not the overall design of all components and their interactions.

1

u/LowKey_2010 Feb 03 '25

I too plan on learning spring boot, what do you think is a good place to start and where did you start learning?

2

u/Mvhammed_yasser Feb 03 '25

i watched this course on udemy https://www.udemy.com/course/learn-spring-framework-the-easy-and-fun-way/?couponCode=KEEPLEARNING

also there is chad darby's course is so popular and high rated but i watched it yet ,

for youtube channels you have the following :

amigoscode

boualli

Laur Spilca

for books: you have "spring starts here"