Skip to Content
Java® Programming 24-Hour Trainer
book

Java® Programming 24-Hour Trainer

by Yakov Fain
February 2011
Intermediate to advanced
504 pages
11h 46m
English
Wrox
Content preview from Java® Programming 24-Hour Trainer

Chapter 35

Introduction to Spring MVC Framework

At the beginning of the century Java EE was called J2EE, and it was a heavy and over-engineered standard. Programming EJBs was difficult and required writing a lot of boilerplate code. Java annotations had not been invented yet. Having a Java container that would take care of multi-threading, transactions, persistence, and security was nice, but developers needed a lighter container and a simpler programming model.

Rod Johnson, a talented software engineer, wrote a book titled Expert One-on-One J2EE Design and Development, which was published by Wrox at the end of 2002. A year later the book’s code samples and development recommendations were released as the Spring Framework.

The Spring Framework is a Java container that provides a living space for an application’s objects, wired to each other in a loosely coupled way in XML configuration. This loose coupling comes at a price, though — configuration files are quite large in size.

Spring Framework was built based on the inversion of control (IoC) principle: The container is responsible for the instantiation and location of the objects. IoC is also known as the Hollywood principle: “Don’t call us, we’ll call you.”

Instead of having a class called Customer reach out to some container’s registry trying to find an Order, under the Spring Framework the container would use a system of callbacks to instantiate the Order and inject it into the instance of the Customer object. This is an ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java® Programming 24-Hour Trainer

Java® Programming 24-Hour Trainer

Yakov Fain

Publisher Resources

ISBN: 9780470889640Purchase bookAudio-VideoExamples