Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's an event system, what you would use function pointers for in C. I think its clearer to be specific and call delegates 'an implementation of the observer design pattern', rather than a design pattern in itself. Other implementations include the class GoF way with subclassing, or typesafe callback abstractions like libsigc or boost::signals in C++. In dynamic languages you'd just store an array with strings of function names to call, or object/method name pairs of methods to call.


Well said. Observer is how I got my head around it also.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: