SlideShare a Scribd company logo
1 of 29
Dependency Injection (Внедрение Зависимостей) ZF, Zend_Application, DI Container, Symfony DI 27 марта 2010 г. Санкт-Петербург
[object Object],[object Object],[object Object],[object Object],О Докладчике
Выбор классов ,[object Object],[object Object],[object Object]
Хранилище ,[object Object]
$GLOBALS ,[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],[object Object],[object Object],[object Object],[object Object]
Zend_Registry ,[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],[object Object],[object Object],[object Object],[object Object],[object Object]
Zend_Application ,[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],[object Object],[object Object]
Zend_Application              & Dependency 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],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Zend_Application              & Dependency 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],[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],[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]
[object Object],[object Object],[object Object],Взято из ®Wikipedia, the free encyclopedia ,[object Object],[object Object],[object Object]
Inversion Of Control (IOC)
PHP DI Containers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Symfony DI Container ,[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],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dependencies.xml   ,[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],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
//[..................]  /**    * Inject properties on Pre-Dispatch    */ public function  preDispatch() {          $actionController  =  $this ->getActionController();          $class  =  new  Zend_Reflection_Class( $actionController );          $properties  =  $class ->getProperties();          /* @var $property Zend_Reflection_Property */          foreach  ( $properties  as  $property ) {                  if  ( $property ->getDocComment()->hasTag( 'Inject' )) {                          $injectTag  =  $property ->getDocComment()->getTag( 'Inject' );                          $serviceName  =  $injectTag ->getDescription();                            if  ( empty ( $serviceName )) {                                  $serviceName  =  $this ->_formatServiceName(                                          $property ->getName());            }              if  ( isset ( $this ->_сontainer-> $serviceName )) {                                  $this ->_injectProperty(                                          $property ,                                           $this ->_container-> $serviceName                );            }         }      } }
Инъекция через аннотации ,[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],[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],[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]
Использование нескольких менеджеров транзакций ,[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],[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],[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],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],/**    * Some business method     *  @Transactional    *  @Log    *  @Secured  ROLE_ADMIN    */ public function  someMethod() {      doBusiness(); }
Хорошая архитектура  —                  Простота конфигурации ,[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],[object Object]

More Related Content

What's hot

Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowForget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowKacper Gunia
 
Symfony without the framework
Symfony without the frameworkSymfony without the framework
Symfony without the frameworkGOG.com dev team
 
November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2Kacper Gunia
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...King Foo
 
Information security programming in ruby
Information security programming in rubyInformation security programming in ruby
Information security programming in rubyHiroshi Nakamura
 
RESTful API 제대로 만들기
RESTful API 제대로 만들기RESTful API 제대로 만들기
RESTful API 제대로 만들기Juwon Kim
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015Fernando Hamasaki de Amorim
 
Apigility reloaded
Apigility reloadedApigility reloaded
Apigility reloadedRalf Eggert
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire playerMarcin Czarnecki
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Shinya Ohyanagi
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojobpmedley
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupKacper Gunia
 
Testing Backbone applications with Jasmine
Testing Backbone applications with JasmineTesting Backbone applications with Jasmine
Testing Backbone applications with JasmineLeon van der Grient
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)James Titcumb
 
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021Ayesh Karunaratne
 

What's hot (20)

Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowForget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers Cracow
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC Hydra
 
Symfony without the framework
Symfony without the frameworkSymfony without the framework
Symfony without the framework
 
November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
 
Information security programming in ruby
Information security programming in rubyInformation security programming in ruby
Information security programming in ruby
 
RESTful API 제대로 만들기
RESTful API 제대로 만들기RESTful API 제대로 만들기
RESTful API 제대로 만들기
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
 
Apigility reloaded
Apigility reloadedApigility reloaded
Apigility reloaded
 
Let's play a game with blackfire player
Let's play a game with blackfire playerLet's play a game with blackfire player
Let's play a game with blackfire player
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Zero to SOLID
Zero to SOLIDZero to SOLID
Zero to SOLID
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
 
Testing Backbone applications with Jasmine
Testing Backbone applications with JasmineTesting Backbone applications with Jasmine
Testing Backbone applications with Jasmine
 
Beyond Phoenix
Beyond PhoenixBeyond Phoenix
Beyond Phoenix
 
Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021PHP Enums - PHPCon Japan 2021
PHP Enums - PHPCon Japan 2021
 

Viewers also liked

Чуть сложнее чем Singleton: аннотации, IOC, АОП
Чуть сложнее чем Singleton: аннотации, IOC, АОПЧуть сложнее чем Singleton: аннотации, IOC, АОП
Чуть сложнее чем Singleton: аннотации, IOC, АОПKirill Chebunin
 
