John Beppu wrote:

> I read through http://dojotoolkit.org/docs/dojo_event_system.html and 
> they provide a lot.  I like my API a lot better, but that kind of 
> thing is a matter of taste.  (I'm sure they would like their own API a 
> lot better than they like mine.)  I'll definitely have to download 
> their source for further study, though.  (I've been ignoring dojo for 
> the most part, because Prototype and jQuery suit me more.)
>
I cant actually disagree with you there (though I'm working with dojo 
daily). event.connect is so overloaded I find it impossible to remember 
what arguments go where and when. I may even make a wrapper for 
event.connect to provide myself a more mnemonic api like what you've got 
going on. You can only ignore it for so long though. I suffered 
grass-is-greener syndrome for months while we built a widget system, 
de-coupled event system, and other basics with Prototype/Scriptaculous. 
The next project I swung all the way over to Dojo. Now, I'm settling in 
the middle and trying to keep abreast of all them as much as I can, to 
pick and choose the best ideas and tools for the job.

> One thing that I like is that they can disconnect() whatever they 
> attach with dojo.event.connect().  With actsAsAspect(), disconnection 
> is impossible due to the way I'm using closures.  However, if I were 
> to go back to my old way of keeping track of before and after 
> functions in arrays, disconnection would become possible again.  I'm 
> not sure if I want to go there, yet, though.

I would suspect that the ability to disconnect would become important if 
you did a lot of unloading and replacing DOM branches with events bound 
to elements within them. Could get leaky otherwise, though that's just a 
hunch.

> We'll see what happens.  If there's a genuine need for extra 
> functionality, changes will be made.  And even though I jokingly 
> called this an "arms race", I don't really want to try to try to match 
> some library feature-for-feature just for the sake of being the most 
> powerful, because the last thing I want is for actsAsAspect() to be 
> bloated.  I've got a lot to learn about AOP as well, so my current 
> judgement on the matter is not as good as it could be.

Are you writing a library or scratching your own itch? I've found 
occassional use for the aspect-like features of dojo.event.connect. 
Mostly its a useful get-out, when you need a quick way to boostrap some 
last minute extras - like profiling and troubleshooting code, or 
auxilary code like a throbber or something that responds to events in 
the UI - without the fore-planning necessary to use a solution like 
event topics/pub-sub. I understand there's a methodology and philosophy 
that makes that kind of thing more central. It can stand in line behind 
the 100 other things I've got to learn this year :)

Sam


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to