SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler 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.

Mais conteúdo relacionado

Semelhante a PRDCW-avent-aggregator

Cpl12 continuous integration
Cpl12 continuous integrationCpl12 continuous integration
Cpl12 continuous integrationAmir 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; CoffeescriptAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
Codemash-advanced-ioc-castle-windsor
Codemash-advanced-ioc-castle-windsorCodemash-advanced-ioc-castle-windsor
Codemash-advanced-ioc-castle-windsorAmir Barylko
 
ioc-castle-windsor
ioc-castle-windsorioc-castle-windsor
ioc-castle-windsorAmir Barylko
 
Page-objects-pattern
Page-objects-patternPage-objects-pattern
Page-objects-patternAmir Barylko
 
prdc10-Bdd-real-world
prdc10-Bdd-real-worldprdc10-Bdd-real-world
prdc10-Bdd-real-worldAmir Barylko
 
2012 regina TC - 103 quality driven
2012 regina TC - 103 quality driven2012 regina TC - 103 quality driven
2012 regina TC - 103 quality drivenAmir Barylko
 
PRDC11-tdd-common-mistakes
PRDC11-tdd-common-mistakesPRDC11-tdd-common-mistakes
PRDC11-tdd-common-mistakesAmir Barylko
 
20160221 va interconnect_pub
20160221 va interconnect_pub20160221 va interconnect_pub
20160221 va interconnect_pubCanturk Isci
 
Startupfest 2012 - Coefficients of friction
Startupfest 2012 - Coefficients of frictionStartupfest 2012 - Coefficients of friction
Startupfest 2012 - Coefficients of frictionStartupfest
 
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 HumeSyncConf
 
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 PlatformSalesforce Developers
 
A Quick Guide To Mining Bitcoin
A Quick Guide To Mining BitcoinA Quick Guide To Mining Bitcoin
A Quick Guide To Mining BitcoinBitcoinMining4
 
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 MicroAmazon Web Services
 
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 MicroAmazon Web Services
 
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 HerokuCraig Kerstiens
 

Semelhante a 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
 

Mais de Amir Barylko

Functional converter project
Functional converter projectFunctional converter project
Functional converter projectAmir Barylko
 
Elm: delightful web development
Elm: delightful web developmentElm: delightful web development
Elm: delightful web developmentAmir Barylko
 
User stories deep dive
User stories deep diveUser stories deep dive
User stories deep diveAmir Barylko
 
Coderetreat hosting training
Coderetreat hosting trainingCoderetreat hosting training
Coderetreat hosting trainingAmir Barylko
 
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) awesomenessAmir Barylko
 
What's new in c# 6
What's new in c# 6What's new in c# 6
What's new in c# 6Amir Barylko
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?Amir Barylko
 
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 sideAmir Barylko
 
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 productivityAmir Barylko
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentAmir Barylko
 
Agile requirements
Agile requirementsAgile requirements
Agile requirementsAmir Barylko
 
Agile teams and responsibilities
Agile teams and responsibilitiesAgile teams and responsibilities
Agile teams and responsibilitiesAmir Barylko
 
Beutiful javascript with coffeescript
Beutiful javascript with coffeescriptBeutiful javascript with coffeescript
Beutiful javascript with coffeescriptAmir Barylko
 
SDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptSDEC12 Beautiful javascript with coffeescript
SDEC12 Beautiful javascript with coffeescriptAmir Barylko
 

Mais de 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
 

Último

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
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 Takeoffsammart93
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

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.