SlideShare a Scribd company logo
1 of 34
Download to read offline
Agenda
    Who am I?
  Introduction
Castle Windsor
   Conclusion




 Castle Windsor

       Tuna Toksoz


    March 24, 2010




  Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?
                        Introduction
                      Castle Windsor
                         Conclusion


Who am I?
Introduction
    Dependency Injection
    Inversion of Control Container
Castle Windsor
  Why Castle Windsor?
  Configuration
  Extensibility points
      Facilities
      Events
      Dependency resolution control mechanisms
      Lifestyle control mechanisms
      Component initialization control mechanisms

Conclusion

                        Tuna Toksoz    Castle Windsor
Agenda
                         Who am I?
                       Introduction
                     Castle Windsor
                        Conclusion


Who am I?




     Senior student at Bogazici University
     (Passive) committer at Castle and NHibernate
     Blogger at his own blog and also on devlicio.us
     Has an interest in Robotics and its applications




                       Tuna Toksoz    Castle Windsor
Agenda
                           Who am I?
                                        Dependency Injection
                         Introduction
                                        Inversion of Control Container
                       Castle Windsor
                          Conclusion


What is DI all about?



      It is a pattern in Martin Fowler’s book
      Depends on the principle of providing dependencies from
      the outside
      Made up of 3 components
          Dependent
          Dependency
          Dependency provider




                         Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?
                                       Dependency Injection
                        Introduction
                                       Inversion of Control Container
                      Castle Windsor
                         Conclusion


Why should we use DI?



     Loosely coupled components/services
     Increased testability
     Reduced cost of changes in later stages of development
     Ability to change implementations between testing and
     deployment




                        Tuna Toksoz    Castle Windsor
Agenda
                     Who am I?
                                  Dependency Injection
                   Introduction
                                  Inversion of Control Container
                 Castle Windsor
                    Conclusion


Why should not we use DI?




     ...




                   Tuna Toksoz    Castle Windsor
Agenda
                         Who am I?
                                        Dependency Injection
                       Introduction
                                        Inversion of Control Container
                     Castle Windsor
                        Conclusion


Dependency Injection Methods




     Constructor Injection
     Property Injection
     Method Injection




                          Tuna Toksoz   Castle Windsor
Agenda
                         Who am I?
                                        Dependency Injection
                       Introduction
                                        Inversion of Control Container
                     Castle Windsor
                        Conclusion


Dependency Injection Methods - Examples


     Constructor Injection




     Property Injection



     Method Injection


                          Tuna Toksoz   Castle Windsor
Agenda
                         Who am I?
                                      Dependency Injection
                       Introduction
                                      Inversion of Control Container
                     Castle Windsor
                        Conclusion


Inversion of Control Container



      A point where all components are registered and being
      accessed
      A component which resolves dependencies of a requested
      component automatically
      Enables us to change implementations without much
      trouble




                       Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?    Why Castle Windsor?
                        Introduction   Configuration
                      Castle Windsor   Extensibility points
                         Conclusion


Why Castle Windsor?



     A popular framework
     Active development
         118 commits between October 2009 and February 2010.
         2nd version
     Extensibility points




                        Tuna Toksoz    Castle Windsor
Agenda
                         Who am I?    Why Castle Windsor?
                       Introduction   Configuration
                     Castle Windsor   Extensibility points
                        Conclusion


Castle Windsor Configuration




      XML Configuration
      Fluent Configuration
      Binsor/Boo Configuration




                       Tuna Toksoz    Castle Windsor
Agenda
                         Who am I?    Why Castle Windsor?
                       Introduction   Configuration
                     Castle Windsor   Extensibility points
                        Conclusion


XML Configuration
  Cons
     Old school
     Error-prone

  Pros
     Ability to change without compilation




                       Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?    Why Castle Windsor?
                        Introduction   Configuration
                      Castle Windsor   Extensibility points
                         Conclusion


Fluent/Programmatic Configuration


  Cons
      Very hard, if not impossible, to change after compilation

  Pros
      Compile time checking
      Intellisense
      AllTypes Of
      Convention over Configuration



                        Tuna Toksoz    Castle Windsor
Agenda
                     Who am I?    Why Castle Windsor?
                   Introduction   Configuration
                 Castle Windsor   Extensibility points
                    Conclusion


