Skip to Content
Spring Start Here
book

Spring Start Here

by Laurentiu Spilca
October 2021
Beginner content levelBeginner
416 pages
11h 25m
English
Manning Publications
Content preview from Spring Start Here

5 The Spring context: Bean scopes and life cycle

This chapter covers

  • Using the singleton bean scope
  • Using eager and lazy instantiation for singleton beans
  • Using the prototype bean scope

Thus far we have discussed several essential things about object instances managed by Spring (beans). We covered the important syntaxes you need to know to create beans, and we discussed establishing relationships among beans (including the necessity of using abstractions). But we didn’t focus on how and when Spring creates the beans. From this perspective, we’ve only relied on the framework’s default approaches.

I chose not to discuss this aspect earlier in the book because I wanted you to focus on the syntaxes you’ll need up-front in your projects. However, ...

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.
Start your free trial

You might also like

Spring Boot in Action

Spring Boot in Action

Craig Walls
The Complete Java Developer Course: From Beginner to Master

The Complete Java Developer Course: From Beginner to Master

Codestars By Rob Percival, John P. Baugh

Publisher Resources

ISBN: 9781617298691Publisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link