SlideShare a Scribd company logo
Spring Quick Start Introducing the Spring Application Context and Spring’s XML-based configuration language
Topics in this session Spring quick start Writing bean definitions Configuring objects Going beyond constructor instantiation Creating an application context Summary
How Spring Works Spring ApplicationContext Fully configured application system Ready for use Configuration Instructions Your Application Classes (POJOs) Creates
Your Application Classes public class  TransferServiceImpl  implements  TransferService { public  TransferServiceImpl(AccountRepository ar) { this . accountRepository  = ar; } … } public class  JdbcAccountRepository  implements  AccountRepository { public  JdbcAccountRepository(DataSource ds) { this . dataSource  = ds; } … } Needed to load accounts from the database Needed to perform money transfers between accounts
Configuration Instructions <beans> <bean   id = “transferService”   class = “app.impl.TransferServiceImpl” > <constructor-arg   ref = “accountRepository”  /> </bean> <bean   id = “accountRepository”   class = “app.impl.JdbcAccountRepository” > <constructor-arg   ref = “dataSource”  /> </bean> <bean   id = “dataSource”   class = “com.oracle.jdbc.pool.OracleDataSource” > <property  name = “URL”   value = “jdbc:oracle:thin:@localhost:1521:BANK”  /> <property   name = “user”   value = “moneytransfer-app”  /> </bean> </beans>
Creating and Using the Application // Create the application from the configuration ApplicationContext context = new  ClassPathXmlApplicationContext( “application-config.xml” ); // Look up the application service interface TransferService service =  (TransferService) context.getBean( “transferService” ); // Use the application service.transfer( new  MonetaryAmount( “300.00” ),  “1” ,  “2” );
Inside the Spring  A pplication Context // Create the application from the configuration ApplicationContext context = new  ClassPathXmlApplicationContext( “application-config.xml” ); Application Context OracleDataSource dataSource JdbcAccountRepository accountRepository TransferServiceImpl transferService
Quick Start Summary Spring manages the lifecycle of the application All beans are fully initialized before they are used Beans are always created in the right order Based on their dependencies Each bean is bound to a unique id The id reflects the service the bean provides to clients The ApplicationContext works as a container, encapsulating the bean implementations chosen for a given deployment Conceals implementation details
Topics in this session Spring quick start Writing bean definitions Configuring objects Going beyond constructor instantiation Creating an application context Summary
Register… To register for this training please visit http://www.springpeople.com/courses/regular/spr-001.php For further info please contact SpringPeople Technologies [email_address] +91 80 4114 6519 http://www.springpeople.com

More Related Content

PPT
Web controls
PPTX
Dependency Inversion in large-scale TypeScript applications with InversifyJS
DOCX
Creating EPiServer Usage Reports
DOC
Page life cycle
PDF
Robust UI development with ClojureScript
PDF
React Context API
PDF
Redux and context api with react native app introduction, use cases, implemen...
PDF
JavaScript framework overview
Web controls
Dependency Inversion in large-scale TypeScript applications with InversifyJS
Creating EPiServer Usage Reports
Page life cycle
Robust UI development with ClojureScript
React Context API
Redux and context api with react native app introduction, use cases, implemen...
JavaScript framework overview

What's hot (20)

PDF
[@NaukriEngineering] Flux Architecture
PDF
Clean VIP (Clean Swift) architecture
PPTX
Getting started with react &amp; redux
PPTX
Introducing asp.net core mvc web application
PPTX
Reducers+flux=redux
PDF
React App State Management with react hooks and context api
PPTX
Scale react development with microservices architechture
PDF
An Introduction to Redux
PPTX
How To Utilize Context API With Class And Functional Componen in React.pptx
PPTX
React redux-redux-saga-rahil-memon
PDF
Андрей Шумада "Data migration in node.js rest api and mongo db "
PPTX
Services Factory Provider Value Constant - AngularJS
PDF
Who's afraid of front end databases
PDF
Having Fun Building Web Applications (Day 2 slides)
PDF
ASP.NET Page life cycle and ViewState
PPTX
ASP.NET Lecture 6
PPTX
Dispatcher
PPTX
SharePoint Framework y React
[@NaukriEngineering] Flux Architecture
Clean VIP (Clean Swift) architecture
Getting started with react &amp; redux
Introducing asp.net core mvc web application
Reducers+flux=redux
React App State Management with react hooks and context api
Scale react development with microservices architechture
An Introduction to Redux
How To Utilize Context API With Class And Functional Componen in React.pptx
React redux-redux-saga-rahil-memon
Андрей Шумада "Data migration in node.js rest api and mongo db "
Services Factory Provider Value Constant - AngularJS
Who's afraid of front end databases
Having Fun Building Web Applications (Day 2 slides)
ASP.NET Page life cycle and ViewState
ASP.NET Lecture 6
Dispatcher
SharePoint Framework y React
Ad

