[Grok-dev] Overriding Components

Paul Wilson paulalexwilson at gmail.com
Sun Jan 25 11:28:01 EST 2009


I've been playing around with adapters today, and using
zope.configuration/z3c.autoinclude/grokcore.component to discover and
register them. If I create two adapters with identical discriminators
(i.e. implement same interface and have same context), and place them
in same package/module, I get the expected ConfigurationConflictError.
If however one of these adapters is placed in a separate package and
discovered with includeDependencies, the one in the current package
*overrides* it, and no ConfigurationConflictError is thrown.

This surprised me, I thought I would have to use includeOverrides to
achieve this. Is there some rule that governs which
components/packages override others? How do I reverse this and get my
other adapter to be returned?


More information about the Grok-dev mailing list