[Arp] Central dispatcher

Aral Balkan aral at ariaware.com
Wed Apr 20 08:32:06 PDT 2005


Hi 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.

Yes, I have no problems with this. We can easily modify the 
ControllerTemplate to pass the entire event and then use event.target in 
the command. In fact, the CommandTemplate (which I am still not sure has 
enough functionality to warrant its existence) could easily store a 
reference to the target, thereby allowing backwards compatibility.

> 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). 

My comment was more in response to having a separate EventManager-type 
singleton used to publish/subscribe to events.

All the best,
Aral



More information about the Arp mailing list