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
Condense Mail Headers

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

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
X-To:
Stephen Leake <[log in to unmask]>
Date:
Mon, 20 May 2002 14:55:32 -0500
Reply-To:
Corey Minyard <[log in to unmask]>
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
Content-Type:
text/plain; charset=us-ascii; format=flowed
From:
Corey Minyard <[log in to unmask]>
Parts/Attachments:
text/plain (28 lines)
Stephen Leake wrote:

>Corey Minyard <[log in to unmask]> writes:
>
>
>
>>Every publish-subscribe interface I have ever seen in OO languages used
>>polymorphism.  Function pointers are used in languages that don't
>>directly support polymorphism.
>>
>>
>
>How do you get multiple subscribers to the same event with polymorphism?
>
>
>
Every subscriber supplies a reference to a data structure that extends a
specific class.  Each subscriber extends the interface to create their
own class and registers that class with the eventing mechanism.  The
subsclass overrides a specific function or functions that the event
calls as the "callbacks", and they can carry data for the subscriber to use.

I have a telephony-type event framework in my adasl package, if you need
an example.  I'm not sure it's in the release version, if not I will cut
a new release if someone want to see it.

-Corey

ATOM RSS1 RSS2