SlideShare a Scribd company logo
The Spring Framework TrainingGet to know Spring FrameworkRohit Prabhakarhttp://rohitprabhakar.com
Get to know Spring FrameworkThe Spring Framework: OverviewTopics:What is Spring?
Spring modules
Why use Spring
Dependency injection / IOC in detail
Lab WorkGet to know Spring FrameworkWhat is Spring?The Spring Framework is an open source application framework for the Java platform and .NET Framework (Spring.NET)  It is based on code published in Expert One-on-One J2EE Design and Development by Rod Johnson (Wrox, 2002).“Spring is an open source framework created to address the complexity of enterprise application development. One of the chief advantages of the Spring framework is its layered architecture, which allows you to be selective about which of its components you use while also providing a cohesive framework for J2EE application development.
Get to know Spring FrameworkHow does the Spring Framework looks like?
Get to know Spring FrameworkHow does the Spring Framework looks like?Each of the modules (or components) that comprise the Spring framework can stand on its own or be implemented jointly with one or more of the others. The functionality of each component is as follows:The core container: The core container provides the essential functionality of the Spring framework. A primary component of the core container is the BeanFactory, an implementation of the Factory pattern. The BeanFactory applies the Inversion of Control (IOC) pattern to separate an application's configuration and dependency specification from the actual application code.Spring context:The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, e-mail, internalization, validation, and scheduling functionality.Spring AOP:The Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management feature. As a result you can easily AOP-enable any object managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring-based application. With Spring AOP you can incorporate declarative transaction management into your applications without relying on EJB components.
Get to know Spring FrameworkHow does the Spring Framework looks like?Spring DAO:The Spring JDBC DAO abstraction layer offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code you need to write, such as opening and closing connections. Spring DAO's JDBC-oriented exceptions comply to its generic DAO exception hierarchy.Spring ORM:The Spring framework plugs into several ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps. All of these comply to Spring's generic transaction and DAO exception hierarchies.Spring Web module:The Web context module builds on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.Spring MVC framework:The MVC framework is a full-featured MVC implementation for building Web applications. The MVC framework is highly configurable via strategy interfaces and accommodates numerous view technologies including JSP, Velocity, Tiles, iText, and POI.
Get to know Spring FrameworkWhat does Spring Framework Offers: SummaryInversion of Control container: configuration of application components and lifecycle management of Java objectsAspect-oriented programming: enables implementation of cross-cutting routinesData access: working with relational database management systems on the Java platform using JDBC and object-relational mapping toolsTransaction management: unifies several transaction management APIs and coordinates transactions for Java objectsModel-view-controller: a HTTP and Servlet-based framework providing hooks for extension and customizationRemote Access framework: configurative RPC-style export and import of Java objects over networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP)Convention-over-configuration: a rapid application development solution for Spring-based enterprise applications is offered in the Spring Roo moduleBatch processing: a framework for high-volume processing featuring reusable functions including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource managementAuthentication and authorization: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi).Remote Management: configurative exposure and management of Java objects for local or remote configuration via JMXMessaging: configurative registration of message listener objects for transparent message consumption from message queues via JMS, improvement of message sending over standard JMS APIsTesting: support classes for writing unit tests and integration tests
Get to know Spring FrameworkWhy use Spring?Have you ever encountered these question?Cant’ I have a simpler solution?
How can I handle my every changing requirements?
How can be the architecture flexible?
Can’t I have everything in components which can be verified independently?
Can I make a plug and play software?
How can the software components reusable and changeable?
Should we use EJB? As it makes the product complex, unpredictable and un-maintainable, non-portable and everything  is framework committed.
…………….. And many more like theseSPRING IS THE ANSWER!
Get to know Spring FrameworkSpring Framework’s Mission StatementWe believe that:J2EE should be easier to use

More Related Content

PPTX
Introduction to Ibatis by Rohit
Rohit Prabhakar
 
PPTX
Spring Framework
tola99
 
ODP
Spring User Guide
Muthuselvam RS
 
PDF
Java spring framework
Rajiv Gupta
 
ODP
Introduction to Spring Framework and Spring IoC
Funnelll
 
PDF
Spring Framework - Core
Dzmitry Naskou
 
PDF
Spring framework
Aircon Chen
 
