SlideShare une entreprise Scribd logo
1  sur  13
Vibrant Technologies
& Computers
spring COURSE
Make Career With Us!!
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
springtraining.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
springtraining.vibranttechnologies.co.in
What is Spring?
2 Things:
An Inversion of Control (IoC) Container
Utilities that provide a consistent (and simple!
API to many other technologies (JDBC, ORM,
AOP, Declarative Transactions, etc)
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
Guiding Principles of Spring
Minimize dependencies on Spring
Minimize dependencies between all layers of an
application.
All application code should be testable, without an
application server or other complex environment
Fully factor the APIs (the 90% case should be
accomplished in one line of code!)
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.inWhat is Inversion of Control (IoC)?
(besides yet another confusing term for a simple concept)
IoC is all about Object dependencies.
Traditional "Pull" approach:
Direct instantiation
Asking a Factory for an implementation
Looking up a service via JNDI
"Push" approach:
Something outside of the Object "pushes" its
dependencies into it. The Object has no knowledge
of how it gets its dependencies, it
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
The BookDemo Application:
(A simple CRUD app)
User Interface
Service Layer
Data Access Layer
DB
Domain
Model
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
Pull Example
public class BookDemoServicePullImpl implements BookDemoServic
public void addPublisherToBook(Book book) {
BookDemoFactory factory = BookDemoFactory.getFactory()
BookDemoDao dao = factory.getBookDemoDao();
String isbn = book.getIsbn();
if (book.getPublisher() == null && isbn != null) {
Publisher publisher = dao.findPublisherByIsbn(isbn
book.setPublisher(publisher);
}
}
}
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
Push Example
(Dependency Injection)public class BookDemoServiceImpl implements
BookDemoService {
private BookDemoDao dao;
public void addPublisherToBook(Book book) {
String isbn = book.getIsbn();
if (book.getPublisher() == null && isbn !=
null) {
Publisher publisher =
dao.findPublisherByIsbn(isbn);
book.setPublisher(publisher);
}
}
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
Why is Dependency Injection better?
2 reasons:
Loose Coupling
Testability
Loose Coupling is improved because you don't hard-code depende
between layers and modules. Instead you configure them outside
the code. This makes it easy to swap in a new implementation of
service, or break off a module and reuse it elsewhere.
Testability is improved because your Objects don't know or care wh
environment they're in as long as someone injects their
dependencies. Hence you can deploy Objects into a test environm
and inject Mock Objects for their dependencies with ease.
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
How Spring does Inversion of Control
Write a configuration file in which you name
concrete "beans" for the interfaces between your
layers.
"Wire" the application together by stating which
beans are dependent on each other.
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
Example Spring applicationContext.xml
<beans>
<bean id="bookDemoDao"
class="com.bookdemo.dao.hibernate.BookDemoDaoHibernateImpl">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
<bean id="bookDemoService"
class="com.bookdemo.service.impl.BookDemoServiceImpl
<property name="bookDemoDao">
<ref bean="bookDemoDao"/>
</property>
</bean>
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
Bootstapping the IoC container
To start an app using IoC:
Create an ApplicationContext object and tell it
where applicationContext.xml is.
ApplicationContext appContext =
new ClassPathXmlApplicationContext("classpath*:applicationContext.xml");
This just has to be done once on startup, and can be done in the main
method or whatever code bootstraps the application.
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
businessanalyst.vibranttechnologies.co.in
Bootstapping the IoC container
For web applications the situation is simpler:
Web applications are bootstrapped by the web
container based on the web.xml file. Hence
creating an ApplicationContext on startup is as
simple as a single declaration in web.xml:
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
advancedaixadministration.vibranttechnologies.co.in
enquiry@vibrantgroup.co.in
androidtraining.vibranttechnologies.co.in
Where to Get More Information
Vibrant Group:
www.vibrantgroup.co.in
Vibrant Technologies & Computers
www.vibranttechnologies.co.in/technologies.vibrantgroup.co.
in
Vibrant HR Team
www.hr.vibrangroup.co.in

Contenu connexe

Dernier

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Dernier (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Spring training-course-navi-mumbai-spring-course-provider-navi-mumbai

  • 1. Vibrant Technologies & Computers spring COURSE Make Career With Us!! B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173
  • 2. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 springtraining.vibranttechnologies.co.in enquiry@vibrantgroup.co.in springtraining.vibranttechnologies.co.in What is Spring? 2 Things: An Inversion of Control (IoC) Container Utilities that provide a consistent (and simple! API to many other technologies (JDBC, ORM, AOP, Declarative Transactions, etc)
  • 3. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in Guiding Principles of Spring Minimize dependencies on Spring Minimize dependencies between all layers of an application. All application code should be testable, without an application server or other complex environment Fully factor the APIs (the 90% case should be accomplished in one line of code!)
  • 4. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.inWhat is Inversion of Control (IoC)? (besides yet another confusing term for a simple concept) IoC is all about Object dependencies. Traditional "Pull" approach: Direct instantiation Asking a Factory for an implementation Looking up a service via JNDI "Push" approach: Something outside of the Object "pushes" its dependencies into it. The Object has no knowledge of how it gets its dependencies, it
  • 5. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in The BookDemo Application: (A simple CRUD app) User Interface Service Layer Data Access Layer DB Domain Model
  • 6. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in Pull Example public class BookDemoServicePullImpl implements BookDemoServic public void addPublisherToBook(Book book) { BookDemoFactory factory = BookDemoFactory.getFactory() BookDemoDao dao = factory.getBookDemoDao(); String isbn = book.getIsbn(); if (book.getPublisher() == null && isbn != null) { Publisher publisher = dao.findPublisherByIsbn(isbn book.setPublisher(publisher); } } }
  • 7. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in Push Example (Dependency Injection)public class BookDemoServiceImpl implements BookDemoService { private BookDemoDao dao; public void addPublisherToBook(Book book) { String isbn = book.getIsbn(); if (book.getPublisher() == null && isbn != null) { Publisher publisher = dao.findPublisherByIsbn(isbn); book.setPublisher(publisher); } }
  • 8. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in Why is Dependency Injection better? 2 reasons: Loose Coupling Testability Loose Coupling is improved because you don't hard-code depende between layers and modules. Instead you configure them outside the code. This makes it easy to swap in a new implementation of service, or break off a module and reuse it elsewhere. Testability is improved because your Objects don't know or care wh environment they're in as long as someone injects their dependencies. Hence you can deploy Objects into a test environm and inject Mock Objects for their dependencies with ease.
  • 9. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in How Spring does Inversion of Control Write a configuration file in which you name concrete "beans" for the interfaces between your layers. "Wire" the application together by stating which beans are dependent on each other.
  • 10. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in Example Spring applicationContext.xml <beans> <bean id="bookDemoDao" class="com.bookdemo.dao.hibernate.BookDemoDaoHibernateImpl"> <property name="sessionFactory"> <ref local="sessionFactory"/> </property> </bean> <bean id="bookDemoService" class="com.bookdemo.service.impl.BookDemoServiceImpl <property name="bookDemoDao"> <ref bean="bookDemoDao"/> </property> </bean>
  • 11. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in Bootstapping the IoC container To start an app using IoC: Create an ApplicationContext object and tell it where applicationContext.xml is. ApplicationContext appContext = new ClassPathXmlApplicationContext("classpath*:applicationContext.xml"); This just has to be done once on startup, and can be done in the main method or whatever code bootstraps the application.
  • 12. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in businessanalyst.vibranttechnologies.co.in Bootstapping the IoC container For web applications the situation is simpler: Web applications are bootstrapped by the web container based on the web.xml file. Hence creating an ApplicationContext on startup is as simple as a single declaration in web.xml: <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
  • 13. B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 advancedaixadministration.vibranttechnologies.co.in enquiry@vibrantgroup.co.in androidtraining.vibranttechnologies.co.in Where to Get More Information Vibrant Group: www.vibrantgroup.co.in Vibrant Technologies & Computers www.vibranttechnologies.co.in/technologies.vibrantgroup.co. in Vibrant HR Team www.hr.vibrangroup.co.in