New answers tagged

-2

You can already do this with regular eventargs by placing the same event handler name in several button click properties and then converting sender to button to access it's properties. You can also already call a button click event from some arbitrary element by way of using a delegate so there again, not sure how this is better, it's just different is all I ...


0

This following analogy might help you to understand event driven I/O programming by drawing a parallel to waiting line at Doctor's Reception desk. Blocking I/O is like, if you are standing in the queue, receptionist asks a guy in front of you to fill in the form and she waits till he finishes. You have to wait for your turn till the guy finishes his form, ...


-1

My opinion: Services are the preferred way of sharing behaviour/data across modules/directives/controllers. Directives are isolated things that can be nested or not. Controllers should stick to being a viewmodel as much as they can, ideally no business logic should end up in there. So: When you start wiring them together by accessing parent scope ...


0

This is typically the responsability of an event bus or command bus. You would raise events from somewhere within your application and hand these off to a command bus. The bus then resolves the appropriate event handlers or command handlers for the event that was raised and hands the event off for processing. You can implement this in a number of different ...


1

Centralize the Side Effects The difficulty of reasoning about the correctness of event-driven systems for me, and of eventually running into that "series of unfortunate events", is the level of decentralization of code resulting from it combined with side effects. Ideally the code executed when an event triggered has hardly any risk of ever doing something ...



Top 50 recent answers are included