How would you implement this in D? (signals & slots)

Atila Neves via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 2 12:45:49 PST 2016


On Tuesday, 2 February 2016 at 17:35:25 UTC, Chris Wright wrote:
> On Tue, 02 Feb 2016 15:59:06 +0000, Atila Neves wrote:
>> [...]
>
> I've seen this sort of thing before. A blogger I used to 
> follow, Jeremy Miller, implemented an event broker using this 
> pattern. I don't like it. It requires a new type for each 
> event, and you have to defensively use that pattern even if you 
> only have one event at the moment. Every time I implemented an 
> event system, I've gone with named events and no special type 
> for their parameters.
>
> [...]

Nice. I liked your example and Kagamin's better than mine.

Atila


More information about the Digitalmars-d-learn mailing list