r/java • • Jan 30 '20

What is Spring Framework? From Dependency Injection to Web MVC

https://www.marcobehler.com/guides/spring-framework
229 Upvotes

21 comments sorted by

13

u/ryuzaki49 Jan 30 '20

Your @Transactional article is really good as well!

Quick question, would you consider adding an RSS feed to your blog?

7

u/marbehl Jan 30 '20

Thank you! There is an rss feed already at www.marcobehler.com/feed.rss , enjoy!

3

u/BoyRobot777 Jan 30 '20

Thanks for putting the time. I'll buy the book "Java Database Connections & Transactions". I like your writing style. Not too long I started pretty similar journey myself, by building the same application repo layer using plain JDBC, jOOQ, Spring Template, Hibernate, MyBaitis and JDBI3. I just want to finally have a full scope of possible alternatives and understand the underlying layer on which everything is built - JDBC.

1

u/pennengineer Jan 30 '20

Thank you OP!!!

1

u/marbehl Jan 30 '20

You are welcome :)

5

u/jack104 Jan 30 '20

This is a bitching article, really well done.

2

u/_litecoin_ Jan 30 '20 edited Jan 30 '20

Nice, thanks : )

2

u/sebnukem Jan 30 '20

Good article, Instructive and simple.

2

u/xlauchgottx Jan 30 '20

thank you very much

2

u/BinhHT Jan 31 '20

Thanks

1

u/Illaw Jan 30 '20

Couldn't have come at a better time. I just started to get into the details of how IoC works in my new Spring app. Thank you!

-12

u/Necessary-Conflict Jan 30 '20

I stopped reading at the point where "inversion of control" was treated as a synonym for "dependency injection". It's not.

https://stackoverflow.com/questions/6550700/inversion-of-control-vs-dependency-injection

22

u/wildjokers Jan 30 '20

This a pedantic and unnecessary flex of some trivia knowledge.

Pragmatism is the best approach in articles like this since someone reading an article like this wants practical information, not some drawn out and academic description of IOC and DI.

-12

u/Necessary-Conflict Jan 30 '20

Well, I guess, for you and your downvoting peers wouldn't matter if the article used the term "generics" or "functional programming" instead of DI. It's all academic pedantry for some :)

10

u/DJDavio Jan 30 '20

I can understand why they where swept together though. Inversion of control is just: depend on, but don't create yourself. And DI is just a method of providing those dependencies.

-10

u/Necessary-Conflict Jan 30 '20

No. IoC is a generic term meaning rather than having the application call the methods in a framework, the framework calls implementations provided by the application. IoC is synonym for "framework"

4

u/_litecoin_ Jan 30 '20

IoC is synonym for "framework"

You could hardcode the control in a single another class. That doesn't make it synonym for framework.

DI is IoC, but IoC isn't necessarily DI. Dependency injection is just an implementation of IoC.

-4

u/Necessary-Conflict Jan 31 '20

A single another class can be a very small framework. DI is not an "implementation of IoC". As I explained, IoC is a very general term, a term which was used long before DI became a thing, and doesn't capture the essence of DI at all. DI doesn't "invert" any sort of "control". It injects dependencies.

1

u/_litecoin_ Jan 31 '20

A single another class can be a very small framework.

Not if the control is hard coded.

6

u/skel625 Jan 31 '20

The article is well written, incredibly detailed, and shows the author put a great deal of effort into trying to help others use Spring Framework. It's amazing, especially for junior developers. It's too bad you couldn't see past your own ego, you probably could learn a lot from it.

1

u/bentheone Jan 31 '20

I learned that exact statement from the official Spring docs... don't they know what they're doing ? Maybe you should hit them up with that wisdom.