Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Event Driven Application

Event Driven Application

Presented by Prasetyo Wicaksono (@praswicaksono)

In this talk I want to present Event Driven Application by using mediator pattern. It would help decouple your code but beware there are some cons by using this pattern such as hard to track if your apps grown bigger.

PHP Conference Asia

September 23, 2015
Tweet

More Decks by PHP Conference Asia

Other Decks in Programming

Transcript

  1. Event Driven Application @phpconfasia

  2. BIO @phpconfasia Prasetyo Wicaksono  Head of IT Dept. at

    PT Zion Internasional Niaga  @malangphp organizer  Twitter : @praswicaksono  Github: https://github.com/Atriedes
  3. Event @phpconfasia  event is an action or occurrence recognized

    by software that may be handled by the software. Computer events can be generated or triggered by the system or by the user. Event can be defined as "a significant change in state“ – wikipedia
  4. Mediator Pattern @phpconfasia ATC Tower

  5. Architecture @phpconfasia Client

  6. Architecture @phpconfasia Client Event

  7. Architecture @phpconfasia Client Event Mediator

  8. Architecture @phpconfasia Client Event Mediator Listener Listener Listener

  9. Mediator Interface @phpconfasia

  10. Hook @phpconfasia  In computer programming, the term hooking covers

    a range of techniques used to alter or augment the behavior of an operating system, of applications, or of other software components by intercepting function calls or messages or events passed between software components. Code that handles such intercepted function calls, events or messages is called a "hook". - wikipedia
  11. Example @phpconfasia

  12. Prioritize Listener @phpconfasia Client Event Mediator 1 – Make sure

    title is upper case 2 - Uppercase Title 3 - Sanitize Body
  13. I can’t handle this @phpconfasia

  14. Notify Only ‘Hooks’ @phpconfasia  Don't change behavior  Only

    notify activity such as logging, sending email, updating cache
  15. Example @phpconfasia

  16. Notify Only ‘Hook’ + Background Process = @phpconfasia

  17. @phpconfasia “Most of all, experiment. Make mistakes. Talk about them.”

    Igor Wiedler
  18. Thanks @phpconfasia https://joind.in/15385 @praswicaksono