[Twisted-Python] New user - plugin question

Drew Smathers drew.smathers at gmail.com
Mon Apr 6 16:07:13 EDT 2009


On Mon, Mar 30, 2009 at 6:27 PM, tim wylie <timwylie at hotmail.com> wrote:
> Hello,
>    I'm a long time linux/python user who's just now starting to use
> twisted.  I am looking for advice more than anything specific.  We're
> working on a small game/etc server that has several small games that can be
> played between users.  Maybe a card game, tic-tac-toe, etc.  There are a lot
> of different plugin subclasses to inherit from-how do you know which is
> best?  And with this kind of framework, is it better to have one interface
> class, say iGame, that all the games inherit from, or is it better to treat
> each game like a seperate plugin inheriting from different twisted plugin
> classes?
>

Unfortunately, I don't think many people will have advice beyond: "Do
what feels right."

Design is an iterative process, you learn from your mistakes.  Try
just writing your game - doing it the "wrong" way first - and then
think more about what makes sense in terms of design, or ask more
specific questions about design later when you've actually implemented
something.

>   There is a lot of good twisted documentation, but that is what also makes
> it difficult because each one does things differently depending on what
> they're implementing and it makes it difficult to decide which is the
> correct approach for what I want to do.  So, if there are any good documents
> related closer to what I'm doing I'd appreciate the heads up on that as
> well.  Well, thanks for your time.

Try going through the classic finger tutorial and then relating those
concepts to your application:

http://twistedmatrix.com/projects/core/documentation/howto/tutorial/index.html

There is never going to be a document "How to write the very
application you're thinking of now", but rather always "How to write
some other application" - so you're tasked with realizing an
isomorphism between the concepts.

-Drew




More information about the Twisted-Python mailing list