PDF
Spring Framework
NexThoughts Technologies
 
Introduction to Ibatis by Rohit
Rohit Prabhakar
 
Spring Framework
tola99
 
Spring User Guide
Muthuselvam RS
 
Java spring framework
Rajiv Gupta
 
Introduction to Spring Framework and Spring IoC
Funnelll
 
Spring Framework - Core
Dzmitry Naskou
 
Spring framework
Aircon Chen
 
Spring Framework
NexThoughts Technologies
 

What's hot (18)

PPTX
Spring MVC framework
Mohit Gupta
 
PPTX
Introduction to Spring Framework
Serhat Can
 
PPTX
Introduction to Spring Framework
Raveendra R
 
PPTX
Introduction to Spring Framework
ASG
 
PPTX
Java Spring Framework
Mehul Jariwala
 
PDF
Spring Framework Training Course
RMS Software Technologies
 
PDF
Introduction to Spring Framework
Hùng Nguyễn Huy
 
PDF
Spring core module
Raj Tomar
 
PDF
Spring framework core
Taemon Piya-Lumyong
 
PPTX
Spring framework
Rajkumar Singh
 
PPT
Spring introduction
Manav Prasad
 
PPT
Spring Framework
nomykk
 
PPTX
Java spring ppt
natashasweety7
 
PPTX
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Arjun Thakur
 
PDF
Spring MVC Framework
Hùng Nguyễn Huy
 
PDF
Spring framework Introduction
Anuj Singh Rajput
 
PPTX
Spring Framework Presantation Part 1-Core
Donald Lika
 
PDF
Spring bean mod02
Guo Albert
 
Spring MVC framework
Mohit Gupta
 
Introduction to Spring Framework
Serhat Can
 
Introduction to Spring Framework
Raveendra R
 
Introduction to Spring Framework
ASG
 
Java Spring Framework
Mehul Jariwala
 
Spring Framework Training Course
RMS Software Technologies
 
Introduction to Spring Framework
Hùng Nguyễn Huy
 
Spring core module
Raj Tomar
 
Spring framework core
Taemon Piya-Lumyong
 
Spring framework
Rajkumar Singh
 
Spring introduction
Manav Prasad
 
Spring Framework
nomykk
 
Java spring ppt
natashasweety7
 
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Arjun Thakur
 
Spring MVC Framework
Hùng Nguyễn Huy
 
Spring framework Introduction
Anuj Singh Rajput
 
Spring Framework Presantation Part 1-Core
Donald Lika
 
Spring bean mod02
Guo Albert
 
Ad

Similar to Spring Framework Rohit (20)

PDF
Spring presentecion isil
Willy Aguirre
 
PDF
Spring presentecion isil
Willy Aguirre
 
PPT
Spring ppt
Mumbai Academisc
 
PDF
Spring Framework Tutorial | VirtualNuggets
Virtual Nuggets
 
PPT
Spring
Prashant Kumar
 
PPT
Spring - a framework written by developers
MarcioSoaresPereira1
 
PPTX
Spring framework
Kani Selvam
 
PPTX
Introduction to Spring Framework
Dineesha Suraweera
 
PPT
Spring Framework
Preetam Palwe
 
DOCX
Spring notes
Rajeev Uppala
 
ODT
Spring framework
Shivi Kashyap
 
PPTX
Spring framework Introduction
Anuj Singh Rajput
 
PPTX
1. Spring intro IoC
ASG
 
PPTX
How Spring Framework Really Works?
NexSoftsys
 
PPTX
Introduction to Spring sec1.pptx
NourhanTarek23
 
PDF
Spring 2
Aruvi Thottlan
 
PPTX
Introduction to j2 ee frameworks
Mukesh Kumar
 
ODP
Spring Mvc,Java, Spring
ifnu bima
 
PPTX
spring
Suman Behara
 
PDF
Spring tutorial
Phuong Le
 
Spring presentecion isil
Willy Aguirre
 
Spring presentecion isil
Willy Aguirre
 
Spring ppt
Mumbai Academisc
 
Spring Framework Tutorial | VirtualNuggets
Virtual Nuggets
 
Spring - a framework written by developers
MarcioSoaresPereira1
 
Spring framework
Kani Selvam
 
