Comments on: Creating Component Communication Pipelines with YUI (Decoupling) http://yuiblog.com/blog/2008/04/22/caridy-decoupling/ News and Artilces about Designing and Developing with Yahoo! Libraries. Sun, 27 Jul 2008 00:18:26 +0000 http://wordpress.org/?v=2.3.3 By: Caridy Patino http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-358438 Caridy Patino Thu, 24 Apr 2008 16:53:22 +0000 http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-358438 @Topper: I have been fallowing your work with prototype. Good Job :-) @Jonah: Try out the Bubbling Library, you won't regret it. @Tom: Precisely, this is the beauty of this model. There is not need to define an event to subscribe a listener, you only need the event/message identifier (an string), and in the other hand the components can fire/broadcast a message to reach all the listeners with the same identifier. The components don't need to know if there is a listener or not, and the listener don't care about the sender/emitter. The current implementation of the Bubbling Core is JSLint friendly, and there is not way to access the the list of listeners, or senders, and from my point of view, I think it's not necessary. If you have a situation where you need to know the event names and counts, share it with us, to see how can be implemented using the decoupling model. @Topper: I have been fallowing your work with prototype. Good Job :-)

@Jonah: Try out the Bubbling Library, you won’t regret it.

@Tom: Precisely, this is the beauty of this model. There is not need to define an event to subscribe a listener, you only need the event/message identifier (an string), and in the other hand the components can fire/broadcast a message to reach all the listeners with the same identifier. The components don’t need to know if there is a listener or not, and the listener don’t care about the sender/emitter. The current implementation of the Bubbling Core is JSLint friendly, and there is not way to access the the list of listeners, or senders, and from my point of view, I think it’s not necessary. If you have a situation where you need to know the event names and counts, share it with us, to see how can be implemented using the decoupling model.

]]>
By: Tom Davis http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-358316 Tom Davis Thu, 24 Apr 2008 14:46:40 +0000 http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-358316 One potential problem I forsee with the string as event identifier for an event which may not have been created prior to the subscription is of course typo = lost event. Tools like jslint wouldn't be useful for discovering such bugs. I was just thinking of ways to handle this, and my immediate thoughts were using macros and an external macro expansion tool to maintain the strings, or creating a simple tool to find Bubbling.on and Bubbling.fire and list the discovered event names and counts. Do you recommend particular solutions? One potential problem I forsee with the string as event identifier for an event which may not have been created prior to the subscription is of course typo = lost event. Tools like jslint wouldn’t be useful for discovering such bugs.

I was just thinking of ways to handle this, and my immediate thoughts were using macros and an external macro expansion tool to maintain the strings, or creating a simple tool to find Bubbling.on and Bubbling.fire and list the discovered event names and counts.

Do you recommend particular solutions?

]]>
By: Jonah Dempcy http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-357751 Jonah Dempcy Thu, 24 Apr 2008 00:51:15 +0000 http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-357751 I worked on a 5-person development team for an e-commerce site built with Prototype and we used a similar design. A given search results or detail page might have as many as 10 distinct components, each one needing to respond to events to update the page when the user has clicked various controls or new Ajax data has returned. So, by using a subscription model where events are published and any components needing to subscribe can do so allowed us to develop pieces separately and to easily integrate them with the whole page. In all, the source code for the site exceeded 10,000 lines of JS (which is not a good thing!), but even with this complexity we were able to keep each widget decoupled and have clearly defined interfaces and data contracts. I'm curious to experiment with YUI more and when I do, I'll definitely check out the BubblingLibrary. I worked on a 5-person development team for an e-commerce site built with Prototype and we used a similar design.

A given search results or detail page might have as many as 10 distinct components, each one needing to respond to events to update the page when the user has clicked various controls or new Ajax data has returned. So, by using a subscription model where events are published and any components needing to subscribe can do so allowed us to develop pieces separately and to easily integrate them with the whole page.

In all, the source code for the site exceeded 10,000 lines of JS (which is not a good thing!), but even with this complexity we were able to keep each widget decoupled and have clearly defined interfaces and data contracts.

I’m curious to experiment with YUI more and when I do, I’ll definitely check out the BubblingLibrary.

]]>
By: Организация взаимодействия между компонентами в YUI | АяксЛайн.ру http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-357667 Организация взаимодействия между компонентами в YUI | АяксЛайн.ру Wed, 23 Apr 2008 22:15:50 +0000 http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-357667 [...] YUI blog. Категория: YUIАвтор: Spider Дата: 23 Апрель 2008 Время: 22:14 [...] […] YUI blog. Категория: YUIАвтор: Spider Дата: 23 Апрель 2008 Время: 22:14 […]

]]>
By: Marcus Westin http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-357455 Marcus Westin Wed, 23 Apr 2008 18:01:25 +0000 http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-357455 Hey Caridy, Definitely a great pattern for complex javascript UI's, and thoroughly described. Thanks for the good work! Hey Caridy,

Definitely a great pattern for complex javascript UI’s, and thoroughly described. Thanks for the good work!

]]>
By: Custom JavaScript events using the Motionbox EventHandler at Topper’s Blog http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-356576 Custom JavaScript events using the Motionbox EventHandler at Topper’s Blog Tue, 22 Apr 2008 21:26:19 +0000 http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-356576 [...] YUIBlog has a very nice writeup on using custom events to build components. [...] […] YUIBlog has a very nice writeup on using custom events to build components. […]

]]>
By: Topper Bowers http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-356564 Topper Bowers Tue, 22 Apr 2008 21:10:54 +0000 http://yuiblog.com/blog/2008/04/22/caridy-decoupling/#comment-356564 As always this is an excellent article. We "borrow" a lot of our ideas from YUI. If you're using Prototype: The Motionbox EventHandler http://code.google.com/p/motionbox/wiki/EventHandlerDocumentation Will let you add a payload to custom events as well. Developing in this style really does free up a lot of headaches and makes multi-developer (and multi-component) javascript a lot clearer. As always this is an excellent article. We “borrow” a lot of our ideas from YUI. If you’re using Prototype: The Motionbox EventHandler http://code.google.com/p/motionbox/wiki/EventHandlerDocumentation

Will let you add a payload to custom events as well.

Developing in this style really does free up a lot of headaches and makes multi-developer (and multi-component) javascript a lot clearer.

]]>