[Mono-osx] DBNotificationCenter, my silly little idea
R. Tyler Ballance
tyler at bleepconsulting.com
Wed Jan 24 14:04:00 EST 2007
Now that Allan has committed the static method and property support
to the Dumbarton tree, I was wondering if you guys would give me some
feedback on my notification bridge that I've been hacking up as to
whether I should retrofit it to include it with Dumbarton.
I just whipped up the flowchart I've got sketched out in my legal pad
here: http://www.bleepconsulting.com/files/DBNotificationCenter.pdf
Basically the idea is this, C# classes generate DBNotification
objects, and call DBNotificationCenter.Instance.PostNotification
(notification);
PostNotification will properly serialize the object into a valid
apple-plist (got this code fully working this morning) which
DBNotificationCenter uses to write out to the socket it's writing to,
and the Cocoa DBNotificationHandler reads from.
The Cocoa DBNotificationHandler then uses
[NSPropertyListSerialization propertyListFromData:] to deserialize
the data read from the unix socket, and essentially rearrange objects
to appropriately fit into an NSNotification which would then be
posted to the main thread of the application (contemplating adding a
bool property in DBNotification (C#) to turn this on and off).
I'm not 100% done with it for my own project, but I think it would
fit best in Dumbarton instead of sitting inside some of my own silly
DLLs ;)
What do you guys think?
Cheers
p.s. I'm not bridging C# events because of (a) I don't like C#'s
event model (b) I think event bridging would be substantially more
complicated than basically serializing objects over a unix socket
R. Tyler Ballance: Custom Mac and Linux Development at bleep. consulting
contact: tyler at bleepconsulting.com | jabber: tyler at jabber.geekisp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20070124/82721ade/attachment.html
More information about the Mono-osx
mailing list