
Contains a small description of the course and few recommendations about the incoming lectures.
Summary of the goal of this section.
In this lecture:
what is IoC
what is DI
what is the structure of our sample project
Summary of the goal of this section.
In this lecture:
introduction to the Google Guice library - yet another powerful DI library
In this lecture:
introduction of the application context
XML configuration of the application context (part 1)
In this lecture:
introduction of the application context
XML configuration of the application context (part 2)
initial peek at the bean lifecycle
In this lecture:
enabling the annotation based configuration
initial peek at the bean post processors
introduction to several annotations - @Autowired, @Qualifier
In this lecture:
injecting list of dependencies with the same type
initial peek at JSR250
introducing several more annotations - @PostConstruct, @Value, @Configuration
externalising configurations
In this lecture:
removal of the XML configurations
elaboration on the @Configuration annotation
introduction of the @Bean annotation
In this lecture:
introduction of the component scan feature
introduction to the @ComponentScan annotation
In this lecture:
introduction to the stereotype annotations - @Repository, @Service, @Component, etc.
In this lecture:
what is a JSR?
introduction to JSR-250
introduction to JSR-330
how does the Spring framework supports these JSR-s?
In this lecture:
comparison between XML, annotation based an Java based configurations
pros
cons
In this lecture:
setting a final assignment for this section
solving of this assignment will confirm your understanding of the topics discussed up to now
In this lecture:
a sample solution of the final assignment for this section.
In this lecture:
adding test cases for the sample solution
Summary of the goal of this section.
In this lecture:
introduction to the bean lifecycle
defining initialisation methods (@PostConstruct and InitializingBean)
defining destroy methods (@PreDestroy and DisposableBean)
In this lecture:
introduction of the "aware" interfaces - making our beans aware of their spring environment
the place of the "aware" interfaces in the lifecycle of the bean
BeanNameAware, ResourceLoaderAware, etc.
In this lecture:
introduction of the BeanPostProcessor
primer - wraping a bean into a proxy
In this lecture:
what is a bean scope
singleton beans
prototype beans
controlling the bean scope
In this lecture:
custom scopes
example with thread scope
In this lecture:
mixing of bean scopes
singleton and prototype
prototype and singleton
In this lecture:
eager beans
lazy beans
controlling the eagerness of a bean
In this lecture:
dependency between the beans (@DependsOn)
controlling the injection order of the beans
@Order and Ordered
In this lecture:
what happens when we have no implementation for an injected interface
making a bean optional (injecting nulls)
support for the Optional class
In this lecture:
introduction to circular dependencies
resolving circular dependencies
using @Lazy
using setter injection
circular dependencies are often a code smell
In this lecture:
how does the ApplicationContext store bean definitions
introduction of the BeanDefinition
example - manual registration of a bean in a bean registry
In this lecture:
ApplicationContext-s and events
creating custom events
ApplicationEvent and ApplicationEventPublisher
the application context own events
In this lecture:
creating an application context for testing purposes
configuring the test context (@ContextConfiguration)
replacing a real bean in the test context (@TestBean)
writing an integration test
Summary of the goal of this section.
In this lecture:
few examples that hint the creation of proxies
In this lecture:
introduction to the proxy pattern
calculator example
implementing cache with dynamic JDK proxy
calculator example
implementing cache with CGLIB proxy
In this lecture I want to thank you for enrolling into our course, recommend the next step and say good bye.
Unlock the power of Spring Dependency Injection (DI)!
This course provides a comprehensive introduction to DI, one of the core concepts in the Spring Framework, allowing you to create, inject and troubleshoot your spring managed classes.
You’ll start with the fundamentals of Inversion of Control (IoC) . You’ll explore Spring’s IoC container, learn how to configure beans using XML configuration, annotations (@Component, @Autowired, @Qualifier, etc.), and Java-based configurations (@Bean, @Configuration). Through hands-on examples and exercises, you’ll implement different injection types and understand the role of Spring’s ApplicationContext in managing your beans.
You will see how Spring’s IoC container manages bean lifecycles and learn about bean scopes. You will learn how to combine different bean scopes and even implement your custom scope. You will tackle some more subtle cases like injection of multiple beans, handling of circular dependencies, optional dependencies and even more.
Finally you will learn about the proxy pattern and how the Spring framework creates proxies for us - JDK dynamic proxies and CGLIB proxies. This is very fundamental knowledge in order to continue learning about the second core concept in Spring - the Aspect Oriented Programming (AOP).
By the end of this course, you’ll have a strong grasp of DI principles and you will be ready to continue with AOP. A good choice for Java developers from all levels eager to deepen their knowledge in Spring!