Where does ISite belong conceptually?

View: New views
8 Messages — Rating Filter:   Alert me  

Where does ISite belong conceptually?

by Thomas Lotze :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
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 )

Re: Where does ISite belong conceptually?

by Hanno Schlichting-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Oct 21, 2009 at 8:28 AM, Thomas Lotze <tl@...> 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@...
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 )

Re: Where does ISite belong conceptually?

by Thomas Lotze :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
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 )

Re: Where does ISite belong conceptually?

by Fred Drake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Oct 21, 2009 at 10:54 AM, Thomas Lotze <tl@...> 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@...
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 )

Re: Where does ISite belong conceptually?

by Leonardo Rochael Almeida :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Oct 21, 2009 at 18:05, Fred Drake <fdrake@...> wrote:
> On Wed, Oct 21, 2009 at 10:54 AM, Thomas Lotze <tl@...> 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@...
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 )

Re: Where does ISite belong conceptually?

by Fred Drake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

On Wed, Oct 21, 2009 at 12:22 PM, Leonardo Rochael Almeida
<leorochael@...> 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@...
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 )

Re: Where does ISite belong conceptually?

by Martijn Faassen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
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 )

Re: Where does ISite belong conceptually?

by Thomas Lotze :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
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 )