TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

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

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

Print Reply
Subject:
From:
Pascal Obry <[log in to unmask]>
Reply To:
Pascal Obry <[log in to unmask]>
Date:
Sat, 18 May 2002 10:42:15 +0200
Content-Type:
text/plain
Parts/Attachments:
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.

--

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

ATOM RSS1 RSS2