Autowiring components to a message bus in Javascript

When writing AJAX and SOFEA/SOUI applications, it’s a best practice to use a client side message bus to integrate UI components. People recognized this as a best practice lately for GUI development with Swing. As a sidenote Werx was excellent for this but sadly is dead.

One of the ways to do message buses in Javascript is the OpenAjax Hub implementation or TIBCO PageBus.

Subscribing to messages on the bus is easy with the subscribe method:

When you have lots of those subscriptions though, they clutter up your code. Werx had the nice idea to autowire methods to messages and use the methods as message handlers. I thought I should do the same for Javascript and OpenAjax Hub.

Some magic happens in the connect method.

The same could be achieved with a map of message handlers which is easy with functions in Javascript whereas in Java it takes more boiler code. A solution with methods as messages handlers as seen above has the benefit though that the object can contain other helper methods and state, which a map of message handlers can not. Using autowired methods makes your message bus code cleaner and more readable.

Thanks for listening.

185 thoughts on “Autowiring components to a message bus in Javascript”

  1. Pingback: ????? ??
  2. Pingback: de nature herbal
  3. Pingback: de nature semarang
  4. Pingback: obat kutil kelamin
  5. Pingback: Motogolf
  6. Pingback: Obat Sipilis
  7. Pingback: obat kanker
  8. Pingback: raja
  9. Pingback: fightinjustice
  10. Pingback: cara
  11. Pingback: economics tuition
  12. Pingback: tumbuh
  13. Pingback: Obat Kencing Panas
  14. Pingback: cara
  15. Pingback: nanah
  16. Pingback: virus
  17. Pingback: de nature
  18. Pingback: My Drone View
  19. Pingback: Obat Kencing Nanah
  20. Pingback: Gonore Pada Pria
  21. Pingback: Kutil di Anus
  22. Pingback: Obat Untuk Gonore
  23. Pingback: Obat Herbal Eksim
  24. Pingback: Obat Eksim
  25. Pingback: Obat Kutil Kelamin
  26. Pingback: gonore
  27. Pingback: obat
  28. Pingback: Obat Sipilis Alami
  29. Pingback: obat sipilis alami
  30. Pingback: faktor sipilis
  31. Pingback: obat kencing nanah
  32. Pingback: obat sipilis ampuh
  33. Pingback: obat wasir natural

Comments are closed.