Opened 12 years ago

Closed 9 years ago

#1489 enhancement closed fixed (fixed)

Shuldn't an interface go with the protocol ?

Reported by: pupeno Owned by:
Priority: low Milestone:
Component: core Keywords: documentation
Cc: pupeno Branch:
Author:

Description


Attachments (1)

twistedquotes.diff (2.4 KB) - added by Jean-Paul Calderone 10 years ago.
move IQuoter to a more sensible place

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by pupeno

On "Designing Twisted            
Applications" (http://twistedmatrix.com/projects/core/documentation/howto/design.html)            
for me, it would seem more natural to put the interface, IQuoter,  next to the          
protocol and factory implementation, QOTD(Protocol) and QOTDFactory(Factory),      
instead of the concrete implementation of a Quoter, StaticQuoter and 
FortuneQuoter. 
That is because there will be one protocol implementation, which is a reusable 
library while there would be many implementations of programs using that 
library and all of them would need to implement IQuoter. 
Thanks.

comment:2 Changed 10 years ago by Jean-Paul Calderone

Component: conch
Owner: set to z3p

Yes, that seems sensible.

comment:3 Changed 10 years ago by Jean-Paul Calderone

Component: conchcore
Owner: changed from z3p to Jean-Paul Calderone

Changed 10 years ago by Jean-Paul Calderone

Attachment: twistedquotes.diff added

move IQuoter to a more sensible place

comment:4 Changed 10 years ago by Jean-Paul Calderone

Keywords: review added
Owner: Jean-Paul Calderone deleted

I moved the interface and made a few other very small fixes to things nearby. TwistedQuotes needs some serious attention and more work than I'm going to give it now, though.

comment:5 Changed 9 years ago by radix

Keywords: review removed
Owner: set to Jean-Paul Calderone

Looks good. I even ran the code to test it.

+1

comment:6 Changed 9 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [24129]) Apply twistedquotes.diff, improving the organization of code in the quote example

Author: exarkun Reviewer: radix Fixes: #1489

Move the IQuoter interface to be close to the factory which uses it, instead of being close to the one implementation of it. This more closely resembles the organization of a real program, where the user of an interface does not know or care where the implementation comes from, only that it behaves correctly, and where there may be several implementations of the interface in different places.

comment:7 Changed 7 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.