SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

Último

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 

Último (20)

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 

Destacado

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 HubspotMarius Sescu
 
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 ChatGPTExpeed Software
 
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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 

Destacado (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