vis781
Well-known member
Ok, so i'm just chucking this out there because i'm interested in peoples opinions on this one... Why is it that when ever i see app being built or ,my favorite field, controls being developed i very rarely see these programs using internal events. For example....
ClassA has a sub called 'DoSomeWork'
Why is it that more often than not, i see instances passed into say ClassB via a property or in the constructor then ClassA's 'DoSomeWorkSub' Is called like this....
'InstanceOfClassA.DoSomeWork'
That is to say nothing of having to check if it is nothing prior to calling the sub. I mean wouldn't it be better in FormB to raise an internal event that ClassA catches and that runs the 'DoSomeWork' sub in ClassA, no checking if things are nothing and ClassB has done it's part and couldn't care less what happens after. Am i the only one who sees this or is this common place. Going on the principle that vb.net is event driven is this not the preferred way to go? Or is it that declaring something using the WithEvents keyword incurrs a lot of overhead.
As I say, i'm just asking the question, as i've seen both approaches however the former seems to be the method most adopted. I welcome your comments...
ClassA has a sub called 'DoSomeWork'
Why is it that more often than not, i see instances passed into say ClassB via a property or in the constructor then ClassA's 'DoSomeWorkSub' Is called like this....
'InstanceOfClassA.DoSomeWork'
That is to say nothing of having to check if it is nothing prior to calling the sub. I mean wouldn't it be better in FormB to raise an internal event that ClassA catches and that runs the 'DoSomeWork' sub in ClassA, no checking if things are nothing and ClassB has done it's part and couldn't care less what happens after. Am i the only one who sees this or is this common place. Going on the principle that vb.net is event driven is this not the preferred way to go? Or is it that declaring something using the WithEvents keyword incurrs a lot of overhead.
As I say, i'm just asking the question, as i've seen both approaches however the former seems to be the method most adopted. I welcome your comments...
Last edited: