TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Pascal Obry <[log in to unmask]>
Sat, 18 May 2002 10:42:15 +0200
text/plain (36 lines)
C. Daniel Cooper writes:

 > c) subscriber id: This approach assigns a unique identifier to each
 > subscriber and uses that instead of the 'Access value for matching
 > in the callback list. This adds complexity and maintenance concerns,
 > and resists the introduction of a new subscriber into the system
 > -- although I've heard it argued that that is a -good- thing: only
 > "authorized" subscribers will be able to subscribe, by virtue of having
 > been assigned an id.

This is indeed a better design. It is possible to have a fast implementation
to look for the ID (AVL tree for example). More over it is then possible to
have a "readable" log file. For each use of the interface you can log which
client is calling.

 > e) dispatching: This is a more sophisticated approach, wherein the
 > callbacks are mediated via tagged type dispatching rather than by
 > 'Access subprogram values.

Of course this is the design to use with Ada95, as Corey said, it is the
implementation used in OO languages, it works just fine and does not suffer
the 'Access issue you have raised.



--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--| "The best way to travel is by means of imagination"
--| gpg --keyserver --recv-key C1082595