Protocols

Marcus Denker denker at iam.unibe.ch
Sun Aug 1 22:03:48 UTC 2004


Am 01.08.2004 um 11:15 schrieb Marcin Tustin:

>     I've seen the term "protocol" bandied about in documentation,
> and I understand it to refer to the entire set of methods exported
> by a class. Is there a corresponding language-feature that
> aggregates sets of methods (or just their interfaces) such that
> they can be added to a class, like a mixin
>
>

No. Protocols are only used for documentation. So it's just a feature of
the development environment to allow the developers to sort methods to
not get confused.

Categories are no objects, and they have no semantic meaning for the 
language.

If you want "mixin" like functionality, have a look at Traits:

http://www.iam.unibe.ch/~scg/Research/Traits/

There is now a new implementation of Traits that you can load with the 
Package Loader
(package Traits). This recompiles the whole image, so installation will 
take some time.


     Marcus




More information about the Squeak-dev mailing list