[Zope] Accessing the namespace of another Product/Package ? (pb when th e superclass belong to another package) e superclass belong to another package)

NABETH Thierry Thierry.NABETH@insead.fr
Tue, 11 Jul 2000 10:08:21 +0200


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01BFEB0E.DEADAB3A
Content-Type: text/plain;
	charset="iso-8859-1"

Hello,

In order to have a system more modular, I have split a package (product)
into several other product.

In particular, I have a package (BaseClassesPackage) that define some kind
of abstract classes,
and other (more application specific) packages (Package1, Package2), that
define some class
that inherit some class defined in the BaseClassesPackage.

BaseClassesPackage  (Product)
   MyFolderClass

Package1
   MyClass1 (inherits MyFolderClass)

Package2
   MyClass2 (inherits MyFolderClass)


The problem is that the namespace of BaseClassesPackage is not visible
from the packages Package1 and Package2.

Any idea to fixe this ?

More generaly, do you know about any approaches / guidelines to make an
application
more modular (defined in several packages that use one another)?
Does Zope 2.2 address this issue at some point ?




I have already tried to look at the code without any success.

For instance there are somewhere a few functions that can be relevant
(open somewhat the namespace):

<dtml-with manage_addProduct([anotherPackage])>
  # namespace of the package anotherPackage is available for object creation
</dtml-with>


<dtml-with "REQUEST.resolve_url(REQUEST.script + PointerToIUD)">
  # the namespace of the package where the class of the object
REQUEST.script + PointerToIUD
  # is define is available.
</dtml-with>
<dtml-except>
  <small>???? (the object does not exist)</small>
</dtml-try>

There are a few (python) function that seem to have something to do with
namespace and acquisition,
but it is not very clear for me how they have to be used. (in particular
from within a dtml method).
aq_acquire(), DT_Util.namespace(), ...

Thanks

Thierry Nabeth
Research Fellow
INSEAD CALT (the Centre for Advanced Learning Technologies)
http://www.insead.fr/CALT/











------_=_NextPart_001_01BFEB0E.DEADAB3A
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
<TITLE>Accessing the namespace of another Product/Package ?  (pb when the superclass belong to another package)</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hello,</FONT>
</P>

<P><FONT SIZE=2>In order to have a system more modular, I have split a package (product)</FONT>
<BR><FONT SIZE=2>into several other product.</FONT>
</P>

<P><FONT SIZE=2>In particular, I have a package (BaseClassesPackage) that define some kind of abstract classes,</FONT>
<BR><FONT SIZE=2>and other (more application specific) packages (Package1, Package2), that define some class</FONT>
<BR><FONT SIZE=2>that inherit some class defined in the BaseClassesPackage.</FONT>
</P>

<P><FONT SIZE=2>BaseClassesPackage&nbsp; (Product)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; MyFolderClass</FONT>
</P>

<P><FONT SIZE=2>Package1</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; MyClass1 (inherits MyFolderClass)</FONT>
</P>

<P><FONT SIZE=2>Package2</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; MyClass2 (inherits MyFolderClass)</FONT>
</P>
<BR>

<P><FONT SIZE=2>The problem is that the namespace of BaseClassesPackage is not visible</FONT>
<BR><FONT SIZE=2>from the packages Package1 and Package2.</FONT>
</P>

<P><FONT SIZE=2>Any idea to fixe this ?</FONT>
</P>

<P><FONT SIZE=2>More generaly, do you know about any approaches / guidelines to make an application</FONT>
<BR><FONT SIZE=2>more modular (defined in several packages that use one another)?</FONT>
<BR><FONT SIZE=2>Does Zope 2.2 address this issue at some point ?</FONT>
</P>
<BR>
<BR>
<BR>

<P><FONT SIZE=2>I have already tried to look at the code without any success.</FONT>
</P>

<P><FONT SIZE=2>For instance there are somewhere a few functions that can be relevant</FONT>
<BR><FONT SIZE=2>(open somewhat the namespace):</FONT>
</P>

<P><FONT SIZE=2>&lt;dtml-with manage_addProduct([anotherPackage])&gt;</FONT>
<BR><FONT SIZE=2>&nbsp; # namespace of the package anotherPackage is available for object creation</FONT>
<BR><FONT SIZE=2>&lt;/dtml-with&gt;</FONT>
</P>
<BR>

<P><FONT SIZE=2>&lt;dtml-with &quot;REQUEST.resolve_url(REQUEST.script + PointerToIUD)&quot;&gt;</FONT>
<BR><FONT SIZE=2>&nbsp; # the namespace of the package where the class of the object REQUEST.script + PointerToIUD</FONT>
<BR><FONT SIZE=2>&nbsp; # is define is available.</FONT>
<BR><FONT SIZE=2>&lt;/dtml-with&gt;</FONT>
<BR><FONT SIZE=2>&lt;dtml-except&gt;</FONT>
<BR><FONT SIZE=2>&nbsp; &lt;small&gt;???? (the object does not exist)&lt;/small&gt;</FONT>
<BR><FONT SIZE=2>&lt;/dtml-try&gt;</FONT>
</P>

<P><FONT SIZE=2>There are a few (python) function that seem to have something to do with namespace and acquisition,</FONT>
<BR><FONT SIZE=2>but it is not very clear for me how they have to be used. (in particular from within a dtml method).</FONT>
<BR><FONT SIZE=2>aq_acquire(), DT_Util.namespace(), ...</FONT>
</P>

<P><FONT SIZE=2>Thanks</FONT>
</P>

<P><FONT SIZE=2>Thierry Nabeth</FONT>
<BR><FONT SIZE=2>Research Fellow</FONT>
<BR><FONT SIZE=2>INSEAD CALT (the Centre for Advanced Learning Technologies)</FONT>
<BR><FONT SIZE=2><A HREF="http://www.insead.fr/CALT/" TARGET="_blank">http://www.insead.fr/CALT/</A></FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01BFEB0E.DEADAB3A--