Linked by Eugenia Loli on Sun 22nd Apr 2007 07:43 UTC
.NET (dotGNU too) All too often, source code spends a lot of time on basic housekeeping, monitoring the state of many objects. This is wasteful, and with C# it is unnecessary. Software expert Stephen Morris shows how C# provides a range of callback mechanisms that obviate the need for polling objects for state information.
Permalink for comment 232957
To read all comments associated with this story, please click here.
RE[2]: It is a shame
by jayson.knight on Sun 22nd Apr 2007 18:43 UTC in reply to "RE: It is a shame"
Member since:

"I thought this is why we used the delegate event model, or the event subscriber model, so that we didn't have to monitor all this stuff?"

You are absolutely 100% correct. I have no idea why the author went through all the pains of setting up all the callbacks/polling/whatever you want to call it, by hand in this example when delegates (Name EventHandler delegates) would have more than sufficed, as well as made the code much more readable, and smaller.

It's almost like he went out of his way to do it the Java way ;-).

Reply Parent Score: 3