Viewers also liked (20)

PDF
Can Social Media Influence Behavior - We Walk the Talk - CS377T Final Present...
PPTX
Laboratory intership archer and mang por
PPTX
Nclb slideshare exp
PDF
Linseele,v.s af a2006- pastoralists in africa
PPTX
Ingles
PDF
Open shift origin openshift openstack fedora awesome
PDF
Lab vocabulary - Classroom activities
KEY
Spanish pronunciation guide alfonso moore
PDF
Openstack ap summit
PPTX
Paper mill – comana, romania
PPTX
Developing your School's WOM Marketing Plan, TAIS 2012
PDF
General Quiz (Prelims) | Elixir '12
PDF
第2回 ★★オンラインくるま座集会★★ 2013.10.03 at 小泉一真くるま座談話室
PPT
PPT
De Haafakkers digitale schoolkrant (juni 2011)
PDF
Discussion continuum - Kto placi za rozwoj lekow
PDF
Software product development services company creative technosoft systems
PPTX
Presentation1
PDF
Parent survey Longfellow 2011
PPSX
3D ODYSSEY
Can Social Media Influence Behavior - We Walk the Talk - CS377T Final Present...
Laboratory intership archer and mang por
Nclb slideshare exp
Linseele,v.s af a2006- pastoralists in africa
Ingles
Open shift origin openshift openstack fedora awesome
Lab vocabulary - Classroom activities
Spanish pronunciation guide alfonso moore
Openstack ap summit
Paper mill – comana, romania
Developing your School's WOM Marketing Plan, TAIS 2012
General Quiz (Prelims) | Elixir '12
第2回 ★★オンラインくるま座集会★★ 2013.10.03 at 小泉一真くるま座談話室
De Haafakkers digitale schoolkrant (juni 2011)
Discussion continuum - Kto placi za rozwoj lekow
Software product development services company creative technosoft systems
Presentation1
Parent survey Longfellow 2011
3D ODYSSEY
Ad

Similar to Corespring (20)

PDF
Getting Started With Spring Framework J Sharma Ashish Sarin
PDF
Toms introtospring mvc
PPT
Hybernat and structs, spring classes in mumbai
PPTX
สปริงเฟรมเวิร์ค4.1
PDF
Spring Start Here Learn What You Need And Learn It Well 1st Edition Laurentiu...
PDF
SpringPeople Introduction to Spring Framework
PPT
Spring and DWR
PDF
Spring in Action - Sixth Edition (MEAP V04) Craig Walls
PPTX
Skillwise-Spring framework 1
PPTX
Spring database - part2
PPTX
Spring framework
PDF
PDF Spring in Action - Sixth Edition (MEAP V04) Craig Walls download
PPTX
spring framework ppt by Rohit malav
PPTX
Java Spring Framework
ODP
SPRING 1. overview
PPT
Spring Framework
PPT
Spring, web service, web server, eclipse by a introduction sandesh sharma
PDF
the Spring Update from JavaOne 2013
KEY
Multi Client Development with Spring
PPTX
Spring (1)
Getting Started With Spring Framework J Sharma Ashish Sarin
Toms introtospring mvc
Hybernat and structs, spring classes in mumbai
สปริงเฟรมเวิร์ค4.1
Spring Start Here Learn What You Need And Learn It Well 1st Edition Laurentiu...
SpringPeople Introduction to Spring Framework
Spring and DWR
Spring in Action - Sixth Edition (MEAP V04) Craig Walls
Skillwise-Spring framework 1
Spring database - part2
Spring framework
PDF Spring in Action - Sixth Edition (MEAP V04) Craig Walls download
spring framework ppt by Rohit malav
Java Spring Framework
SPRING 1. overview
Spring Framework
Spring, web service, web server, eclipse by a introduction sandesh sharma
the Spring Update from JavaOne 2013
Multi Client Development with Spring
Spring (1)

