Domaining using classes.

Klaus D. Witzel klaus.witzel at cobss.com
Thu Aug 24 16:35:32 UTC 2006


On Thu, 24 Aug 2006 16:14:05 +0200, Alexandre Bergel wrote:

> Klaus wrote:
>> Initially, "domaining using classes" has only a Person class. This  
>> class (and all other classes in the same image) belong to the single  
>> #system domain by default.
>>
>> When an #employee domain or #student domain is created, instances of  
>> Person become member of the respective domain as follows:
>>
>>  employeePerson := (Person clone nowYouClonedClassBelongsToDomain:  
>> #employee) new.
>>  studentPerson := (Person clone nowYouClonedClassBelongsToDomain:  
>> #student) new.
>>
>> Observe when and where #new is executed. Then,
>>
>>  (employeePerson domain) printIt => #employee
>>  (studentPerson domain) printIt => #student
>
> What is the difference between this and a classical namespace ?

Several differences are at work here:

- Squeak doesn't have such thing
- same class (#clone) is in multiple name spaces, what other system does  
that?
- Michael van der Gulik, the first potential user, "just" wants to  
partition object memory into domains (by coloring classes, as discussed  
with you in Bern)
- the domained instances have only a "thin" change: just their class  
pointer differs between domains
- behavior is the same in all domains

> With namespaces I would have:
> employeePerson := Employee.Person new.
> studentPerson := Student.Person new.

Nice. In which system (language, programmable) is this fully supported  
(having only one class object named Person)?

> (employeePerson class namespace) printIt => #employee
> (studentPerson class namespace) printIt => #student
>
> What is the impact of domaining on the method lookup ?

At the current stage of discussion: none, but that will change as soon as  
the next idea arrives :)

/Klaus

> cheers,
> Alexandre




More information about the Squeak-dev mailing list