Introduction to Spring Framework
Dineesha Suraweera
 
Spring Framework
Preetam Palwe
 
Spring notes
Rajeev Uppala
 
Spring framework
Shivi Kashyap
 
Spring framework Introduction
Anuj Singh Rajput
 
1. Spring intro IoC
ASG
 
How Spring Framework Really Works?
NexSoftsys
 
Introduction to Spring sec1.pptx
NourhanTarek23
 
Spring 2
Aruvi Thottlan
 
Introduction to j2 ee frameworks
Mukesh Kumar
 
Spring Mvc,Java, Spring
ifnu bima
 
spring
Suman Behara
 
Spring tutorial
Phuong Le
 
Ad

Recently uploaded (20)

PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
Software Development Company | KodekX
KodekX
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Software Development Methodologies in 2025
KodekX
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Software Development Company | KodekX
KodekX
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 

Spring Framework Rohit

  • 1. The Spring Framework TrainingGet to know Spring FrameworkRohit Prabhakarhttp://rohitprabhakar.com
  • 2. Get to know Spring FrameworkThe Spring Framework: OverviewTopics:What is Spring?
  • 5. Dependency injection / IOC in detail
  • 6. Lab WorkGet to know Spring FrameworkWhat is Spring?The Spring Framework is an open source application framework for the Java platform and .NET Framework (Spring.NET)  It is based on code published in Expert One-on-One J2EE Design and Development by Rod Johnson (Wrox, 2002).“Spring is an open source framework created to address the complexity of enterprise application development. One of the chief advantages of the Spring framework is its layered architecture, which allows you to be selective about which of its components you use while also providing a cohesive framework for J2EE application development.
  • 7. Get to know Spring FrameworkHow does the Spring Framework looks like?
  • 8. Get to know Spring FrameworkHow does the Spring Framework looks like?Each of the modules (or components) that comprise the Spring framework can stand on its own or be implemented jointly with one or more of the others. The functionality of each component is as follows:The core container: The core container provides the essential functionality of the Spring framework. A primary component of the core container is the BeanFactory, an implementation of the Factory pattern. The BeanFactory applies the Inversion of Control (IOC) pattern to separate an application's configuration and dependency specification from the actual application code.Spring context:The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, e-mail, internalization, validation, and scheduling functionality.Spring AOP:The Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management feature. As a result you can easily AOP-enable any object managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring-based application. With Spring AOP you can incorporate declarative transaction management into your applications without relying on EJB components.
  • 9. Get to know Spring FrameworkHow does the Spring Framework looks like?Spring DAO:The Spring JDBC DAO abstraction layer offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code you need to write, such as opening and closing connections. Spring DAO's JDBC-oriented exceptions comply to its generic DAO exception hierarchy.Spring ORM:The Spring framework plugs into several ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps. All of these comply to Spring's generic transaction and DAO exception hierarchies.Spring Web module:The Web context module builds on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.Spring MVC framework:The MVC framework is a full-featured MVC implementation for building Web applications. The MVC framework is highly configurable via strategy interfaces and accommodates numerous view technologies including JSP, Velocity, Tiles, iText, and POI.
  • 10. Get to know Spring FrameworkWhat does Spring Framework Offers: SummaryInversion of Control container: configuration of application components and lifecycle management of Java objectsAspect-oriented programming: enables implementation of cross-cutting routinesData access: working with relational database management systems on the Java platform using JDBC and object-relational mapping toolsTransaction management: unifies several transaction management APIs and coordinates transactions for Java objectsModel-view-controller: a HTTP and Servlet-based framework providing hooks for extension and customizationRemote Access framework: configurative RPC-style export and import of Java objects over networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP)Convention-over-configuration: a rapid application development solution for Spring-based enterprise applications is offered in the Spring Roo moduleBatch processing: a framework for high-volume processing featuring reusable functions including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource managementAuthentication and authorization: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi).Remote Management: configurative exposure and management of Java objects for local or remote configuration via JMXMessaging: configurative registration of message listener objects for transparent message consumption from message queues via JMS, improvement of message sending over standard JMS APIsTesting: support classes for writing unit tests and integration tests
  • 11. Get to know Spring FrameworkWhy use Spring?Have you ever encountered these question?Cant’ I have a simpler solution?
  • 12. How can I handle my every changing requirements?
  • 13. How can be the architecture flexible?
  • 14. Can’t I have everything in components which can be verified independently?
  • 15. Can I make a plug and play software?
  • 16. How can the software components reusable and changeable?
  • 17. Should we use EJB? As it makes the product complex, unpredictable and un-maintainable, non-portable and everything is framework committed.
  • 18. …………….. And many more like theseSPRING IS THE ANSWER!
  • 19. Get to know Spring FrameworkSpring Framework’s Mission StatementWe believe that:J2EE should be easier to use
  • 20. It is best to program to interfaces, rather than classes. Spring reduces the complexity cost of using interfaces to zero.
  • 21. JavaBeans offer a great way of configuring applications.
  • 22. OO design is more important than any implementation technology, such as J2EE.
  • 23. Checked exceptions are overused in Java. A platform shouldn't force you to catch exceptions you're unlikely to be able to recover from.
  • 24. Testability is essential, and a platform such as Spring should help make your code easier to test.We aim that:Spring should be a pleasure to use
  • 25. Your application code should not depend on Spring APIs
  • 26. Spring should not compete with good existing solutions, but should foster integration. (For example, JDO, Toplink, and Hibernate are great O/R mapping solutions. We don't need to develop another one.)Get to know Spring FrameworkAre there any benefits of using spring?Pure JavaFounded on POJO-based development Ordinary Java classes that follow no special APIsNon-invasive for pre-existing POJOs
  • 28. Encourages new software to be written as POJOs
  • 29. Results in highly portable, reusable, and verifiable softwareLess Custom CodeExpand capabilities with less code
  • 30. Extensive and tested service abstractions
  • 31. Email, JMS, JMX, JSF, JDBC, etc…
  • 35. spring platform is easy to useTurn-key solutionSpring components can be integrated quickly, with minimal effort and predictable results
  • 36. Get to know Spring FrameworkAre there any benefits of using spring?Helps only where neededModularity allows only relevant components to be introduced into the application.
  • 41. Framework can be interfaced in deep or shallow layers.
  • 42. Interfaces are consistent at each layerWidely AvailableSpring is integrated into numerous frameworks
  • 43. Broad adoption possible because the container is portable and lightweight
  • 44. The container itself is designed as a POJO
  • 46. Performance overhead is rarely a consideration as it is not EJB ;)Get to know Spring Framework?
  • 47. Get to know Spring FrameworkThe Core Spring Module: Defining Beans and Dependency InjectionTopics:Setting bean properties
  • 51. Supplying other beans as properties or constructor argsGet to know Spring FrameworkSpring Hello World: What will we do?• Code a plain Java class model– Use the interface pattern by coding a HelloWorld interface and a HelloWorldImpl implementation• Configure the Spring IoC container• Instantiate the Spring IoC container• Acquire the object from the Spring IoC container– The client must only have knowledge of the interface, HelloWorld
  • 52. Get to know Spring FrameworkSpring Hello World: Create POJOCreate a interface HelloWorldpublic interface HelloWorld { public void execute();}Create an implementing class HelloWorldImplpublic class HelloWorldImpl implements HelloWorld { public void execute() {System.out.println("Hello World!"); }}
  • 53. Get to know Spring FrameworkSpring Hello World: Spring IOC Configuration<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsd"><bean id="helloWorld"class="HelloWorldImpl" /></beans>
  • 54. Get to know Spring FrameworkSpring Hello World: Executeimport org.springframework.beans.factory.*;import org.springframework.context.support.*;public class Main{public static void main(String[] args) { BeanFactorybeanFactory = new ClassPathXmlApplicationContext("applicationContext.xml");HelloWorldhelloWorld = (HelloWorld) beanFactory.getBean("helloWorld");helloWorld.execute();}}
  • 55. Get to know Spring FrameworkSpring Hello World: OutputRun the main class and you shall see “Hello World” printed.
  • 57. Top-level documentation page http://www.springframework.org/documentation• Wiki http://opensource.atlassian.com/confluence/spring• Forum http://forum.springframework.org• Books Spring Recipes. APress 2008 Spring in Action. Manning 2007 Agile Java Development with Spring, Hibernate andGet to know Spring Framework