[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Docs of Messaging system are in cvs



On Thu, 4 Jun 1998 22:05:24 +0200, you wrote:

>Hi all,
>
>The docs of the messaging system (i.e. layer O event mechanism) are in cvs
>(penguinplay/www/PenguinDoc/messaging/) and on the Homepage (just look at
>the Docs section.
>

Rich Hickey has an interesting article on his home page,
(http://www.bestweb.net/~rhickey/functor.html) and a C++ Callback Library
based on Template Functors.


With regard to:

""If the function is a member function, you'll need to specify the object
too. Note that this object's class needs to be derived from
ppMessageBase."" [from /penguinplay/PenguinDoc/messaging/index.html]


He makes a few interesting statements about using Callee Mix-Ins:

"" The problem with the callee mix-in is that it, too, is type-intrusive,
i.e. it impacts the type of the callee, in this case by forcing
derivation. This has three major flaws. First, the use of multiple
inheritance, particularly if the callee is a callee of multiple
components, is problematic due to name clashes etc. Second, derivation may
be impossible, for instance if the application designer gets CDPlayers
from an unchangeable, untouchable API (library designers note: this is a
big problem with mix-in based mechanisms in general). The third problem is
best demonstrated. Consider this version of CDPlayer: 
class CDPlayer{
public:
        void play();
        void stop();
        //...
};

It doesn't seem unreasonable to have an application where one Button calls
CDPlayer::play() and another CDPlayer::stop(). The
mix-in mechanism fails completely here, since it can only support a single
mapping between caller/callee/member-function, i.e. MyCDPlayer
can have only one notify(). 
 ""


His article is rather in depth and he includes a call back library on his
homepage as well. (http://www.bestweb.net/~rhickey/callback.zip)


Definitely worth the look.

Nicholas
--
Nicholas Lee, Kiwa Enterprises Ltd
postmaster for kiwa.co in nz
NO SPAM for me!