Opened 9 years ago

Closed 6 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: Launchpad Bug:

Description


Attachments (1)

twistedquotes.diff (2.4 KB) - added by exarkun 6 years ago.
move IQuoter to a more sensible place

Download all attachments as: .zip

Change History (8)

comment:1 Changed 9 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 6 years ago by exarkun

  • Component set to conch
  • Owner set to z3p

Yes, that seems sensible.

comment:3 Changed 6 years ago by exarkun

  • Component changed from conch to core
  • Owner changed from z3p to exarkun

Changed 6 years ago by exarkun

move IQuoter to a more sensible place

comment:4 Changed 6 years ago by exarkun

  • Keywords review added
  • Owner exarkun 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 6 years ago by radix

  • Keywords review removed
  • Owner set to exarkun

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

+1

comment:6 Changed 6 years ago by exarkun

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by <automation>

  • Owner exarkun deleted
Note: See TracTickets for help on using tickets.