Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

Where does ISite belong conceptually?

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


tl at gocept

Oct 20, 2009, 11:28 PM

Post #1 of 8 (550 views)
Permalink
Where does ISite belong conceptually?

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



_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


hanno at hannosch

Oct 21, 2009, 2:09 AM

Post #2 of 8 (511 views)
Permalink
Re: Where does ISite belong conceptually? [In reply to]

On Wed, Oct 21, 2009 at 8:28 AM, Thomas Lotze <tl[at]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
_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


tl at gocept

Oct 21, 2009, 7:54 AM

Post #3 of 8 (504 views)
Permalink
Re: Where does ISite belong conceptually? [In reply to]

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



_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


fdrake at gmail

Oct 21, 2009, 9:05 AM

Post #4 of 8 (505 views)
Permalink
Re: Where does ISite belong conceptually? [In reply to]

On Wed, Oct 21, 2009 at 10:54 AM, Thomas Lotze <tl[at]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
_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


leorochael at gmail

Oct 21, 2009, 9:22 AM

Post #5 of 8 (505 views)
Permalink
Re: Where does ISite belong conceptually? [In reply to]

On Wed, Oct 21, 2009 at 18:05, Fred Drake <fdrake[at]gmail.com> wrote:
> On Wed, Oct 21, 2009 at 10:54 AM, Thomas Lotze <tl[at]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?
_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


fdrake at gmail

Oct 21, 2009, 9:57 AM

Post #6 of 8 (504 views)
Permalink
Re: Where does ISite belong conceptually? [In reply to]

[Meant to send to the list as well; sorry.]

On Wed, Oct 21, 2009 at 12:22 PM, Leonardo Rochael Almeida
<leorochael[at]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
_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


faassen at startifact

Nov 3, 2009, 8:49 AM

Post #7 of 8 (328 views)
Permalink
Re: Where does ISite belong conceptually? [In reply to]

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


_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


tl at gocept

Nov 3, 2009, 11:21 PM

Post #8 of 8 (314 views)
Permalink
Re: Where does ISite belong conceptually? [In reply to]

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



_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.