SlideShare a Scribd company logo
1 of 40
Download to read offline
AMIR BARYLKO
   DECOUPLING
    WITH THE
EVENT AGGREGATOR
WHO AM I?

  • Quality      Expert

  • Architect

  • Developer

  • Mentor

  • Great      cook

  • The     one who’s entertaining you for the next hour!
Amir Barylko - Event Aggregator                             MavenThought Inc.
RESOURCES

  • Email: amir@barylko.com

  • Twitter: @abarylko

  • Blog: http://www.orthocoders.com

  • Materials: http://www.orthocoders.com/presentations




Amir Barylko - Event Aggregator                       MavenThought Inc.
INTRO
                                       Coupling
                                       Cohesion
                                     Dependencies
                                  Dependency Injection
                                    IoC Containers


Amir Barylko - Event Aggregator                          MavenThought Inc.
COUPLING & COHESION




Amir Barylko - Event Aggregator   MavenThought Inc.
COUPLING
                                   (WIKIPEDIA)



  Degree to which
  each program module relies
  on each one
          of the other modules

Amir Barylko - Event Aggregator                  MavenThought Inc.
COUPLING II

  Is usually contrasted
                   with cohesion



Amir Barylko - Event Aggregator                 MavenThought Inc.
COUPLING III

  Invented by Larry Constantine,
  an original developer of
             Structured Design


Amir Barylko - Event Aggregator              MavenThought Inc.
COUPLING IV

  Low coupling is often a
  sign of a well-structured
  computer system and a
                    good design

Amir Barylko - Event Aggregator            MavenThought Inc.
COUPLING V

  When combined with
  high cohesion,
  supports high
                readability and
                maintainability
Amir Barylko - Event Aggregator                MavenThought Inc.
COHESION
                                   (WIKIPEDIA)



  measure of how
  strongly-related the
  functionality expressed by the
  source code of a
            software module is
Amir Barylko - Event Aggregator                  MavenThought Inc.
IS ALL ABOUT
                          DEPENDENCIES




Amir Barylko - Event Aggregator           MavenThought Inc.
HARDCODED
                          DEPENDENCIES
  public MovieLibrary()
  {
      this._storage = new LocalStorage();

        this._critic = new JaySherman();

        this._posterService = new IMDBPosterService();
  }



                              very hard to test
                               and maintain!

Amir Barylko - Event Aggregator                          MavenThought Inc.
EXTRACT INTERFACES
  private JaySherman _critic;

  private IMDBPosterService _posterService;

  private LocalStorage _storage;



  private IMovieCritic _critic;

  private IMoviePosterService _posterService;

  private IMovieStorage _storage;




Amir Barylko - Event Aggregator                 MavenThought Inc.
DEPENDENCY INJECTION
  public MovieLibrary(IMovieStorage storage,
                                  IMovieCritic critic,
                                  IMoviePosterService posterService)
  {
         this._storage = storage;
         this._critic = critic;
         this._posterService = posterService;
  }


                       Better for testing... but who
                        is going to initialize them?

Amir Barylko - Event Aggregator                                  MavenThought Inc.
INVERSION OF CONTROL




Amir Barylko - Event Aggregator   MavenThought Inc.
POOR’S MAN DI
  public MovieLibrary()
  {
         this._storage = new LocalStorage();

         this._critic = new JaySherman();

         this._posterService = new IMDBPosterService();

  }



                                  Still testeable...
                                    but smells!

Amir Barylko - Event Aggregator                           MavenThought Inc.
USING IOC CONTAINER
      Container.Register(
        Component
            .For<IMovieCritic>()
            .ImplementedBy<JaySherman>(),
        Component
            .For<IMoviePosterService>()
            .ImplementedBy<IMDBPosterService>(),
        Component
            .For<IMovieStorage>()
            .ImplementedBy<LocalStorage>());




Amir Barylko - Event Aggregator                    MavenThought Inc.
REFACTORING
                                    What’s wrong?
                                  Event Aggregator
                                       Demo
                              Desktop &Web applications



