[Xotcl] Re: XOTcl is great!!

Kristoffer Lawson setok at fishpool.com
Mon Sep 5 12:02:48 CEST 2005

On 5 Sep 2005, at 12:14, Gustaf Neumann wrote:

>> (3) Is there any way to represent relationship across two classes?  
>> For example, Class A is related to Class B with one-to-many  
>> relationship.
>  a few class/class relations and object/class relations are  
> maintained by xotcl (e.g. superclass,
>  class, mixins).  A start point might be ::xotcl::Relations, which   
> is used to implement a
>  uniform interface to mixins (and instmixins ...), which allows to  
> specify "... mixin add ...",  #
>  "... mixin delete ...", "... mixin set ...", etc. In principle,  
> the same interface could be used
>  for application level relations as well...
> In current applications, the classes use and maintain a list of  
> related object/classes.
> Often, it is conveniant to use aggregations to express 1:1 or 1:n  
> relationships.

I was thinking about using packages to collect classes together. The  
problem with this is that classes are not automatically searched for  
in the same package. That is if Class A depends on Class B (A is B's  
sub-class), B needs to be read in before A is read.  In Java it is  
enough that they are in the same package, they'll be found. With  
XOTcl you need to build a kind of stub file that represents the  
package and which then sources in all the other necessary files in  
the required order.

Whether this helps or not, I don't know...

            /  http://www.fishpool.com/~setok/

More information about the Xotcl mailing list