Hash: SHA1

Thomas Lotze wrote:
> Tres Seaver wrote:
>> +100 to shedding the dependencies.  Could we have the conditional import
>> work as a fallback to a utility lookup?  And then change
>> 'zope.applicationcontrol' to register such a utility?
> This should be possible, but the utility lookup would have to be
> conditional as well since it would have to target
> zope.app.applicationcontrol.interfaces.IApplicationControl which may not
> be available either after the dependency on zope.app.applicationcontrol
> has been lifted.

Hmm, I guess I hadn't realized that the interface was in the zope.app
package.  Shouldn't the interface be in a more "dependable" package,
from which clients can import it without depending on a given
implementation?  One logical place for the interface is actually in
zope.traversing:  that would break the dependency inversion.

> OTOH, if the application controller were to be registered as a utility,
> should it stay importable from the module, at least for a transition
> period? If zope.app.applicationcontrol.applicationController was removed,
> would it be sufficient to adapt the zope.app.publication tests, or are
> there other packages expected to break in that case?
> Philosophically, when is it best to provide something like the application
> controller as a global utility and when is it sufficient to bind it to a
> name in a module?

Philosophically, a utility lookup allows for pluggability:  it is a
looser coupling (to the implementation) than an import.  I would prefer
such an indirection over dependency cycles, any day of the week.

- --
Tres Seaver          +1 540-429-0999          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to