Amir Barylko - Event Aggregator                           MavenThought Inc.
WHAT’S WRONG?




Amir Barylko - Event Aggregator       MavenThought Inc.
TOO MANY DEPENDENCIES




Amir Barylko - Event Aggregator   MavenThought Inc.
LET’S THINK

  • Why the critic has to know the library (or
      viceversa)?

  • Or the poster service?
  • If I need more services, do I add more
      dependencies to the library?


Amir Barylko - Event Aggregator                 MavenThought Inc.
DECENTRALIZE

  • Identify boundaries
  • Identify clear responsibilities
  • Reduce complexity
  • Find notification mechanism

Amir Barylko - Event Aggregator          MavenThought Inc.
WHAT I’D LIKE


                                         Reviews


             Library              ????

                                            Posters



Amir Barylko - Event Aggregator                 MavenThought Inc.
EVENT AGGREGATOR




Amir Barylko - Event Aggregator   MavenThought Inc.
THE PATTERN

     Channel events
     from multiple
     objects into a
     single object to
     s i m p l i f y
     registration for
     clients
Amir Barylko - Event Aggregator            MavenThought Inc.
TRAITS

  • Based        on subject - observer
  • Centralize            event registration logic
  • No       need to track multiple objects
  • Level       of indirection


Amir Barylko - Event Aggregator                      MavenThought Inc.
IMPLEMENTATION




Amir Barylko - Event Aggregator        MavenThought Inc.
WHAT WE NEED

  •Register                   events
  •Raise              events
  •Subscribe                      to events

Amir Barylko - Event Aggregator               MavenThought Inc.
ATTEMPT #1




Amir Barylko - Event Aggregator                MavenThought Inc.
ATTEMPT #2




Amir Barylko - Event Aggregator                MavenThought Inc.
WHAT?
             NO CONCRETE EVENT?
  • How      can we get a concrete from an interface?

  • Castle     Dynamic Proxy!

  •I   have an interface and get a Proxy to a stub

  • All   properties are stubbed to be configured!




Amir Barylko - Event Aggregator                         MavenThought Inc.
RAISING AN EVENT




Amir Barylko - Event Aggregator        MavenThought Inc.
HOW TO USE IT

                   if( !everybody.Asleep() )
                   {
                       Demo();
                   }




Amir Barylko - Event Aggregator                MavenThought Inc.
WHAT’S NEXT?

  •When                a movie is added
     •Show              notification
     •Show              posters
     •Show              reviews
Amir Barylko - Event Aggregator           MavenThought Inc.
SUMMARY




Amir Barylko - Event Aggregator             MavenThought Inc.
TO FINALIZE

  • Why  EA reduces                     • How would it work with
     complexity?                         web applications?

  • What’s  the difference with         • What
                                             about
     Event Sourcing?                     WeakReferences?

  • So, wouldthat mean we are           • What about polymorphic
     doing CQRS?                         event handling?



Amir Barylko - Event Aggregator                            MavenThought Inc.
RESOURCES

  • Email: amir@barylko.com

  • Twitter: @abarylko

  • Slides    and code: http://bit.ly/orthoslides




Amir Barylko - Event Aggregator                     MavenThought Inc.
RESOURCES II

  •Coupling: http://bit.ly/yo5AK7

  •Event Aggregator: http://bit.ly/zL1LrG
  •MavenThought Commons: http://bit.ly/mt_commons
  • Bootstrapper:http://bit.ly/xHNiKB
  • Windsor Container:http://bit.ly/AmodqG
  • Castle Dynamic Proxy: http://bit.ly/wihfid

Amir Barylko - Event Aggregator                 MavenThought Inc.
SOFTWARE QUALITY
                    WORKSHOP
  • When: May            4, 10-11, 16-17

  • More      info: http://www.maventhought.com




Amir Barylko - Event Aggregator                   MavenThought Inc.

More Related Content