Recently uploaded (20)

PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
1. Introduction to Computer Programming.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
August Patch Tuesday
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Approach and Philosophy of On baking technology
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
Encapsulation theory and applications.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
Accuracy of neural networks in brain wave diagnosis of schizophrenia
A novel scalable deep ensemble learning framework for big data classification...
1. Introduction to Computer Programming.pptx
cloud_computing_Infrastucture_as_cloud_p
August Patch Tuesday
Zenith AI: Advanced Artificial Intelligence
1 - Historical Antecedents, Social Consideration.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
WOOl fibre morphology and structure.pdf for textiles
NewMind AI Weekly Chronicles - August'25-Week II
Enhancing emotion recognition model for a student engagement use case through...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Approach and Philosophy of On baking technology
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Hybrid model detection and classification of lung cancer
Encapsulation theory and applications.pdf

Corespring

  • 1. Spring Quick Start Introducing the Spring Application Context and Spring’s XML-based configuration language
  • 2. Topics in this session Spring quick start Writing bean definitions Configuring objects Going beyond constructor instantiation Creating an application context Summary
  • 3. How Spring Works Spring ApplicationContext Fully configured application system Ready for use Configuration Instructions Your Application Classes (POJOs) Creates
  • 4. Your Application Classes public class TransferServiceImpl implements TransferService { public TransferServiceImpl(AccountRepository ar) { this . accountRepository = ar; } … } public class JdbcAccountRepository implements AccountRepository { public JdbcAccountRepository(DataSource ds) { this . dataSource = ds; } … } Needed to load accounts from the database Needed to perform money transfers between accounts
  • 5. Configuration Instructions <beans> <bean id = “transferService” class = “app.impl.TransferServiceImpl” > <constructor-arg ref = “accountRepository” /> </bean> <bean id = “accountRepository” class = “app.impl.JdbcAccountRepository” > <constructor-arg ref = “dataSource” /> </bean> <bean id = “dataSource” class = “com.oracle.jdbc.pool.OracleDataSource” > <property name = “URL” value = “jdbc:oracle:thin:@localhost:1521:BANK” /> <property name = “user” value = “moneytransfer-app” /> </bean> </beans>
  • 6. Creating and Using the Application // Create the application from the configuration ApplicationContext context = new ClassPathXmlApplicationContext( “application-config.xml” ); // Look up the application service interface TransferService service = (TransferService) context.getBean( “transferService” ); // Use the application service.transfer( new MonetaryAmount( “300.00” ), “1” , “2” );
  • 7. Inside the Spring A pplication Context // Create the application from the configuration ApplicationContext context = new ClassPathXmlApplicationContext( “application-config.xml” ); Application Context OracleDataSource dataSource JdbcAccountRepository accountRepository TransferServiceImpl transferService
  • 8. Quick Start Summary Spring manages the lifecycle of the application All beans are fully initialized before they are used Beans are always created in the right order Based on their dependencies Each bean is bound to a unique id The id reflects the service the bean provides to clients The ApplicationContext works as a container, encapsulating the bean implementations chosen for a given deployment Conceals implementation details
  • 9. Topics in this session Spring quick start Writing bean definitions Configuring objects Going beyond constructor instantiation Creating an application context Summary
  • 10. Register… To register for this training please visit http://www.springpeople.com/courses/regular/spr-001.php For further info please contact SpringPeople Technologies [email_address] +91 80 4114 6519 http://www.springpeople.com

Editor's Notes

  • #2: Emphasize this presentation will show how to hit the ground running with core Spring feature set.
  • #3: The quick start should be “quick” -- communicate at a high level what has to be done to get a basic Spring-powered application up and running
  • #4: Let’s start with a high level picture of how Spring works… A good analogy is an automobile plant. At a auto plant cars are assembled from parts on an assembly line. Workers on the line have an instruction manual that tells how to piece together the parts to build a car. So, you can view Spring as an application assembler where the parts are your Java components, and the instructions provided to Spring act as the manual for the assembly process. After assembly, you have a fully configured system ready to be used--just like after car assembly, you have a fully configured car ready to be driven. Parts can be interchanged, can be used in other vehicles (systems), etc.
  • #6: Focus on the relationships between the elements rather than they syntax itself.