2009/4/29 Chris McDonough <chr...@plope.com>:
> In the second view variant, the unit test indirection would need to be
> registered in ZCML or elsewhere.  In the first one, it needn't be, except
> within the unit test itself.  The main benefit of this is that registrations
> made only to service unit tests don't need to pollute ZCML.

That's an interesting approach; it beats default component
registration in a "configure.zcml" file since it's a) clearly
understandable from code what implementation gets used and b) easy to
override (by actually registering a component).

It reminds me of something daniel nouri did in his singing & dancing
packages, a la:

   @property
   def some_property(self):
      return getUtility(ISomeUtility)

It's encouraged in these packages to set persistent utilities (or
what-not) on instances of the classes, effectively overriding the
default properties which defer to component lookup.

\malthe
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to