September 25, 2003

VideoDescriptor and Delegates

I worked on the VideoDescriptor class, trying to port to C# and make use of the delegate system instead of registering subscribers. It basically works the same way. I think I may need to add a special EOF implementation to the VideoSequence C# class. I'm not sure if this can be done easily through the existing delegate handlers, or if I need to set up another delegate handler list for that.

The general subscribers concept is more flexible because you can specify multiple communication methods (i.e. multiple function callbacks) while only requiring you to register your subscriber once. I think the problem is that in C# you don't become a delegate of an object, but instead a delegate of a function call.

In Java, subscribers must conform to an interface. There is no language construct explicitly supporting the subscriber-publisher model. C# goes farther to explicitly support this model, but does so from a functional approach. Objective-C has support for both the subscriber-publisher model (through notification in Foundation) and also an object-based delegation model that follows the chain-of-responsibility design pattern.

Posted by josuah at September 25, 2003 2:09 AM UTC+00:00

Trackback Pings

TrackBack URL for this entry:
http://www.wesman.net/cgi-bin/mt/mt-tb.cgi/520

Comments

Post a comment

July 2013
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Search