<div dir="ltr">Hi Tamer.<div><br></div><div>2013/5/14 Tamer Higazi <span dir="ltr">&lt;<a href="mailto:th982a@googlemail.com" target="_blank">th982a@googlemail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
1. What is the difference between a global and a localSiteManager from<br>the zope.component package?! How does it How do I have to understand<br>that a &quot;globalSiteManager&quot; is in memory, and a localSiteManager is<br>
persistent ?!<br></blockquote><div class="gmail_extra"><br></div><div class="gmail_extra" style>&quot;SiteManager&quot; is a deprecated term and now is replaced by &quot;registry&quot;. A registry can perform registrations of adapters and utilities (components in short). Look at the interface in zope.interface.interfaces.IComponents and you will see a standard registry interface (earlier this interface was in zope.component but as of zope.interface-3.8 it migrated). SiteManager is an implementation of this interface. </div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style><b>Zope has a</b> <b>more complex lookup process</b> for components. It can provide several registries. They are known as SiteManagers.</div><div class="gmail_extra" style>
If you just start a python process and import the zope.component package it will have 1 registry in memory (the globalSiteManager or global registry). When you issue a getAdapter call it will find that registry and ask it for the adapter.</div>
<div class="gmail_extra" style>The localSiteManager is a <i>hooked</i> registry (it is persistent by default in BlueBream within the ZODB). If it is present the upper adapter lookup process will <b>ask the local registry for an adapter and only if it does not provide it will it ask the global one</b>.</div>
<div class="gmail_extra" style>In bluebream you can provide several localSiteManagers in witch case the lookup will be processed through all of them up to the global one. </div><div class="gmail_extra" style><br></div><div class="gmail_extra" style>
2013/5/14 Tamer Higazi <span dir="ltr">&lt;<a href="mailto:th982a@googlemail.com" target="_blank">th982a@googlemail.com</a>&gt;</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
2. What is the difference between an adapter and a utility ?! I register<br>an adapter as well the same way as I do with a utility, and I query<br>those 2 as well. But what&#39;s the point there?!<br></blockquote><div style>
Both are based on the same adapters registries, but the have different concept and usage. </div><div style><i>Adapter</i> is a wrap around some object to provide some specific interface. So basicly adapting means getting a specific interface for managing <b>one or many objects</b>. </div>
</div><div class="gmail_extra" style><i>Utility</i> is an object that provides the interface and does not wrap anything. When you lookup utilities, you <b>do not provide any objects</b> that will be managed by it.</div><div class="gmail_extra" style>
<br></div><div class="gmail_extra" style>Hope this helps.</div><div class="gmail_extra" style>Taras</div><div class="gmail_extra"><br><div class="gmail_quote">2013/5/14 Tamer Higazi <span dir="ltr">&lt;<a href="mailto:th982a@googlemail.com" target="_blank">th982a@googlemail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi people!<br>
I have worked out so far the ZCA tutorial, and there are certain things<br>
for me not clear.<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
1. What is the difference between a global and a localSiteManager from<br>
the zope.component package?! How does it How do I have to understand<br>
that a &quot;globalSiteManager&quot; is in memory, and a localSiteManager is<br>
persistent ?!<br>
<br>
Could somebody of you explain it to me?!<br>
<br>
<br>
2. What is the difference between an adapter and a utility ?! I register<br>
an adapter as well the same way as I do with a utility, and I query<br>
those 2 as well. But what&#39;s the point there?!<br>
<br>
<br>
<br>
For answering my questions, I would kindly thank you.<br>
<br>
<br>
<br>
<br>
Tamer<br>
_______________________________________________<br>
bluebream mailing list<br>
<a href="mailto:bluebream@zope.org">bluebream@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>
</blockquote></div><br></div></div></div>