[Zope-dev] Poor programming practice?
Robin Becker
robin@jessikat.fsnet.co.uk
Wed, 31 Jan 2001 09:54:43 +0000
In article <3A77D3A9.6070603@cat-box.net>, Steve Alexander <steve@cat-
box.net> writes
>Robin Becker wrote:
>
>>
>> The real problem is that ftp_channel uses a method make_recv_channel
>> which uses a global class recv_channel and the recv_channel class has a
>> particular method which zope wants to override. How ought this kind of
>> situation to be handled more cleanly?
>
.....
>This sounds like a classic application of the Factory Method pattern.
>
....
>The other option is to use the Abstract Factory pattern. In this case,
>you'd pass the constructor of the ftp_channel class a bound method (or a
>function) that returns the appropriate kind of recv_channel.
>
yes I have the go4 book and I fully agree that one or other of the above
patterns would be feasible. The problem is that the base medusa comes
from Sam Rushing and Zope makes use of it. I guess since I already patch
the Zope code I could just extend the patch, but the best solution would
come from having two main players agree on such stuff.
--
Robin Becker