RE: Component Architecture / A modest proposal: Replace medusa with Twisted
Hi all I don't know if you're all familiar with this already, but reading about Twisted didn't immediately bring to mind Medusa, but rather certain aspects (specifically, *aspects*) of TransWarp, and of the Component Architecture (interfaces). I'm including a bite from http://twistedmatrix.com/page.epy/twistedphil.html Interesting? Regards, Jean Adverb Oriented 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 extension. 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 foo() def remote_killPlayer(self): #remote callable method. bar() 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.
At 01:52 PM 10/11/01 +0200, Jean Jordaan wrote:
Hi all
I don't know if you're all familiar with this already, but reading about Twisted didn't immediately bring to mind Medusa, but rather certain aspects (specifically, *aspects*) of TransWarp, and of the Component Architecture (interfaces).
I'm including a bite from http://twistedmatrix.com/page.epy/twistedphil.html
Interesting?
What they're doing is more of a design pattern ala JavaBeans to create interface definitions using method signatures which can be recognized using introspection. However, a major point of the Component architecture is to get *away* from this style of doing things in Zope, because it makes it harder to use objects "off the shelf", as one is required to code objects from the ground up for Zope use. Whereas, in the New Religion, you can just stick an __implements__ attribute on them, and set up some adapters. (Also, what Twisted is doing is entirely orthogonal to what TransWarp does, but I covered that in my reply to your post on the TransWarp mailing list. :) )
participants (2)
-
Jean Jordaan -
Phillip J. Eby