Domaining using classes.

Klaus D. Witzel klaus.witzel at cobss.com
Thu Aug 24 08:44:18 UTC 2006


On Thu, 24 Aug 2006 09:46:18 +0200, Alexandre Bergel wrote:

> Sorry to answer so late, I got few emergencies in my work.

So we have to thank you twice for your response :)

> The technique you describes, Classboxes and selector namespace are  
> similar somehow. They provide way to (i) support changes in an  
> unanticipated ways and to (ii) obtain a better modularity of cross- 
> cutting concern. Note that these techniques are not alone, family  
> polymorphism (i.e., the gbeta programming language), virtual classes  
> (i.e., caesarJ), mixin-based inheritance (i.e., Units in MZScheme) help  
> in achieving similar goals.
>
> The differences between those systems reside in some very subtle detail  
> in their semantics. In your example, what happens if a a method in the  
> "bd" domain calls a method foo in the "ad" domain. Now ad.foo call bar,  
> which is defined in both domain.

In domaining using classes, this is exactly what is wanted, all behavior  
(=methodDict's) is shared at the oop level, no copy hangs around :)

> Which one get invoked ?

Domain a and domain b have precisely the same superclass (oop). So the  
answer is: always the right one, since there exists only one implementor.

/Klaus

> Depending on the answer, you have the behavior of Classboxes or selector  
> namespace. If you want more about those difference, I can point out a  
> paper we wrote on it.
>
> Regards,
> Alexandre
>
>
> Am Aug 12, 2006 um 4:45 AM schrieb Klaus D. Witzel:
>
>> On Sat, 12 Aug 2006 03:41:17 +0200, Michael van der Gulik wrote:
>> ...
>>> In other words, each domain has its own set of classes, but each class  
>>> shares its instance variables (methodDict, instanceVariables,  
>>> superclass, format etc) with other classes of the same... er... class.
>>>
>>> I could probably cludge up some Namespacing or other magic to get  
>>> "Person" to resolve to the domain's local version of the Person class,  
>>> so you don't need to use "adPerson" and "bdPerson" but just "Person".
>>
>> Have you considered using classboxes for that, see
>>
>> - http://citeseer.ist.psu.edu/684648.html
>>
>> Though classboxes is about local methods, it can be put to use for  
>> "just" local classes.
>>
>> /Klaus
>>
>





More information about the Squeak-dev mailing list