職場見習 1022成果發表-簡單食補—阿翔的故事
職場見習 1022成果發表-簡單食補—阿翔的故事職場見習 1022成果發表-簡單食補—阿翔的故事
職場見習 1022成果發表-簡單食補—阿翔的故事wawa661
 
職場見習 1022成果發表-月台咖啡小館—平溪鄉的十分
職場見習 1022成果發表-月台咖啡小館—平溪鄉的十分職場見習 1022成果發表-月台咖啡小館—平溪鄉的十分
職場見習 1022成果發表-月台咖啡小館—平溪鄉的十分wawa661
 
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...Primila Edward
 
Plantracer sl 3
Plantracer sl 3Plantracer sl 3
Plantracer sl 3amoiseev
 
Masinile romanesti automate de spalat rufe automatic
Masinile romanesti automate de spalat rufe automaticMasinile romanesti automate de spalat rufe automatic
Masinile romanesti automate de spalat rufe automaticPápai Zoltán
 
Limiting the Offshore EPC Contractor's Risks and Liabilities
Limiting the Offshore EPC Contractor's Risks and LiabilitiesLimiting the Offshore EPC Contractor's Risks and Liabilities
Limiting the Offshore EPC Contractor's Risks and LiabilitiesPrimila Edward
 
Dependency management in PHP & ZendFramework 2
Dependency management in PHP & ZendFramework 2Dependency management in PHP & ZendFramework 2
Dependency management in PHP & ZendFramework 2Kirill Chebunin
 
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...Primila Edward
 
Work design & measurement
Work design & measurementWork design & measurement
Work design & measurementAndrew Lengkong
 

Viewers also liked (15)

Чуть сложнее чем Singleton: аннотации, IOC, АОП
Чуть сложнее чем Singleton: аннотации, IOC, АОПЧуть сложнее чем Singleton: аннотации, IOC, АОП
Чуть сложнее чем Singleton: аннотации, IOC, АОП
 
SPEAK
SPEAKSPEAK
SPEAK
 
職場見習 1022成果發表-簡單食補—阿翔的故事
職場見習 1022成果發表-簡單食補—阿翔的故事職場見習 1022成果發表-簡單食補—阿翔的故事
職場見習 1022成果發表-簡單食補—阿翔的故事
 
EDAD MODERNA 3
EDAD MODERNA 3EDAD MODERNA 3
EDAD MODERNA 3
 
Halloween
HalloweenHalloween
Halloween
 
職場見習 1022成果發表-月台咖啡小館—平溪鄉的十分
職場見習 1022成果發表-月台咖啡小館—平溪鄉的十分職場見習 1022成果發表-月台咖啡小館—平溪鄉的十分
職場見習 1022成果發表-月台咖啡小館—平溪鄉的十分
 
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
 
Plantracer sl 3
Plantracer sl 3Plantracer sl 3
Plantracer sl 3
 
Masinile romanesti automate de spalat rufe automatic
Masinile romanesti automate de spalat rufe automaticMasinile romanesti automate de spalat rufe automatic
Masinile romanesti automate de spalat rufe automatic
 
Limiting the Offshore EPC Contractor's Risks and Liabilities
Limiting the Offshore EPC Contractor's Risks and LiabilitiesLimiting the Offshore EPC Contractor's Risks and Liabilities
Limiting the Offshore EPC Contractor's Risks and Liabilities
 
Dependency management in PHP & ZendFramework 2
Dependency management in PHP & ZendFramework 2Dependency management in PHP & ZendFramework 2
Dependency management in PHP & ZendFramework 2
 
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
Limiting the Offshore EPC Contractor's Risks and Liabiltities, Busan korea 19...
 
Nokia
Nokia Nokia
Nokia
 
Powert point
Powert pointPowert point
Powert point
 
Work design & measurement
Work design & measurementWork design & measurement
Work design & measurement
 

Similar to Dependency Injection in Zend Framework and Symfony explained

ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf Conference
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
Liferay Training Struts Portlet
Liferay Training Struts PortletLiferay Training Struts Portlet
Liferay Training Struts PortletSaikrishna Basetti
 
Разработка приложений для Android Honeycomb: ActionBar & Fragments
Разработка приложений для Android Honeycomb: ActionBar & FragmentsРазработка приложений для Android Honeycomb: ActionBar & Fragments
Разработка приложений для Android Honeycomb: ActionBar & FragmentsAlexey Ustenko
 
