[Twisted-Python] Status of components, protocols, etc in Twisted

I'm trying to better understand componentized architectures, protocols, adaptors etc., as done in Python. I've been reading around and have a few questions about the state of play. It would be good to understand where things are, and where they're heading. It seems there are (or were) 3 efforts to provide components, protocols, adaptors, etc.: Zope, Twisted, PyProtocols. It looks like Twisted is now using the zope module to do this. But I also ran across discussion (on this list, in Feb 2004, I think), about possibly migrating zope's use of components to PyProtocols. Did that happen? I do like the sound of PyProtocols (and PEAK in general), but as someone else said, and as Philip wrote, the documentation isn't really focused on easing in a newbie. A couple of points on those docs, I think it would be good if someone set out how you would go about building something small (i.e., small concrete examples, not "big" more abstract ones). Yes, that someone could be me, agreed. Also, the docs say that it is intended that _all_ uses of type(), isinstance() etc., can/should be replaced. A few use cases would be helpful - how are we supposed to replace those things? I do have the impression that one should have a clean componentized design from the beginning and thereby never need or want to resort to introspection. If that's the case, it might be worth saying, as the docs leave one wondering if there's not perhaps some formulaic way to rewrite one's code to do the Right Thing. It's not that simple though, right? I'd also be happy to use the standard Twisted (i.e., zope) approach too. Do people have an opinion about which is better to use? Does it make much difference if you're just building a simple app with a handful of components you'd like to be able to swap in & out easily? I think the Twisted evolution of finger pages are really good, with a couple of minor weak points (e.g., highlighting new code from example to example). It's amazing what you can get done in a couple of hundred lines of Twisted code. BTW, there's a mention of __implements__ whereas implements() is used, which I guess is a hang over from an earlier version? This is on http://twistedmatrix.com/projects/core/documentation/howto/tutorial/componen... I guess someone will look for others. Grepping __implements__ gets a lot of hits in the distributed Twisted-2.2.0 docs (e.g., in doc/howto/*.html). Anyway, thanks for all the docs and code. I'm happy to put some work into making improvements where I can. Terry

On Mon, 1 May 2006 03:09:00 +0200, Terry Jones <tcj25@cam.ac.uk> wrote:
Today, Twisted simply provides a single global registry on top of Zope Interface's normal layer. Twisted's original interface implementation was derivative of Zope's and introduced some horrible bugs and some interesting ideas; the interesting ideas were incorporated into Zope, and the horrible bugs left behind.
No. Some people liked PyProtocols better, but we had the discussion, we made the decision, and Zope Interface has worked out very well.

Take also into account the recent GvR Python 3000 decision to put aside interfaces and adaptation in favor of generic functions or, as he decided to call them, "dynamic function overloading": Python 3000 - Adaptation or Generic Functions? http://www.artima.com/forums/threaded.jsp?forum=106&thread=155123 Dynamic Function Overloading http://www.artima.com/forums/threaded.jsp?forum=106&thread=155514
Notice that PJE himself is not very fond of PyProtocols anymore: [Python-3000] Sane transitive adaptation http://mail.python.org/pipermail/python-3000/2006-April/000532.html -- Nicola Larosa - http://www.tekNico.net/ How we live; how we invest our limited capital of time, energy, interest and capabilities, is surely more important than how we invest our money; and look how much time, activity and newsprint is spent on that. Money can be replaced. Once spent, our lives can not. -- Carmine Coyote, January 2006

On Mon, 1 May 2006 03:09:00 +0200, Terry Jones <tcj25@cam.ac.uk> wrote:
Today, Twisted simply provides a single global registry on top of Zope Interface's normal layer. Twisted's original interface implementation was derivative of Zope's and introduced some horrible bugs and some interesting ideas; the interesting ideas were incorporated into Zope, and the horrible bugs left behind.
No. Some people liked PyProtocols better, but we had the discussion, we made the decision, and Zope Interface has worked out very well.

Take also into account the recent GvR Python 3000 decision to put aside interfaces and adaptation in favor of generic functions or, as he decided to call them, "dynamic function overloading": Python 3000 - Adaptation or Generic Functions? http://www.artima.com/forums/threaded.jsp?forum=106&thread=155123 Dynamic Function Overloading http://www.artima.com/forums/threaded.jsp?forum=106&thread=155514
Notice that PJE himself is not very fond of PyProtocols anymore: [Python-3000] Sane transitive adaptation http://mail.python.org/pipermail/python-3000/2006-April/000532.html -- Nicola Larosa - http://www.tekNico.net/ How we live; how we invest our limited capital of time, energy, interest and capabilities, is surely more important than how we invest our money; and look how much time, activity and newsprint is spent on that. Money can be replaced. Once spent, our lives can not. -- Carmine Coyote, January 2006
participants (3)
-
glyph@divmod.com
-
Nicola Larosa
-
Terry Jones