Overview
Features
Download
Documentation
Community
Add-Ons & Services

Declaring BasicEvent objects statically?

Please post support and help requests here.

Declaring BasicEvent objects statically?

Postby francisr » 17 Apr 2008, 17:56

I wonder if there is anything against declaring BasicEvent objects using static? It seems to make more sense to do so because then the client that wants to register a delegate would only require a type instead of needing an object. Also the sending object can still be easily identified because of the sender parameter.

Any thoughts?

Francis
francisr
 
Posts: 21
Joined: 09 Dec 2007, 13:19

Re: Declaring BasicEvent objects statically?

Postby peter » 21 Apr 2008, 09:25

> I wonder if there is anything against declaring BasicEvent objects using static? It seems to make more sense to do so because then the client that wants to register a delegate would only require a type instead of needing an object. Also the sending object can still be easily identified because of the sender parameter.
>
> Any thoughts?

Hm,
Events will work when declared as static (there are no dependencies to other static vars, so no static initialization problems). Performance wise it should be the same, maybe slightly slower when many notifies occur but in the end you need to collect all these events somewhere so this shouldn't be a problem.

br

Peter

>
> Francis
peter
 
Posts: 67
Joined: 11 Jul 2006, 16:26
Location: Austria


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron