[Estimated Reading Time: < 1 minute]
My second post on multicast events is now up, and here’s a video showing the basics.
It was also an excuse to get to grips with the video capturing software – CamStudio – (and technique!), which proved to be a frustrating exercise to say the least, but I am quite pleased with the eventual results and plan to do more in the future.
Very nicely done … enjoyed it.
Very nice and useful ..
Coming from Java & co (with all the listeners concepts) … I also considered to create a small framework to “enable” in the form of a dispatcher the support for multicast events but in a form more friendly similar to how the Delphi.NET works (without add & remove special event markings)…. by using Include(OnXXX, delegateXXX)/Exclude(OnXXX, delegateXXX) support for “regular” events…
So in “theory” it should work with any kind of OnXXX events not just the NotifyEvents but also with other type of events … by simply registering to the OnXXX event the generic “dispatcher” and then register the actual listeners/delegates (TMethod-s) to the “dispatcher” by using some overloaded Include/Exclude methods ….
Anyway there are still some issues that I didn’t manage (so better have compiler support for these instead … Nick mentioned some work into the future regarding this)…
1) The events should be published / RTTI enabled to get the actual
2) The dispatcher should be generic … that means to “adapt” to any event delegate signature (safe to compile time)
3) The dispatcher should invoke all the registered delegates … (SOME BASM should be added here …)
4) Dispatcher lifecycle ?! Ex: Could be created by first “Include” … and freed by last “Exclude” ? Direct access to dispatcher or extracting it from TMethod(OnXXX).Code pointer + cast ?
….. and more…
Thanks for sharing these…
PS: What IDE/editor are you using ? … it looks a bit “unusual” …but the compiler seams Delphi 7…
Hi El Cy, some interesting comments (thanks) and yes I saw that Nick had mentioned some potential future developments in this area – it was one of the reasons I decided to blog about my work, before it became too old-hat to be of interest!
π
As I mentioned in the video, at the moment I’ve not got a way of publishing my multicast events, but I’ve not really given it that much thought as so far at least I haven’t had much call for multicast events in the GUI (my examples are essentially GUI based simply because it makes for easier demonstrations).
For me these types of events seem to be of most use in business objects/non-UI frameworks etc, where the lack of published support isn’t so much of an issue.
As for the editor, it is just the regular Delphi 7 editor/IDE with GExperts providing the tweaks that perhaps looked “unusual” (in-editor tool bar, button style tabs).
I’m also running XP with Window Blinds, which makes it all look very pretty.
π
10x for reply …
I’ve seen your comments in a lot of others (ex: Tiburon related) posts … so maybe is better to start publishing some articles regarding your thoughts π
Keep the good work !
Mesaj i