[Home] [Groups] - Message: [Prev in Group] [Next in Group]
4587: Re: [MUD-Dev] CORBA, RMI, threads
[Full Header] [Plain Text]
From: coder@ibm.net
Newsgroups: nu.kanga.list.mud-dev
Date: Sat, 14 Feb 98 21:49:02 -0800
References: [1]
Organization: Kanga.Nu
On 29/01/98 at 10:29 AM, s001gmu@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@null.net
----------(*) Internet: coder@ibm.net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...