Fluent/Programmatic Configuration - Cont’d




                   Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?    Why Castle Windsor?
                        Introduction   Configuration
                      Castle Windsor   Extensibility points
                         Conclusion


Boo/Binsor Configuration


      Compile/Runtime checking
      Intellisense (MonoDevelop)
      Easy to change after compilation of application
      Easier configuration with the help of Boo
      extensibility(macros)




                        Tuna Toksoz    Castle Windsor
Agenda
                           Who am I?    Why Castle Windsor?
                         Introduction   Configuration
                       Castle Windsor   Extensibility points
                          Conclusion


Extensibility points


       Facilities
       Events
       Dependency resolution control mechanisms
            Subdependency Resolver
            Handler Selector
            Interceptor Selector
       Lifestyle control mechanisms
       Object initialization control mechanisms



                         Tuna Toksoz    Castle Windsor
Agenda
                           Who am I?    Why Castle Windsor?
                         Introduction   Configuration
                       Castle Windsor   Extensibility points
                          Conclusion


Facilities




       MK/Windsor’s points of configurations
       A point where a group of related configuration
       (microkernel) tasks take place




                         Tuna Toksoz    Castle Windsor
Agenda
                             Who am I?    Why Castle Windsor?
                           Introduction   Configuration
                         Castle Windsor   Extensibility points
                            Conclusion


Available Facilities


       Active Record Integration
       Automatic Transaction Management
       Batch Registration - Obselete
       Event Wiring
       Factory Support
       Nhibernate Integration
       Synchronize
       WCF Facility



                           Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?    Why Castle Windsor?
                        Introduction   Configuration
                      Castle Windsor   Extensibility points
                         Conclusion


Eventler


      ComponentRegistered
      ComponentUnregistered
      ComponentModelCreated
      ComponentCreated
      ComponentDestroyed
      DependencyResolving
      and several others




                        Tuna Toksoz    Castle Windsor
Agenda
                      Who am I?    Why Castle Windsor?
                    Introduction   Configuration
                  Castle Windsor   Extensibility points
                     Conclusion


Eventler - Code




                    Tuna Toksoz    Castle Windsor
Agenda
                         Who am I?    Why Castle Windsor?
                       Introduction   Configuration
                     Castle Windsor   Extensibility points
                        Conclusion


Dependency resolution control mechanisms




     Subdependency Resolver
     Handler Selector
     Interceptor Selector




                        Tuna Toksoz   Castle Windsor
Agenda
                         Who am I?    Why Castle Windsor?
                       Introduction   Configuration
                     Castle Windsor   Extensibility points
                        Conclusion


Subdependency Resolver



     Tells how a specific dependency of a component should be
            ¯
     resolved
     We can either use an existing component or create a new
     one as the dependency
     Does not affect previously initialized components (MEF
     can do it)




                       Tuna Toksoz    Castle Windsor
Agenda
                    Who am I?    Why Castle Windsor?
                  Introduction   Configuration
                Castle Windsor   Extensibility points
                   Conclusion


Subdependency Resolver - Code




                  Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?    Why Castle Windsor?
                        Introduction   Configuration
                      Castle Windsor   Extensibility points
                         Conclusion


Subdependency Resolver - Code 2




  Spot the potential problem
              ¯
                        Tuna Toksoz    Castle Windsor
Agenda
                           Who am I?    Why Castle Windsor?
                         Introduction   Configuration
                       Castle Windsor   Extensibility points
                          Conclusion


Handler Selector




      Allows us to specify what to return as a result of
      .Resolve<T> calls depending on context
      Does not affect previously initialized components




                         Tuna Toksoz    Castle Windsor
Agenda
                      Who am I?    Why Castle Windsor?
                    Introduction   Configuration
                  Castle Windsor   Extensibility points
                     Conclusion


Handler Selector - Code




                    Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?    Why Castle Windsor?
                        Introduction   Configuration
                      Castle Windsor   Extensibility points
                         Conclusion


Interceptor Selector/Interceptor Model
Selector/IProxyGeneration Hook



      Allows us to change cross-cutting concerns at runtime
      We can specify what interceptors should be attached
      Allows us to specify what methods to intercept




                        Tuna Toksoz    Castle Windsor
Agenda
                           Who am I?    Why Castle Windsor?
                         Introduction   Configuration
                       Castle Windsor   Extensibility points
                          Conclusion


