SlideShare une entreprise Scribd logo
1  sur  16
理解依赖 Daniel Hu
目录 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
依赖 ,[object Object],[object Object],[object Object],[object Object]
什么是依赖 ,[object Object],public class Bicycle{     /**  给轮胎充气  */     public void expand(Pump pump){     pump.blow();     } }
Why are Dependencies Bad ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why are Dependencies Bad ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dependency Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Additional Dependency Characteristics  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Additional Dependency Characteristics ,[object Object],[object Object],[object Object]
Additional Dependency Characteristics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dependency Injection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Factory VS Dependency Injection ,[object Object],[object Object],[object Object]
Factory VS Dependency Injection ,[object Object],[object Object],[object Object]
DI 的方式 ,[object Object],[object Object],[object Object]
Constructor versus Setter Injection ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
参考资料 ,[object Object],[object Object]

Contenu connexe

Tendances

Angular js best practice
Angular js best practiceAngular js best practice
Angular js best practiceMatteo Scandolo
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questionscodeandyou forums
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Abhijeet Vaikar
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingAgile Testing Alliance
 
Developing web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkDeveloping web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkVictor Porof
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Joe Ferguson
 
Understanding iOS from an Android perspective
Understanding iOS from an Android perspectiveUnderstanding iOS from an Android perspective
Understanding iOS from an Android perspectiveLauren Yew
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Cogapp
 
Angular js
Angular jsAngular js
Angular jsMindtree
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentationAndrei Burian
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS OrisysIndia
 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Edward Burns
 

Tendances (18)

Angular js best practice
Angular js best practiceAngular js best practice
Angular js best practice
 
Angular.js interview questions
Angular.js interview questionsAngular.js interview questions
Angular.js interview questions
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...
 
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debugging
 
Angular JS Introduction
Angular JS IntroductionAngular JS Introduction
Angular JS Introduction
 
Developing web apps using Java and the Play framework
Developing web apps using Java and the Play frameworkDeveloping web apps using Java and the Play framework
Developing web apps using Java and the Play framework
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
 
Codeception
CodeceptionCodeception
Codeception
 
Understanding iOS from an Android perspective
Understanding iOS from an Android perspectiveUnderstanding iOS from an Android perspective
Understanding iOS from an Android perspective
 
Flash Testing with Selenium RC
Flash Testing with Selenium RCFlash Testing with Selenium RC
Flash Testing with Selenium RC
 
Model viewviewmodel2
Model viewviewmodel2Model viewviewmodel2
Model viewviewmodel2
 
AngularJS
AngularJSAngularJS
AngularJS
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
 
Angular js
Angular jsAngular js
Angular js
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentation
 
The Basics Angular JS
The Basics Angular JS The Basics Angular JS
The Basics Angular JS
 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013
 
Prince sttalkv5
Prince sttalkv5Prince sttalkv5
Prince sttalkv5
 

En vedette

软件架构师应该知道的97件
软件架构师应该知道的97件软件架构师应该知道的97件
软件架构师应该知道的97件dearhwj
 
The Bridge January 2015
The Bridge January 2015The Bridge January 2015
The Bridge January 2015Natasha Burris
 
Who what and by whom
Who what and by whomWho what and by whom
Who what and by whomOpen.Embedded
 
Robert Margolis - GW Solar Symposium 2012
Robert Margolis - GW Solar Symposium 2012Robert Margolis - GW Solar Symposium 2012
Robert Margolis - GW Solar Symposium 2012GW Solar Institute
 

En vedette (6)

软件架构师应该知道的97件
软件架构师应该知道的97件软件架构师应该知道的97件
软件架构师应该知道的97件
 
The Bridge January 2015
The Bridge January 2015The Bridge January 2015
The Bridge January 2015
 
Sfare cafe testing web applications
Sfare cafe testing web applicationsSfare cafe testing web applications
Sfare cafe testing web applications
 
Who what and by whom
Who what and by whomWho what and by whom
Who what and by whom
 
P ort80 bkk-codeigniter
P ort80 bkk-codeigniterP ort80 bkk-codeigniter
P ort80 bkk-codeigniter
 
Robert Margolis - GW Solar Symposium 2012
Robert Margolis - GW Solar Symposium 2012Robert Margolis - GW Solar Symposium 2012
Robert Margolis - GW Solar Symposium 2012
 

Similaire à Understanding Dependency

High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode VMware Tanzu
 
Dependency Injection in Drupal 8
Dependency Injection in Drupal 8Dependency Injection in Drupal 8
Dependency Injection in Drupal 8valuebound
 
Techlunch - Dependency Injection with Vaadin
Techlunch - Dependency Injection with VaadinTechlunch - Dependency Injection with Vaadin
Techlunch - Dependency Injection with VaadinPeter Lehto
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)Tsuyoshi Miyake
 
Depth Consulting - Calgary .NET User Group - Apr 22 2015 - Dependency Injection
Depth Consulting - Calgary .NET User Group - Apr 22 2015 - Dependency InjectionDepth Consulting - Calgary .NET User Group - Apr 22 2015 - Dependency Injection
Depth Consulting - Calgary .NET User Group - Apr 22 2015 - Dependency InjectionDave White
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day trainingTroy Miles
 
Spring training
Spring trainingSpring training
Spring trainingTechFerry
 
