While writing tests for the zope.site.hooks module I'm moving to zope.component, I notice that the module calls getSiteManager() on an site object. Such an object isn't technically required to implement an interface that declares that method, but there is one, or rather a pair of them: IPossibleSite and ISite. These interfaces are currently defined by zope.location even though they aren't involved with the concept of location at all. As these two interfaces have the same concept of a site that zope.component has (i.e. simply an object that has a component registry associated with it), I propose moving IPossibleSite and ISite to zope.component, leaving BBB imports behind. Any objections? -- Thomas
On Wed, Oct 21, 2009 at 8:28 AM, Thomas Lotze <tl@gocept.com> wrote:
As these two interfaces have the same concept of a site that zope.component has (i.e. simply an object that has a component registry associated with it), I propose moving IPossibleSite and ISite to zope.component, leaving BBB imports behind.
+1 Hanno
Thomas Lotze wrote:
While writing tests for the zope.site.hooks module I'm moving to zope.component, I notice that the module calls getSiteManager() on an site object. Such an object isn't technically required to implement an interface that declares that method, but there is one, or rather a pair of them: IPossibleSite and ISite.
I wonder: should we start requiring that the object passed to setSite() implement (or even be adaptable to) IPossibleSite? -- Thomas
On Wed, Oct 21, 2009 at 10:54 AM, Thomas Lotze <tl@gocept.com> wrote:
I wonder: should we start requiring that the object passed to setSite() implement (or even be adaptable to) IPossibleSite?
That just sounds silly. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "Chaos is the score upon which reality is written." --Henry Miller
On Wed, Oct 21, 2009 at 18:05, Fred Drake <fdrake@gmail.com> wrote:
On Wed, Oct 21, 2009 at 10:54 AM, Thomas Lotze <tl@gocept.com> wrote:
I wonder: should we start requiring that the object passed to setSite() implement (or even be adaptable to) IPossibleSite?
That just sounds silly.
It didn't sound silly to me at first. Unnecessary, at worst. But maybe you have more specific reasons. Could you elaborate, please?
[Meant to send to the list as well; sorry.] On Wed, Oct 21, 2009 at 12:22 PM, Leonardo Rochael Almeida <leorochael@gmail.com> wrote:
It didn't sound silly to me at first. Unnecessary, at worst. But maybe you have more specific reasons. Could you elaborate, please?
If we're setting a site, it matters that the object passed in be (or maybe just can adapt to) an ISite; the IPossibleSite interface is for objects that might become sites if they aren't already. What would you expect to happen if you pass an IPossibleSite that isn't an ISite? I can think of at least two reasonable outcomes, and they're mutually exclusive. Either would surprise some portion of the user base, and I expect that to be a substantial group in either case. If you want to check for something at all, it should be ISite. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "Chaos is the score upon which reality is written." --Henry Miller
Thomas Lotze wrote:
Thomas Lotze wrote:
While writing tests for the zope.site.hooks module I'm moving to zope.component, I notice that the module calls getSiteManager() on an site object. Such an object isn't technically required to implement an interface that declares that method, but there is one, or rather a pair of them: IPossibleSite and ISite.
I wonder: should we start requiring that the object passed to setSite() implement (or even be adaptable to) IPossibleSite?
I think the simplest way forward would be not to change the semantics as part of this step. Regards, Martijn
Martijn Faassen wrote:
Thomas Lotze wrote:
I wonder: should we start requiring that the object passed to setSite() implement (or even be adaptable to) IPossibleSite?
I think the simplest way forward would be not to change the semantics as part of this step.
Agreed. -- Thomas
participants (5)
-
Fred Drake -
Hanno Schlichting -
Leonardo Rochael Almeida -
Martijn Faassen -
Thomas Lotze