[TransWarp] Twisted and TransWarp
jean at upfrontsystems.co.za
Thu Oct 11 07:52:32 EDT 2001
I don't know if you're all familiar with this already, but reading
the Twisted FAQ reminded me strongly of certain aspects (specifically,
*aspects*) of TransWarp.
Twisted is "adverb oriented", which takes this one step further.
Using inheritance and a simple naming convention, Twisted classes
indicate what sort of events they are responding to. This allows
for conveniently extensible protocols along defined "vectors" for
Let's say you wanted an object to be both a Twisted Reality player, and
also an object accessible through Twisted PerspectiveBroker. You could
define a class that looked like the following::
class RemotePlayer(reality.player.Player, spread.pb.Referenced):
def ability_kill(self, sentence): #kills another player
def remote_killPlayer(self): #remote callable method.
Reality objects can have abilities, which you define by making a method
prefixed with ability_. pb objects have remotely callable
methods, which you define by making methods that begin with
remote_; so this is effectively the same as a class, a
snippet from the configuration file for a multi-user dungeon, and a
remote interface definition file; the three of which are normally
defined in different languages. Using "adverb orientation" and some
simple python features, we can avoid the need for macros or complex
parsing to achieve this effect.
More information about the PEAK