Azure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish KalamatiAzure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish KalamatiGirish Kalamati
 
Spring security jwt tutorial toptal
Spring security jwt tutorial   toptalSpring security jwt tutorial   toptal
Spring security jwt tutorial toptaljbsysatm
 
Prince st Tech Talk - MABI Framework
Prince st Tech Talk - MABI FrameworkPrince st Tech Talk - MABI Framework
Prince st Tech Talk - MABI FrameworkPhotis Patriotis
 
WJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJSWJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJSPhilipp Burgmer
 
Pragmatic Java Test Automation
Pragmatic Java Test AutomationPragmatic Java Test Automation
Pragmatic Java Test AutomationDmitry Buzdin
 
Android Tutorial | Android App Development | Android Tutorial For Beginners |...
Android Tutorial | Android App Development | Android Tutorial For Beginners |...Android Tutorial | Android App Development | Android Tutorial For Beginners |...
Android Tutorial | Android App Development | Android Tutorial For Beginners |...Edureka!
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsJim Jeffers
 
Collaborative Contract Driven Development
Collaborative Contract Driven DevelopmentCollaborative Contract Driven Development
Collaborative Contract Driven DevelopmentBilly Korando
 

Similaire à Understanding Dependency (20)

High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode
 
Dependency Injection in Drupal 8
Dependency Injection in Drupal 8Dependency Injection in Drupal 8
Dependency Injection in Drupal 8
 
Techlunch - Dependency Injection with Vaadin
Techlunch - Dependency Injection with VaadinTechlunch - Dependency Injection with Vaadin
Techlunch - Dependency Injection with Vaadin
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
 
Depth Consulting - Calgary .NET User Group - Apr 22 2015 - Dependency Injection
Depth Consulting - Calgary .NET User Group - Apr 22 2015 - Dependency InjectionDepth Consulting - Calgary .NET User Group - Apr 22 2015 - Dependency Injection
Depth Consulting - Calgary .NET User Group - Apr 22 2015 - Dependency Injection
 
C#Portfolio
C#PortfolioC#Portfolio
C#Portfolio
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
Guice
GuiceGuice
Guice
 
Guice
GuiceGuice
Guice
 
sfdsdfsdfsdf
sfdsdfsdfsdfsfdsdfsdfsdf
sfdsdfsdfsdf
 
Spring training
Spring trainingSpring training
Spring training
 
Azure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish KalamatiAzure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish Kalamati
 
Spring security jwt tutorial toptal
Spring security jwt tutorial   toptalSpring security jwt tutorial   toptal
Spring security jwt tutorial toptal
 
Prince st Tech Talk - MABI Framework
Prince st Tech Talk - MABI FrameworkPrince st Tech Talk - MABI Framework
Prince st Tech Talk - MABI Framework
 
WJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJSWJAX 2012 - Web Apps With AngularJS
WJAX 2012 - Web Apps With AngularJS
 
Pragmatic Java Test Automation
Pragmatic Java Test AutomationPragmatic Java Test Automation
Pragmatic Java Test Automation
 
Android Tutorial | Android App Development | Android Tutorial For Beginners |...
Android Tutorial | Android App Development | Android Tutorial For Beginners |...Android Tutorial | Android App Development | Android Tutorial For Beginners |...
Android Tutorial | Android App Development | Android Tutorial For Beginners |...
 
Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
 
Collaborative Contract Driven Development
Collaborative Contract Driven DevelopmentCollaborative Contract Driven Development
Collaborative Contract Driven Development
 
Guice
GuiceGuice
Guice
 

Plus de dearhwj

Builder设计模式分享
Builder设计模式分享Builder设计模式分享
Builder设计模式分享dearhwj
 
可爱的宝宝 胡舒涵 100 Days
可爱的宝宝 胡舒涵 100 Days可爱的宝宝 胡舒涵 100 Days
可爱的宝宝 胡舒涵 100 Daysdearhwj
 
Anhui Hongcun
Anhui HongcunAnhui Hongcun
Anhui Hongcundearhwj
 
常用JAVA代码质量静态检查工具
常用JAVA代码质量静态检查工具常用JAVA代码质量静态检查工具
常用JAVA代码质量静态检查工具dearhwj
 
My Learning Way
My Learning WayMy Learning Way
My Learning Waydearhwj
 
Something About Mysql Database Index
Something About Mysql Database IndexSomething About Mysql Database Index
Something About Mysql Database Indexdearhwj
 

Plus de dearhwj (6)

Builder设计模式分享
Builder设计模式分享Builder设计模式分享
Builder设计模式分享
 
可爱的宝宝 胡舒涵 100 Days
可爱的宝宝 胡舒涵 100 Days可爱的宝宝 胡舒涵 100 Days
可爱的宝宝 胡舒涵 100 Days
 
Anhui Hongcun
Anhui HongcunAnhui Hongcun
Anhui Hongcun
 
常用JAVA代码质量静态检查工具
常用JAVA代码质量静态检查工具常用JAVA代码质量静态检查工具
常用JAVA代码质量静态检查工具
 
My Learning Way
My Learning WayMy Learning Way
My Learning Way
 
Something About Mysql Database Index
Something About Mysql Database IndexSomething About Mysql Database Index
Something About Mysql Database Index
 

Understanding Dependency