Similar to PRDCW-avent-aggregator

Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
Amir Barylko
 
Rich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; CoffeescriptRich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; Coffeescript
Amir Barylko
 
prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-world
Amir Barylko
 
Assetforce: Force.com Mobile Asset Management Platform
Assetforce: Force.com Mobile Asset Management PlatformAssetforce: Force.com Mobile Asset Management Platform
Assetforce: Force.com Mobile Asset Management Platform
Salesforce Developers
 
How Heroku uses Heroku to build Heroku
How Heroku uses Heroku to build HerokuHow Heroku uses Heroku to build Heroku
How Heroku uses Heroku to build Heroku
Craig Kerstiens
 

Similar to PRDCW-avent-aggregator (20)

Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integration
 
Rich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; CoffeescriptRich UI with Knockout.js &amp; Coffeescript
Rich UI with Knockout.js &amp; Coffeescript
 
Agile planning
Agile planningAgile planning
Agile planning
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Codemash-advanced-ioc-castle-windsor
Codemash-advanced-ioc-castle-windsorCodemash-advanced-ioc-castle-windsor
Codemash-advanced-ioc-castle-windsor
 
ioc-castle-windsor
ioc-castle-windsorioc-castle-windsor
ioc-castle-windsor
 
YEG-UG-Capybara
YEG-UG-CapybaraYEG-UG-Capybara
YEG-UG-Capybara
 
Page-objects-pattern
Page-objects-patternPage-objects-pattern
Page-objects-pattern
 
prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-world
 
2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven
 
Cloud Computing in the Enterprise
Cloud Computing in the EnterpriseCloud Computing in the Enterprise
Cloud Computing in the Enterprise
 
PRDC11-tdd-common-mistakes
PRDC11-tdd-common-mistakesPRDC11-tdd-common-mistakes
PRDC11-tdd-common-mistakes
 
20160221 va interconnect_pub
20160221 va interconnect_pub20160221 va interconnect_pub
20160221 va interconnect_pub
 
Startupfest 2012 - Coefficients of friction
Startupfest 2012 - Coefficients of frictionStartupfest 2012 - Coefficients of friction
Startupfest 2012 - Coefficients of friction
 
Breaking News and Breaking Software by Andy Hume
Breaking News and Breaking Software by Andy HumeBreaking News and Breaking Software by Andy Hume
Breaking News and Breaking Software by Andy Hume
 
Assetforce: Force.com Mobile Asset Management Platform
Assetforce: Force.com Mobile Asset Management PlatformAssetforce: Force.com Mobile Asset Management Platform
Assetforce: Force.com Mobile Asset Management Platform
 
A Quick Guide To Mining Bitcoin
A Quick Guide To Mining BitcoinA Quick Guide To Mining Bitcoin
A Quick Guide To Mining Bitcoin
 
Using Security To Build With Confidence - Session Sponsored by Trend Micro
Using Security To Build With Confidence - Session Sponsored by Trend MicroUsing Security To Build With Confidence - Session Sponsored by Trend Micro
Using Security To Build With Confidence - Session Sponsored by Trend Micro
 
Using Security To Build
 With Confidence In AWS - Trend Micro
Using Security To Build
 With Confidence In AWS - Trend MicroUsing Security To Build
 With Confidence In AWS - Trend Micro
Using Security To Build
 With Confidence In AWS - Trend Micro
 
How Heroku uses Heroku to build Heroku
How Heroku uses Heroku to build HerokuHow Heroku uses Heroku to build Heroku
How Heroku uses Heroku to build Heroku
 

More from Amir Barylko

Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
Amir Barylko
 

More from Amir Barylko (20)

Functional converter project
Functional converter projectFunctional converter project
Functional converter project
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web development
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
No estimates
No estimatesNo estimates
No estimates
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep dive
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting training
 
There's no charge for (functional) awesomeness
There's no charge for (functional) awesomenessThere's no charge for (functional) awesomeness
There's no charge for (functional) awesomeness
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6
 