Lifestyle control mechanisms


   Decides when to create a component
              ¯
       Singleton
       PerThread
       PerWebRequest
       Transient
       Poolable
       Custom




                         Tuna Toksoz    Castle Windsor
Agenda
                        Who am I?    Why Castle Windsor?
                      Introduction   Configuration
                    Castle Windsor   Extensibility points
                       Conclusion


Available Lifestyles - Singleton




                      Tuna Toksoz    Castle Windsor
Agenda
                           Who am I?    Why Castle Windsor?
                         Introduction   Configuration
                       Castle Windsor   Extensibility points
                          Conclusion


Component initialization control mechanisms



   Contains the logic related to creation of components. They are
   called Activators in Castle terms.
       Default Activator (The place where dependency injection
       basically takes place)
       Accessor/Factory Activator (Used by Factory Support
       Facility)




                         Tuna Toksoz    Castle Windsor
Agenda
                      Who am I?    Why Castle Windsor?
                    Introduction   Configuration
                  Castle Windsor   Extensibility points
                     Conclusion


Component initialization control mechanisms -
Accessor Activator




                    Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?
                        Introduction
                      Castle Windsor
                         Conclusion


DI Advantages




     Reduced cost of change
     Increased testability
     Allows us to think in terms of component




                        Tuna Toksoz    Castle Windsor
Agenda
                         Who am I?
                       Introduction
                     Castle Windsor
                        Conclusion


Windsor




     A framework that is developed as a result of needs
     Easy integration with other frameworks
     Active development




                       Tuna Toksoz    Castle Windsor
Agenda
                          Who am I?
                        Introduction
                      Castle Windsor
                         Conclusion


Resources




     http://castleproject.org
     http://groups.google.com/group/castle-project-users/
     http://ayende.com




                         Tuna Toksoz   Castle Windsor

More Related Content

Recently uploaded

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Featured

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
 

