
Identify key resources, understand Spring basics and advantages for modern enterprise Java projects, and set up a running Spring project.
Explore the three core Spring resources, the user guide, Javadoc API, and guides, to learn dependency injection and the IOC container, with tutorials and sample code.
Create a Maven project, add the Spring context dependency, and initialize an application context to enable dependency injection and start a Spring-based application.
Set up the Spring container in your project to run on Spring runtime, then explore the application context and its four types of application concepts, including dependency injection and autowiring.
Explore the application context, the main Spring container, its implementations—file system xml, class path xml, and annotation config—and the environment capable and bean factory features.
Create a basic file system XML application context, load it into the Spring application, and retrieve the bean by class, using single or multiple configuration files.
Configure autocomplete for Spring XML configuration by defining the external namespace, binding it to the Spring Beans XML schema, and enabling IntelliJ to validate and suggest Spring Beans tags.
Install Spring into our projects and programmatically create the Spring container to manage beans. Learn to create, retrieve, and use Spring managed beans through inversion of control.
Explore how to define a bean in a Spring xml configuration, assign an id and class, wire dependencies, and retrieve the bean from the container via dependency injection.
Retrieve and use a bean from the Spring container by loading the application context from the XML configuration, obtaining the bean by type, and invoking its do something method.
Convert a file-based Spring application context to a classpath resource by placing the application context xml in src/main/resources, then run to verify it loads from the classpath.
Discover how the Spring container manages bean lifecycles within the application context, with singleton scope ensuring a single shared instance across the application.
Explore prototype scope in Spring, creating a new bean instance with every get, and contrast it with singleton scope and its single instance.
Use the Spring container to instantiate a simple, stateless bean with the compiler-generated default constructor when no constructor is defined, enabling on demand instantiation.
Explore how beans in the Spring container are managed through inversion of control and dependency injection, with Spring automatically injecting dependencies into beans.
Inject a repository into a service using constructor dependency injection to separate business logic from data access.
Learn how Spring uses bean definitions to wire a repository into a service, and understand how a missing default constructor triggers a detailed exception to troubleshoot bean wiring.
Apply constructor dependency injection by wiring the repository into the service class through XML configuration, using the Spring container to inject the repository bean into the service constructor.
Validate constructor dependency injection by debugging the app, inspecting the Spring context to confirm the service is wired with the repository from the container, then execute business logic.
Explore how beans in an IoC container can be injected and shared across services and repositories, reinforcing proper layering while enabling multiple services to reuse the same repository.
Explore how dependency injection with an IoC container shifts object creation to the container, enabling inversion of control and a runtime graph of loosely coupled objects.
Explore constructor dependency injection, avoid tight coupling between services and repositories, and learn why the Hollywood principle enables loosely coupled, testable spring applications.
Explore setter dependency injection as an alternative to constructor-based injection, replacing the constructor with a set repository method on a bean and adapting the XML configuration for Spring.
Discover how to implement setter dependency injection in xml configuration using the property tag with ref values in spring, and test the setup in the next video.
Verify setter dependency injection with the debugger by tracing the service to repository flow and queries, while contrasting constructor-based and setter-based DI within Spring.
Explore dependency injection and auto wiring in Spring, and learn how Spring applies autowiring to automatically inject dependencies and manage objects.
Explore how annotation-based component scanning auto-detects Spring beans, enabling auto wiring from a base package using @Autowired and @Component annotations within the Spring context.
Adapt service and repository classes to use Spring's autowiring in the container by declaring beans, reducing boilerplate and enabling annotation-based dependency injection.
Demonstrate how annotation-based configuration makes Spring beans, components, and repositories self-describing and auto-wired, offering a cleaner, code-driven alternative to XML configuration.
Replace the configuration file with annotation-driven bean definitions, using component scan to inject and autowire singleton beans in the application context.
Apply spring stereotype annotations to replace generic components with controller, service, and repository roles, improving readability and enabling targeted searches across the application.
Master setter dependency injection with annotations by showing how field injection uses Java reflection to assign a repository field without setter methods, reducing boilerplate while managing multiple injected dependencies.
Explore constructor dependency injection with annotations in the Spring Framework, verify injection via constructor, observe bean creation, application context refresh, and bean resolution for the repository.
Switch to the annotation-based application context by removing the XML config and enabling component scanning of a base package to configure beans with annotations.
Create a java configuration class with @Configuration and load it into the annotation config application context to wire beans via reflection, moving from xml to annotation based configuration.
Discover how to configure Spring with Java-based configuration using @Bean factory methods in a configuration class, replacing component scanning and annotation-based wiring to create and wire repository and service beans.
Explore how Spring manages bean scopes with Java-based configuration, comparing singleton and prototype behavior. See how prototype services create new instances while repositories remain singleton and are shared.
Explore how autowiring becomes ambiguous in a larger Spring app by introducing interface-based services and multiple implementations, highlighting the need for qualifiers to resolve bean selection.
Resolving ambiguity when multiple beans implement the same interface by narrowing the reference type or qualifying the bean name, enabling Spring auto-wiring and precise dependency injection.
Resolve ambiguity among multiple beans by using the @Qualifier annotation to select a named instance, rather than by type, in the Spring runtime.
Explore how Spring handles properties and environment specific property sets through profiles, enabling configuration driven applications that pass properties to beans for cleaner, more adaptable, and testable code.
Learn to inject runtime properties into spring beans using @Value and property placeholders, configure application.properties on the classpath via @PropertySource, and wire components through component scanning.
Explore property overriding in Spring by using environment variables and system properties, via vm options, to override application properties inside a jar, with system properties outranking environment variables.
Learn to configure properties in a Spring context using a property placeholder in xml configuration. Create an application.properties file and inject values into services, resolving placeholders with ${...} syntax.
Use the value annotation to specify default properties in Spring, defined in a properties file with a key and colon. Spring only applies the default when the key is missing.
Understand how missing property keys trigger exceptions in spring. Explore the role of defaulting and how the app logs or crashes when a key is not specified.
Explore resolving and using a property value in an xml bean definition, injecting values from a properties file into bean properties via property placeholders in Spring configuration.
Learn how spring profiles drive environment-specific beans and properties using the Environment interface and the active profiles property to access currently active profiles.
Set the active spring profile at runtime by using system properties, environment variables, or run configurations, and verify that the local profile is activated in the running JVM.
Enable environment-specific beans using a local profile and profile-based properties, so the app config bean activates only under local conditions and supports production profiles via conditional beans.
Learn how to switch environments with Spring profiles by creating development and production configurations, enabling profile-specific beans, and wiring environment properties to ensure correct behavior across local and production.
Explore the proxy design pattern through dynamic proxies, interfaces, and delegation to wrap a real object, intercept method calls, and enable optional extra behavior.
Explore how proxies intercept method calls to add extra behavior and interpose a proxy in front of a real object, with JDK dynamic proxies and Spring proxies demonstrated.
The lecture discusses the disadvantages of hand coded proxies—tight coupling and constant method updates—then shows how dynamic proxies in Spring automate transactions.
Explore dynamic proxies in the JDK using InvocationHandler and reflection API, including a timestamp logging proxy that intercepts and delegates method calls to the real object.
Explore how Spring creates dynamic proxies using the proxy factory bean, CGlib for concrete classes, and JDK dynamic proxies for interfaces, and how interface presence changes proxy strategy.
Explore Spring proxies in action by annotating a service method with @Transactional, showing how Spring wraps calls in a proxy and a transaction interceptor.
Master the Spring bean lifecycle by using after properties set and disposable bean callbacks to initialize and clean up components as the application context creates and closes.
Explore JDK standard lifecycle annotations @PostConstruct and @PreDestroy to manage bean initialization and destruction, reducing tight coupling with the Spring container while preserving Spring callbacks.
Trace the sequence of spring container callbacks from bean construction and property setting through initialization to destruction, including bean name, factory, post processors, and destroy methods.
Explore Spring's application context lifecycle by implementing application listeners for context started, refreshed, and closed events, and learn how programmatic starts and refreshes control runtime behavior.
Explore aware interfaces to receive callbacks from the Spring container and interact with core components. Learn how these interfaces enable deeper integration and customization of the Spring container.
Configure data sources in Spring by building an annotation-based app config, registering a data source bean, and injecting it into a GBC template for database access.
Explore how a data access object works as a repository, injects a data source via constructor, and uses Spring factory methods to connect to a data source.
Discover how to use connection pools as data sources in spring, including Apache DBP, reuse existing pools, and access data sources via JNDI lookup with the getDataSource method.
Create a JDBC template in Spring to execute queries against a database by wiring a data source into a repository and using a Spring application context.
Learn to use JDBC templates in Spring to create a table, perform inserts, and run queries with a callback handler that maps results to an employee domain object.
Learn how spring's jdbc dao support class abstracts boilerplate jdbc code by providing a data source and jdbc template for simplified database access.
Delve into Spring's aspect oriented programming, using aspects to address crosscutting concerns such as transactional, security, and logging, and learn how to enable and configure Spring AOP or AspectJ weaving.
Create a Spring managed bean named my service with a business method that prints doing business method, then add a time locking aspect and enable AspectJ auto proxy to intercept.
Explore spring AOP concepts by illustrating before, after, and around advice, define pointcut expressions, and intercept a service method to demonstrate execution order.
Understand pointcuts as expressions that declare a set of intercepted calls, including method invocations and even field writes, with join points representing actual runtime invocations used to guide interception.
Demonstrate accessing join points and their arguments programmatically within an aspect during a method invocation, including inspecting the join point, method signature, and arguments.
Explore around advice in Spring AOP by intercepting method calls and conditionally proceeding with the target method using a proceeding join point.
Learn to set up a Maven project for Spring MVC by configuring the dispatcher servlet, adding Spring Web MVC dependencies, and using war packaging with a web deployment descriptor.
Register the dispatcher servlet as the front controller in Spring Web MVC to route requests. Configure deployment descriptor web.xml to declare and map servlet with load on startup.
Create an XML-based configuration for the application context, enabling the bean and context namespaces. Enable component scanning on the base package to discover and register a controller for MVC.
Create a new Java class called my controller, annotate it with a controller stereotype so Spring treats it as a controller, enabling the dispatcher servlet to service requests.
Install and configure the jetty maven plugin to customize the build using plugins, not dependencies, and run a local web app with mvn clean jetty:run to validate contexts and endpoints.
Explore how project visibility, conditions, and revision cycles shape development workflows, with notes on JPA projects and debugging implications for web apps.
Initialize the dispatcher servlet as the front controller and show how Spring boots a web application by building the web application context through annotation-based component scanning.
Define a controller method that handles an incoming request and returns a view name or a model and view, using get mapping and consumes/produces to specify content types.
Configure a view resolver to map controller view names to JSP pages using an internal resource view resolver with a prefix and suffix, then render the GSP.
Explore how spring's dispatcher servlet routes a request through a chain of handler mappings to a matching controller method, invokes it, and renders the response.
Configure Spring Web MVC by plugging in a view resolver via a configuration object, then return a model and view with a map of values to render dynamic GSP pages.
Inject the http servlet request and response into a Spring controller to inspect cookies, headers, and perform programmatic actions using standard request and response implementations.
Bind query parameters in a Spring controller using request parameters, capture mood from a query string, and return 'feeling good' or 'could be better' with a ternary expression.
Learn how path variables extract parts of a request path and map them to controller parameters in a Spring rest endpoint, using curly braces and annotations.
This course takes you head first into the exciting world of Spring development!
You'll get to know and understand the major parts of the core framework such as:
The Spring container and how it manages your beans for you and delivers a flexible runtime environment for applications
The concept of dependency injection: how it works and is applied in Spring
Inversion of Control - what it is and why it's so useful
Spring property management and how to manage application properties and state
Profiles in Spring and how they are used and applied
Proxies and proxying and how that works to magically do things like make service methods transactional
The various lifecycle and callback interfaces and events you need to know to integrate with and access lower-level components of the Spring container
Spring JDBC and how to work with databases
Working with Spring Aspects to apply Aspect Oriented Programming in the container
Spring MVC and web application development with Spring
and much much more!
In this course we don't waste time going into the esoteric parts of the Spring framework which you'll never encounter. Instead, we focus just on the 90% of stuff you need to know to get the job done.
Spring is the most in-demand skill for Java developers beyond a knowledge of the Java programming language itself and in this course you'll be up and running and be able to confidently work with existing Spring applications, and have the confidence to start building your own, from the ground up.
I hope you'll join me on this fantastic exciting world of Spring development and I'll see you in class!