Productive teams
Productive teamsProductive teams
Productive teams
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
From coach to owner - What I learned from the other side
From coach to owner - What I learned from the other sideFrom coach to owner - What I learned from the other side
From coach to owner - What I learned from the other side
 
Communication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivityCommunication is the Key to Teamwork and productivity
Communication is the Key to Teamwork and productivity
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Refactoring
RefactoringRefactoring
Refactoring
 
Agile requirements
Agile requirementsAgile requirements
Agile requirements
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilities
 
Refactoring
RefactoringRefactoring
Refactoring
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescript
 
Sass & bootstrap
Sass & bootstrapSass & bootstrap
Sass & bootstrap
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescript
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
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
vu2urc
 

Recently uploaded (20)

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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

PRDCW-avent-aggregator

  • 1. AMIR BARYLKO DECOUPLING WITH THE EVENT AGGREGATOR
  • 2. WHO AM I? • Quality Expert • Architect • Developer • Mentor • Great cook • The one who’s entertaining you for the next hour! Amir Barylko - Event Aggregator MavenThought Inc.
  • 3. RESOURCES • Email: amir@barylko.com • Twitter: @abarylko • Blog: http://www.orthocoders.com • Materials: http://www.orthocoders.com/presentations Amir Barylko - Event Aggregator MavenThought Inc.
  • 4. INTRO Coupling Cohesion Dependencies Dependency Injection IoC Containers Amir Barylko - Event Aggregator MavenThought Inc.
  • 5. COUPLING & COHESION Amir Barylko - Event Aggregator MavenThought Inc.
  • 6. COUPLING (WIKIPEDIA) Degree to which each program module relies on each one of the other modules Amir Barylko - Event Aggregator MavenThought Inc.
  • 7. COUPLING II Is usually contrasted with cohesion Amir Barylko - Event Aggregator MavenThought Inc.
  • 8. COUPLING III Invented by Larry Constantine, an original developer of Structured Design Amir Barylko - Event Aggregator MavenThought Inc.
  • 9. COUPLING IV Low coupling is often a sign of a well-structured computer system and a good design Amir Barylko - Event Aggregator MavenThought Inc.
  • 10. COUPLING V When combined with high cohesion, supports high readability and maintainability Amir Barylko - Event Aggregator MavenThought Inc.
  • 11. COHESION (WIKIPEDIA) measure of how strongly-related the functionality expressed by the source code of a software module is Amir Barylko - Event Aggregator MavenThought Inc.
  • 12. IS ALL ABOUT DEPENDENCIES Amir Barylko - Event Aggregator MavenThought Inc.
  • 13. HARDCODED DEPENDENCIES public MovieLibrary() { this._storage = new LocalStorage(); this._critic = new JaySherman(); this._posterService = new IMDBPosterService(); } very hard to test and maintain! Amir Barylko - Event Aggregator MavenThought Inc.
  • 14. EXTRACT INTERFACES private JaySherman _critic; private IMDBPosterService _posterService; private LocalStorage _storage; private IMovieCritic _critic; private IMoviePosterService _posterService; private IMovieStorage _storage; Amir Barylko - Event Aggregator MavenThought Inc.
  • 15. DEPENDENCY INJECTION public MovieLibrary(IMovieStorage storage, IMovieCritic critic, IMoviePosterService posterService) { this._storage = storage; this._critic = critic; this._posterService = posterService; } Better for testing... but who is going to initialize them? Amir Barylko - Event Aggregator MavenThought Inc.
  • 16. INVERSION OF CONTROL Amir Barylko - Event Aggregator MavenThought Inc.
  • 17. POOR’S MAN DI public MovieLibrary() { this._storage = new LocalStorage(); this._critic = new JaySherman(); this._posterService = new IMDBPosterService(); } Still testeable... but smells! Amir Barylko - Event Aggregator MavenThought Inc.
  • 18. USING IOC CONTAINER Container.Register( Component .For<IMovieCritic>() .ImplementedBy<JaySherman>(), Component .For<IMoviePosterService>() .ImplementedBy<IMDBPosterService>(), Component .For<IMovieStorage>() .ImplementedBy<LocalStorage>()); Amir Barylko - Event Aggregator MavenThought Inc.
  • 19. REFACTORING What’s wrong? Event Aggregator Demo Desktop &Web applications Amir Barylko - Event Aggregator MavenThought Inc.
  • 20. WHAT’S WRONG? Amir Barylko - Event Aggregator MavenThought Inc.
  • 21. TOO MANY DEPENDENCIES Amir Barylko - Event Aggregator MavenThought Inc.
  • 22. LET’S THINK • Why the critic has to know the library (or viceversa)? • Or the poster service? • If I need more services, do I add more dependencies to the library? Amir Barylko - Event Aggregator MavenThought Inc.
  • 23. DECENTRALIZE • Identify boundaries • Identify clear responsibilities • Reduce complexity • Find notification mechanism Amir Barylko - Event Aggregator MavenThought Inc.
  • 24. WHAT I’D LIKE Reviews Library ???? Posters Amir Barylko - Event Aggregator MavenThought Inc.
  • 25. EVENT AGGREGATOR Amir Barylko - Event Aggregator MavenThought Inc.
  • 26. THE PATTERN Channel events from multiple objects into a single object to s i m p l i f y registration for clients Amir Barylko - Event Aggregator MavenThought Inc.
  • 27. TRAITS • Based on subject - observer • Centralize event registration logic • No need to track multiple objects • Level of indirection Amir Barylko - Event Aggregator MavenThought Inc.
  • 28. IMPLEMENTATION Amir Barylko - Event Aggregator MavenThought Inc.
  • 29. WHAT WE NEED •Register events •Raise events •Subscribe to events Amir Barylko - Event Aggregator MavenThought Inc.
  • 30. ATTEMPT #1 Amir Barylko - Event Aggregator MavenThought Inc.
  • 31. ATTEMPT #2 Amir Barylko - Event Aggregator MavenThought Inc.
  • 32. WHAT? NO CONCRETE EVENT? • How can we get a concrete from an interface? • Castle Dynamic Proxy! •I have an interface and get a Proxy to a stub • All properties are stubbed to be configured! Amir Barylko - Event Aggregator MavenThought Inc.
  • 33. RAISING AN EVENT Amir Barylko - Event Aggregator MavenThought Inc.
  • 34. HOW TO USE IT if( !everybody.Asleep() ) { Demo(); } Amir Barylko - Event Aggregator MavenThought Inc.
  • 35. WHAT’S NEXT? •When a movie is added •Show notification •Show posters •Show reviews Amir Barylko - Event Aggregator MavenThought Inc.
  • 36. SUMMARY Amir Barylko - Event Aggregator MavenThought Inc.
  • 37. TO FINALIZE • Why EA reduces • How would it work with complexity? web applications? • What’s the difference with • What about Event Sourcing? WeakReferences? • So, wouldthat mean we are • What about polymorphic doing CQRS? event handling? Amir Barylko - Event Aggregator MavenThought Inc.
  • 38. RESOURCES • Email: amir@barylko.com • Twitter: @abarylko • Slides and code: http://bit.ly/orthoslides Amir Barylko - Event Aggregator MavenThought Inc.
  • 39. RESOURCES II •Coupling: http://bit.ly/yo5AK7 •Event Aggregator: http://bit.ly/zL1LrG •MavenThought Commons: http://bit.ly/mt_commons • Bootstrapper:http://bit.ly/xHNiKB • Windsor Container:http://bit.ly/AmodqG • Castle Dynamic Proxy: http://bit.ly/wihfid Amir Barylko - Event Aggregator MavenThought Inc.
  • 40. SOFTWARE QUALITY WORKSHOP • When: May 4, 10-11, 16-17 • More info: http://www.maventhought.com Amir Barylko - Event Aggregator MavenThought Inc.