[Twisted-Python] How to split a huge 'service' class.

Peter Cai newptcai at gmail.com
Wed Mar 25 21:51:15 EDT 2009


Hi all,

I am writing a network application based on twisted and following the
"finger service" tutorial in twisted document.
I wrote multiple protocols classes and a single service class.
This allows client to choose the most suitable protocol to access services.

My problem is : the service class now become really huge, about 3000
thousands line of code.

Then I moved these code that really do the job in service class to several
classes, and the service would call these methods of these classes to finish
calls from protocol classes.

But still, this would cause another problem : now the service classes seems
to be useless.  It contains lots small methods that almost do nothing.  That
has a bad smell for me.

So, if you are in my situation, what will you do?

-- 
look to the things around you,the immediate world around you, if you are
alive,it will mean something to you ——Paul Strand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090326/c9236ff8/attachment.htm 


More information about the Twisted-Python mailing list