Referring to packages

From: Patrick Robinson (ipor20_at_central.sussex.ac.uk)
Date: 07/29/04


Date: 28 Jul 2004 21:51:12 -0700

Can anyone explain how i can refer to another package that is at the
same 'level' in the directory structure as the one doing the
referring. i.e given the package structure: -

       basedir
       | |
package1 package2

how can i gain access to a class within package2 from within a source
file from package1 -- i only seem to b able to access classes within
packages/directories that are BELOW the package doing the referring.
In the context im thinking of i have a GUI package and a number of
DATA packages - i want the GUI classes to be able to access DATA
classes but also want DATA packages to refer to one another -- its not
essential that the classes are organized this way but seems like a
'common-sense' way of dividing up my classes to make them more
manageable.

cheers

P@



Relevant Pages

  • Re: whats the difference between : and :: ?
    ... You can use:: to refer to symbols in other packages that author ... symbol--one the package exports for public use. ... a double-colon name lets you get work done ...
    (comp.lang.lisp)
  • Packages
    ... Suppose I have a package P with modules A.py, B.py, and C.py. ... If I write an external Python program H.py, then I can refer to ... external Python program or referring to class X from a ...
    (comp.lang.python)
  • Re: How to call a class from another class
    ... and 2 attorney object instances. ... Classes in the default package are *automatically* ... refer to another, then you have to make sure the class /does/ refer to an instance of that other class. ... Presumably all this is ocvered in your lecture notes? ...
    (comp.lang.java.help)
  • Re: ANN: listbox 0.0.1 (alpha)
    ... > listbox package for Tcl/Tk ... Can you tell us about the features that add ... > Please refer to the file index.html included in the 'doc' directory ... > The listbox package and all accompanying material is: ...
    (comp.lang.tcl)
  • Re: access control
    ... The downside is that for all the other classes in the package I have ... Have your package define an interface that A implements. ... your other classes can refer to an object of class A via: ... C myA = methodThatReturnAnObjectOfClassA; ...
    (comp.lang.java.help)