[dojo-contributors] Watchables, data bindings, and get/set

Kris Zyp kzyp at dojotoolkit.org
Mon Mar 8 09:04:04 EST 2010



On 3/8/2010 2:17 AM, Mark Wubben wrote:
> I've been thinking along similar lines for the past week or so, this is definitely something I'd love to pick up.
>
> To give a quick overview of where my thinking was headed:
>
> * We have an API layer that returns JSON objects that are rendered through the DTL
> * The API layer can notice when objects change, and update properties where applicable
> * The widgets would subscribe to these changes and update the rendering, along the lines I guess of DomTemplated but I'm not very familiar with that variant of the DTL
>   
Yes, that is exactly what I want to enable.
> * My approach would be somewhat lower level, making sure `object.toString()` would return a unique topic (for that object) I could `dojo.subscribe` to for changes.
>   

What would be the advantage of this approach? I'd really like to avoid
having to create a unique identifier for each object. Also, overriding
toString() could conflict with objects that override toString() for
other purposes. And, I don't think dojo.subscribe's pubsub system should
be conflated with state change monitoring, the semantics are different
enough that it just adds complexity trying to stuff state change
monitoring into a pubsub box.

Thanks,
Kris



More information about the dojo-contributors mailing list