[Arp] Central dispatcher
Darron J. Schall
darron at darronschall.com
Wed Apr 20 08:27:57 PDT 2005
Aral Balkan wrote:
> Thinking about it... if the Controller, instead of passing a viewRef,
> just passed the Command a reference to the event object, it would
> probably make the system more flexible. Is this what you're doing Darron?
Yes, sorry.. I haven't been following this thread closely (it's long and
I missed the beginning of it, and I have to get something done before 2
today). The controller passes the entire event to the command, and lets
the command figure out what to do with it. This way, I get the view
that generated the event (event.target), and I also get all of the
necessary data that the command needs (event.data).. for instance, I
would pass a VO as event.data, because the "SavePerson" event *needs*
the VO, because the VO describes what needs to be saved.
> This still wouldn't make events independent, though...
Why not? It would probably be better, instead of just using one main
Event and stuffing different things into event.data, to create
subclasses of events. This is what's done in C#. So, instead of new
Event("SavePerson") I would have new SavePersonEvent(target,
the_person_data_to_save).
I might be confused just from not paying attention to the tread though.
If this doesn't make sense, just ignore me.. kinda swamped today.
-d
More information about the Arp
mailing list