Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spring Auto wiring www.java9s.com. Auto wiring Resolves the beans that need to be injected by inspecting the elements in ApplicationContext. www.java9s.com.

Similar presentations


Presentation on theme: "Spring Auto wiring www.java9s.com. Auto wiring Resolves the beans that need to be injected by inspecting the elements in ApplicationContext. www.java9s.com."— Presentation transcript:

1 Spring Auto wiring

2 Auto wiring Resolves the beans that need to be injected by inspecting the elements in ApplicationContext.

3 Auto Wiring - Advantages Reduces the configuration for properties and constructor. Automatically gets updated when the configuration change.

4 Auto Wiring - TYPES NO - default byName byType constructor

5 byName public class Student { private Book javaBook; } public class Book { private String title; }

6 byType public class Car { private Wheel wheel; } public class Wheel { private String name; }

7 constructor public class College { private Student collegeStudent; public College(Student student){ this.collegeStudent = student; } public class Student { private String studentName; }

8 Auto Wiring – Disadvantages Missing wiring information. Explicit dependency configuration overrides auto wiring. Cannot resolve the beans if multiple beans of same type are configured.


Download ppt "Spring Auto wiring www.java9s.com. Auto wiring Resolves the beans that need to be injected by inspecting the elements in ApplicationContext. www.java9s.com."

Similar presentations


Ads by Google