Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Spring 5 Design Patterns

You're reading from   Spring 5 Design Patterns Master efficient application development with patterns such as proxy, singleton, the template method, and more

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781788299459
Length 396 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Rajput Rajput
Author Profile Icon Rajput
Rajput
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface
1. Getting Started with Spring Framework 5.0 and Design Patterns FREE CHAPTER 2. Overview of GOF Design Patterns - Core Design Patterns 3. Consideration of Structural and Behavioral Patterns 4. Wiring Beans using the Dependency Injection Pattern 5. Understanding the Bean Life Cycle and Used Patterns 6. Spring Aspect Oriented Programming with Proxy and Decorator pattern 7. Accessing a Database with Spring and JDBC Template Patterns 8. Accessing Database with Spring ORM and Transactions Implementing Patterns 9. Improving Application Performance Using Caching Patterns 10. Implementing the MVC Pattern in a Web Application using Spring 11. Implementing Reactive Design Patterns 12. Implementing Concurrency Patterns

Best practices for configuring the DI pattern


The following are the best practices for configuring the DI pattern:

  • Configuration files should be separated categorically. Application beans should be separate from infrastructure beans. Currently, it's a bit difficult to follow.
  • Always specify the component name; never rely on generated names by the container.
  • It is a best practice to give a name along with a description of what the pattern does, where to apply it, and the problems it addresses.
  • The best practices for component scanning are as follows:
    • The components are scanned at startup, and it scans the JAR dependencies as well.
    • Bad practice: It scans all the packages of com and org. It increases the startup time of the application. Avoid such type of component scanning:
                @ComponenttScan (( {{ "org", "com" }} ))
    • Optimized: It scans only the specific packages as defined by us.
                 @ComponentScan ( {  
                  "com.packt.patterninspring.chapter4.
          ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime
Visually different images