Hi,

In this posting:
http://twistedmatrix.com/pipermail/twisted-python/2012-November/026324.html

I mentioned that Professor. Douglas C. Schmidt is teaching a Coursera
course:
"Pattern-Oriented Software Architectures for Concurrent and Networked
Software"
This course is going on right now:

https://www.coursera.org/course/posa

There are a lot of very good video lectures in this course.
There are also several programming assignments.

Students are allowed to implement the programming assignments in whatever
language they want.  People are submitting assignments
in Java, C++, Python, Ruby, Scala.

For the students who wish to program in Python, I have been
pushing students to look at Twisted on the course discussion board.

I have also asked Prof. Schmidt to take assignment 3 for the course,
and add special wording for Twisted.   The assignment 3 targeted
at Twisted is here:

https://class.coursera.org/posa-001/human_grading/view/courses/970268/assessments/35/submissions

If there are some people in the Twisted community with some free time
who can help,  can you please join the course
(it is free) and provide feedback on the wording of the assignment?
It would help to correct any mistakes, and point people to the correct
sections of the Twisted documentation.
Since you need to join the class to see the wording of the assignment,
I am attaching it here.

This is a good opportunity to promote Twisted to new students who want
to use Python, but also learn how to implement network design patterns

Thanks.
--
Craig
The purpose of this assignment is to deepen your understanding of the   Wrapper 
Facade pattern, the  Reactor pattern and the (Acceptor role of the) 
Acceptor-Connector pattern in the context of the Python twisted reactor 
framework. In particular, you will write a platform-independent reactive server 
program that accepts a connection from a client and echoes back what the client 
sent. 

The reactive server program should do the following activities: 

    Create an EchoServerHandler class that derives from 
twisted.internet.protocol.Protocol and implement its dataReceived() hook method 
so that it echoes back the client's input a "line" at a time (i.e., until the 
symbols "\n" (or "\r\n"), rather than a character at a time.
    Create an EchoServerFactory class that derives from 
twisted.internet.protocol.ServerFactory and implement its buildProtocol() hook 
method so that it returns a EchoServerHandler.
    Create a twisted.internet.reactor that registers a EchoServerFactory when a 
connection on the TCP port of your choice is received [listenTCP] and start 
that reactor.
    For this assignment, you can simply exit the server process when you're 
done, which will close down all the open sockets.

Make sure your solution clearly indicates which classes play which roles in the 
Wrapper Facade, Reactor, and/or Acceptor-Connector patterns. 

This server program should be implemented in Python 2.6 or newer, utilizing the 
twisted reactor framework, and include at least one file (name it like 
server.txt so uploading is accepted on Coursera!) for your server which is the 
basis for the evaluation.  An evaluator should be able to run your program with 
a command such as 'python server.txt' and your program should successfully run! 

A second client.txt file may optionally be included for a simple console client 
if you write one during your solution development as a test program and wish to 
include it for the convenience of evaluators, but it is not required and will 
not be assessed as part of this exercise, just used as a test driver for your 
server. You can also use a telnet client (such as putty) as a test driver for 
your server.

Twisted classes of note:
Reactor (IReactorTcp): 
http://twistedmatrix.com/documents/13.0.0/api/twisted.internet.interfaces.IReactorTCP.html
ServerFactory: 
http://twistedmatrix.com/documents/13.0.0/api/twisted.internet.protocol.ServerFactory.html
Protocol: 
http://twistedmatrix.com/documents/13.0.0/api/twisted.internet.protocol.Protocol.html

Please add Python version you used into a comment in source code

Rubric

30 possible points

     5 points – code is well-structured and design makes sense 
    15 points – Wrapper Facade, Reactor, and Acceptor-Connector patterns are 
used correctly (and the classes in the solution are clearly mapped to the 
appropriate roles in the patterns) 
    5 points – code demonstrates the appropriate level of readability for 
others to understand the intent and execution of the program 
    5 points – code compiles and runs smoothly
                                                
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to