Featured (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...
 

Castle Windsor

  • 1. Agenda Who am I? Introduction Castle Windsor Conclusion Castle Windsor Tuna Toksoz March 24, 2010 Tuna Toksoz Castle Windsor
  • 2. Agenda Who am I? Introduction Castle Windsor Conclusion Who am I? Introduction Dependency Injection Inversion of Control Container Castle Windsor Why Castle Windsor? Configuration Extensibility points Facilities Events Dependency resolution control mechanisms Lifestyle control mechanisms Component initialization control mechanisms Conclusion Tuna Toksoz Castle Windsor
  • 3. Agenda Who am I? Introduction Castle Windsor Conclusion Who am I? Senior student at Bogazici University (Passive) committer at Castle and NHibernate Blogger at his own blog and also on devlicio.us Has an interest in Robotics and its applications Tuna Toksoz Castle Windsor
  • 4. Agenda Who am I? Dependency Injection Introduction Inversion of Control Container Castle Windsor Conclusion What is DI all about? It is a pattern in Martin Fowler’s book Depends on the principle of providing dependencies from the outside Made up of 3 components Dependent Dependency Dependency provider Tuna Toksoz Castle Windsor
  • 5. Agenda Who am I? Dependency Injection Introduction Inversion of Control Container Castle Windsor Conclusion Why should we use DI? Loosely coupled components/services Increased testability Reduced cost of changes in later stages of development Ability to change implementations between testing and deployment Tuna Toksoz Castle Windsor
  • 6. Agenda Who am I? Dependency Injection Introduction Inversion of Control Container Castle Windsor Conclusion Why should not we use DI? ... Tuna Toksoz Castle Windsor
  • 7. Agenda Who am I? Dependency Injection Introduction Inversion of Control Container Castle Windsor Conclusion Dependency Injection Methods Constructor Injection Property Injection Method Injection Tuna Toksoz Castle Windsor
  • 8. Agenda Who am I? Dependency Injection Introduction Inversion of Control Container Castle Windsor Conclusion Dependency Injection Methods - Examples Constructor Injection Property Injection Method Injection Tuna Toksoz Castle Windsor
  • 9. Agenda Who am I? Dependency Injection Introduction Inversion of Control Container Castle Windsor Conclusion Inversion of Control Container A point where all components are registered and being accessed A component which resolves dependencies of a requested component automatically Enables us to change implementations without much trouble Tuna Toksoz Castle Windsor
  • 10. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Why Castle Windsor? A popular framework Active development 118 commits between October 2009 and February 2010. 2nd version Extensibility points Tuna Toksoz Castle Windsor
  • 11. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Castle Windsor Configuration XML Configuration Fluent Configuration Binsor/Boo Configuration Tuna Toksoz Castle Windsor
  • 12. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion XML Configuration Cons Old school Error-prone Pros Ability to change without compilation Tuna Toksoz Castle Windsor
  • 13. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Fluent/Programmatic Configuration Cons Very hard, if not impossible, to change after compilation Pros Compile time checking Intellisense AllTypes Of Convention over Configuration Tuna Toksoz Castle Windsor
  • 14. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Fluent/Programmatic Configuration - Cont’d Tuna Toksoz Castle Windsor
  • 15. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Boo/Binsor Configuration Compile/Runtime checking Intellisense (MonoDevelop) Easy to change after compilation of application Easier configuration with the help of Boo extensibility(macros) Tuna Toksoz Castle Windsor
  • 16. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Extensibility points Facilities Events Dependency resolution control mechanisms Subdependency Resolver Handler Selector Interceptor Selector Lifestyle control mechanisms Object initialization control mechanisms Tuna Toksoz Castle Windsor
  • 17. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Facilities MK/Windsor’s points of configurations A point where a group of related configuration (microkernel) tasks take place Tuna Toksoz Castle Windsor
  • 18. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Available Facilities Active Record Integration Automatic Transaction Management Batch Registration - Obselete Event Wiring Factory Support Nhibernate Integration Synchronize WCF Facility Tuna Toksoz Castle Windsor
  • 19. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Eventler ComponentRegistered ComponentUnregistered ComponentModelCreated ComponentCreated ComponentDestroyed DependencyResolving and several others Tuna Toksoz Castle Windsor
  • 20. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Eventler - Code Tuna Toksoz Castle Windsor
  • 21. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Dependency resolution control mechanisms Subdependency Resolver Handler Selector Interceptor Selector Tuna Toksoz Castle Windsor
  • 22. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Subdependency Resolver Tells how a specific dependency of a component should be ¯ resolved We can either use an existing component or create a new one as the dependency Does not affect previously initialized components (MEF can do it) Tuna Toksoz Castle Windsor
  • 23. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Subdependency Resolver - Code Tuna Toksoz Castle Windsor
  • 24. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Subdependency Resolver - Code 2 Spot the potential problem ¯ Tuna Toksoz Castle Windsor
  • 25. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Handler Selector Allows us to specify what to return as a result of .Resolve<T> calls depending on context Does not affect previously initialized components Tuna Toksoz Castle Windsor
  • 26. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Handler Selector - Code Tuna Toksoz Castle Windsor
  • 27. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Interceptor Selector/Interceptor Model Selector/IProxyGeneration Hook Allows us to change cross-cutting concerns at runtime We can specify what interceptors should be attached Allows us to specify what methods to intercept Tuna Toksoz Castle Windsor
  • 28. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Lifestyle control mechanisms Decides when to create a component ¯ Singleton PerThread PerWebRequest Transient Poolable Custom Tuna Toksoz Castle Windsor
  • 29. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Available Lifestyles - Singleton Tuna Toksoz Castle Windsor
  • 30. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Component initialization control mechanisms Contains the logic related to creation of components. They are called Activators in Castle terms. Default Activator (The place where dependency injection basically takes place) Accessor/Factory Activator (Used by Factory Support Facility) Tuna Toksoz Castle Windsor
  • 31. Agenda Who am I? Why Castle Windsor? Introduction Configuration Castle Windsor Extensibility points Conclusion Component initialization control mechanisms - Accessor Activator Tuna Toksoz Castle Windsor
  • 32. Agenda Who am I? Introduction Castle Windsor Conclusion DI Advantages Reduced cost of change Increased testability Allows us to think in terms of component Tuna Toksoz Castle Windsor
  • 33. Agenda Who am I? Introduction Castle Windsor Conclusion Windsor A framework that is developed as a result of needs Easy integration with other frameworks Active development Tuna Toksoz Castle Windsor
  • 34. Agenda Who am I? Introduction Castle Windsor Conclusion Resources http://castleproject.org http://groups.google.com/group/castle-project-users/ http://ayende.com Tuna Toksoz Castle Windsor