Behaviors vs Modules
Jecel Assumpcao Jr
jecel at merlintec.com
Fri Feb 22 22:04:35 UTC 2002
On Friday 22 February 2002 23:38, Anthony Hannan wrote:
> - A Smalltalk expression now knows, via the selectors it calls, which
> protocols and corresponding default behaviors it depends on. So
> starting from a Smalltalk expression we can trace selectors and
> methods recursively and load all default behaviors that will be
> needed.
Two slight problems:
1) #perform:
2) if #foo is used in only one protocol in your system, you don't
have to say which one that is, right? Now imagine that you send your
module to me and I load it into my system which also has a #foo in only
one protocol, but it happens to be a different protocol from yours!
But I do very much like the idea of protocol objects, specially if they
are used as factories instead of direct class references. It would be
great if an application simply said that it needed a new object with
the socket protocol and it got a fully compatible one that happened to
be the user's favorite. Think about asking for "a web browser" instead
of "IE 5.5 SP2". Direct class references in the code are a case of
overspecification and will cause us lots of problems in the future, so
I don't think a new syntax for making them easy (see other thread) will
help.
-- Jecel
More information about the Squeak-dev
mailing list
|