Page 1 of 1

OD hooks system implementation curiosity

Posted: Fri Jul 02, 2010 2:46 pm
by alkhaef
Just a curiosity question...

Events built into c# / .net could be seen as a possible alternative to the hooking approach taken, correct?

I'm sure you guys had good reasons for the choice, so I'm curious if you can elaborate on the advantages to the current approach.

Thanks and best regards,
Al

Re: OD hooks system implementation curiosity

Posted: Fri Jul 02, 2010 7:08 pm
by jordansparks
I don't understand. Feel free to propose some code that performs the same task. First review the exact problems that the hooks solve. Make sure your proposed solution actually solves those problems.

Re: OD hooks system implementation curiosity

Posted: Fri Jul 02, 2010 8:14 pm
by alkhaef
Dr. Sparks,

Thanks for the quick reply.

Actually, I wasn't proposing any changes. The hooks system as-written is quite elegant, and I'm excited to start using it. I was just curious about the thinking behind the implementation choice.

Anyway, since code for using c# events as hooks instead would be all over the place, I can't quickly/easily whip up code demonstrating what I mean for your review. Once my toolchain is setup, maybe I'll write and test the necessary code for providing just the one hook that I've requested using the events approach. I'm guessing the reasoning will jump out at me at that point ;), and that would be just a few lines total.

Best,
Al