XQDT - XQuery Getting Momentum in Eclipse
XQDT - XQuery Getting Momentum in EclipseXQDT - XQuery Getting Momentum in Eclipse
XQDT - XQuery Getting Momentum in Eclipseguesteb3ec2
 
Struts2
Struts2Struts2
Struts2yuvalb
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
Alfresco Forms Service Deep Dive
Alfresco Forms Service Deep DiveAlfresco Forms Service Deep Dive
Alfresco Forms Service Deep DiveAlfresco Software
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend FrameworkBrett Harris
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing frameworkIndicThreads
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitPeter Wilcsinszky
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4Javier Eguiluz
 
Daejeon IT Developer Conference Web Service Practice
Daejeon IT Developer Conference Web Service PracticeDaejeon IT Developer Conference Web Service Practice
Daejeon IT Developer Conference Web Service Practiceplusperson
 
Web APIs & Google APIs
Web APIs & Google APIsWeb APIs & Google APIs
Web APIs & Google APIsPamela Fox
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkDirk Haun
 

Similar to Dependency Injection in Zend Framework and Symfony explained (20)

ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Liferay Training Struts Portlet
Liferay Training Struts PortletLiferay Training Struts Portlet
Liferay Training Struts Portlet
 
Разработка приложений для Android Honeycomb: ActionBar & Fragments
Разработка приложений для Android Honeycomb: ActionBar & FragmentsРазработка приложений для Android Honeycomb: ActionBar & Fragments
Разработка приложений для Android Honeycomb: ActionBar & Fragments
 
XQDT - XQuery Getting Momentum in Eclipse
XQDT - XQuery Getting Momentum in EclipseXQDT - XQuery Getting Momentum in Eclipse
XQDT - XQuery Getting Momentum in Eclipse
 
Seam Glassfish Slidecast
Seam Glassfish SlidecastSeam Glassfish Slidecast
Seam Glassfish Slidecast
 
Framework
FrameworkFramework
Framework
 
Struts2
Struts2Struts2
Struts2
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Zend framework 04 - forms
Zend framework 04 - formsZend framework 04 - forms
Zend framework 04 - forms
 
Alfresco Forms Service Deep Dive
Alfresco Forms Service Deep DiveAlfresco Forms Service Deep Dive
Alfresco Forms Service Deep Dive
 
Facebook Development with Zend Framework
Facebook Development with Zend FrameworkFacebook Development with Zend Framework
Facebook Development with Zend Framework
 
Migration testing framework
Migration testing frameworkMigration testing framework
Migration testing framework
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 
Daejeon IT Developer Conference Web Service Practice
Daejeon IT Developer Conference Web Service PracticeDaejeon IT Developer Conference Web Service Practice
Daejeon IT Developer Conference Web Service Practice
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
 
Web APIs & Google APIs
Web APIs & Google APIsWeb APIs & Google APIs
Web APIs & Google APIs
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 

Recently uploaded

Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxShubham Rawat
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxJackieSparrow3
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证kbdhl05e
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)oannq
 
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...JeylaisaManabat1
 

Recently uploaded (6)

Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptx
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptx
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)
 
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
Module-2-Lesson-2-COMMUNICATION-AIDS-AND-STRATEGIES-USING-TOOLS-OF-TECHNOLOGY...
 

Dependency Injection in Zend Framework and Symfony explained

  • 1. Dependency Injection (Внедрение Зависимостей) ZF, Zend_Application, DI Container, Symfony DI 27 марта 2010 г. Санкт-Петербург
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.  
  • 18. //[..................] /**   * Inject properties on Pre-Dispatch   */ public function preDispatch() {         $actionController = $this ->getActionController();         $class = new Zend_Reflection_Class( $actionController );         $properties = $class ->getProperties();         /* @var $property Zend_Reflection_Property */         foreach ( $properties as $property ) {                 if ( $property ->getDocComment()->hasTag( 'Inject' )) {                         $injectTag = $property ->getDocComment()->getTag( 'Inject' );                         $serviceName = $injectTag ->getDescription();                           if ( empty ( $serviceName )) {                                 $serviceName = $this ->_formatServiceName(                                         $property ->getName());           }             if ( isset ( $this ->_сontainer-> $serviceName )) {                                 $this ->_injectProperty(                                         $property ,                                         $this ->_container-> $serviceName               );           }        }     } }
  • 19.
  • 20. Проблемы, советы, размышления Транзакции, сквозная функциональность
  • 21.
  • 22.
  • 23.
  • 25.  
  • 27.
  • 28.
  • 29.

Editor's Notes

  1. * Instead of your program running the system, the system runs your program * Controller