0% found this document useful (0 votes)
18 views

Unit 1 Spring 1

Uploaded by

Amrin Mulani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Unit 1 Spring 1

Uploaded by

Amrin Mulani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Unit 1

Exploring Spring Boot


Syllabus

Introduction to Spring Framework • Structure of Spring application


and SpringBoot: • annotations and Configuration
• Overview of Spring ecosystem • YAML vs properties files
• Advantages of Spring • Autoconfing ,customizing auto-config
• Setting Development environment • conditional annotation
• Understanding dependency • CRUD operations
injection.
Creating and Handling REST services:
Events:
Understanding the service and
• Event Handling and Listeners in microservices architecture
spring boot
• Service Discovery and registry
Staring with SpringBoot:
• API Management and monitoring
• Spring Boot Starter project
• Spring Security, O-auth
• Spring Initializer
What is spring Framework?
• comprehensive programming and configuration model for modern Java-
based enterprise applications - on any kind of deployment platform.
• support at the application level
• Spring focuses on the "plumbing" of enterprise applications so that
teams can focus on application-level business logic, without unnecessary
ties to specific deployment environments
• Spring is a lightweight framework.
• support to various frameworks such as Struts, Hibernate, Tapestry, EJB,
JSF, etc.
• The framework, in broader sense, can be defined as a structure where we
find solution of the various technical problems.
• The Spring framework comprises several modules such as IOC, AOP,
DAO, Context, ORM, WEB MVC etc.
What is spring Framework?
• Make a Java method execute in a database transaction without having
to deal with transaction APIs.
• Make a local Java method a remote procedure without having to deal
with remote APIs.
• Make a local Java method a management operation without having to
deal with JMX APIs.
• Make a local Java method a message handler without having to deal
with JMS APIs.
Core Container
• Core Container consists of the Core, Beans, Context, and Expression Language modules.
• The Core and Beans modules provide the fundamental parts of the framework, including the
IoC and Dependency Injection features.
• The BeanFactory is a sophisticated implementation of the factory pattern.
• The Context module inherits its features from the Beans module and adds support for
internationalization (using, for example, resource bundles), event-propagation, resource-
loading, and the transparent creation of contexts by, for example, a servlet container.
• The Context module also supports Java EE features such as EJB, JMX ,and basic remoting.
The ApplicationContext interface is the focal point of the Context module.
• The Expression Language module provides a powerful expression language for querying and
manipulating an object graph at runtime.
• It is an extension of the unified expression language (unified EL) as specified in the JSP 2.1
specification. The language supports setting and getting property values, property assignment,
method invocation, accessing the context of arrays, collections and indexers, logical and
arithmetic operators, named variables, and retrieval of objects by name from Spring's IoC
container. It also supports list projection and selection as well as common list aggregations.
Data Access/Integration
• The Data Access/Integration layer consists of the JDBC, ORM, OXM,
JMS and Transaction modules.
• The JDBC module provides a JDBC-abstraction layer that removes the
need to do tedious JDBC coding and parsing of database-vendor specific
error codes.
• The ORM module provides integration layers for popular object-relational
mapping APIs, including JPA, JDO, Hibernate, and iBatis.
• The OXM module provides an abstraction layer that supports Object/XML
mapping implementations for JAXB, Castor, XMLBeans, JiBX and
XStream.
• The Java Messaging Service (JMS) module contains features for producing
and consuming messages.
• The Transaction module supports programmatic and declarative transaction
management for classes that implement special interfaces and for all your
Web
• The Web layer consists of the Web, Web-Servlet, Web-Struts, and Web-Portlet modules.
• Spring's Web module provides basic web-oriented integration features such as multipart
file-upload functionality and the initialization of the IoC container using servlet listeners
and a web-oriented application context. It also contains the web-related parts of Spring's
remoting support.
• The Web-Servlet module contains Spring's model-view-controller (MVC) implementation
for web applications. Spring's MVC framework provides a clean separation between
domain model code and web forms, and integrates with all the other features of the
Spring Framework.
• The Web-Struts module contains the support classes for integrating a classic Struts web
tier within a Spring application. Note that this support is now deprecated as of Spring 3.0.
Consider migrating your application to Struts 2.0 and its Spring integration or to a Spring
MVC solution.
• The Web-Portlet module provides the MVC implementation to be used in a portlet
environment and mirrors the functionality of Web-Servlet module.
AOP and Instrumentation

• Spring's AOP module provides an AOP Alliance-compliant aspect-


oriented programming implementation allowing you to define, for
example, method-interceptors and pointcuts to cleanly decouple code
that implements functionality that should be separated.
• Using source-level metadata functionality, you can also incorporate
behavioral information into your code, in a manner similar to that
of .NET attributes.
• The separate Aspects module provides integration with AspectJ.
• The Instrumentation module provides class instrumentation support
and classloader implementations to be used in certain application
servers.
Spring Boot Annotations

• Spring Boot Annotations is a form of metadata that provides data


about a program.
• used to provide supplemental information about a program.
• It is not a part of the application that we develop.
• It does not have a direct effect on the operation of the code they
annotate.
• It does not change the action of the compiled program.
Core Spring Framework Annotations

• @Required: It applies to • @Autowired: Spring provides


the bean setter method. annotation-based auto-wiring by
providing @Autowired
annotation.
• matching data-type.
• @Configuration: It is a class-
level annotation.
• The class annotated with
@Configuration used by Spring
Containers as a source of bean
definitions.

@Component: It is a class-level annotation. It is used to mark a Java class as a bean. A Java class annotated
with @Component is found during the classpath. The Spring Framework pick it up and configure it in the
application context as a Spring Bean.
• @Controller: The @Controller is a
class-level annotation.
• It is a specialization
of @Component. It marks a class as
a web request handler. It is often used
to serve web pages.
• By default, it returns a string that
indicates which route to redirect. It is
mostly used
with @RequestMapping annotation.
Features of Spring Framework
• Inversion of Control (IoC)
loose coupling
Testability
Reusability
Modular design
• Dependency Injection (DI)
Constructor Injection
Setter Injection
Field Injection
• Aspect-Oriented Programming (AOP)
• Spring MVC
• Transaction Management
• Spring Data
• Spring Security
• Spring Boot
• Testing Support
• Internationalization and Localization
Components of Spring Boot Ecosystem
1. Spring Initializr
2. Spring Boot Starters
3. Spring Boot Auto-Configuration
4. Spring Boot Core
5. Spring Boot Actuator
6. Spring Boot DevTools
7. Spring Boot Data
8. Spring Security

You might also like