[MUD-Dev] CORBA, RMI, threads

coder at ibm.net coder at ibm.net
Sat Feb 14 21:49:02 CET 1998


On 29/01/98 at 10:29 AM, s001gmu at nova.wright.edu said:

>So, to reuse my schedule example, you could have several different calls
>like so:

>  event_driver.schedule(new combat_event(real_to_game_time(t), attacker,
>                                         defender));
>  event_driver.schedule(new heal_event(real_to_game_time(t), target,
>                                       amount));

I simplify all of this by not using a stack based architecture, but
instead using message passing.  An "event" then is merely a tuple of an
objectID and a message to pass to that object,

>etc.  Each event class descended from the generic event has it's own
>handle() method.  You'll also want to have each descended event class's 
>constructors take arguments of pertinent data, as above.  You can make
>the inheretence tree as broad and deep as you like, depending on how you
>choose to organize things.

You also end up with a very very shallow and simple inheritance tree.

><rant>
>There are other ways of doing things which are less object oriented in
>their design (like registering callback functions).  There is no one way
>that your code "should" look.  Always keep in mind that there is no
>"right" solution to any problem.  There are many solutions with varrying
>degrees of effectiveness, based on your assumptions and understanding of
>the problem.  Lines like "how should my code look" really bother me...
></rant>

<nod>

--
J C Lawrence                               Internet: claw at null.net
----------(*)                              Internet: coder at ibm.net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...




More information about the mud-dev-archive mailing list