[E-Lang] static typing
Dean Tribble
tribble@e-dean.com
Tue, 19 Jun 2001 11:40:25 -0700
>I'm having trouble reconciling this point of view with another one.
>The other view says a BrandMaker creates an abstract datatype -- the
>sealer is the constructor, the unsealer is the accessor. When you use
>unsealers or vouching you're making sure an object is of the right
>type so you can trust its implementation of the protocol for that
>type. (It only has that implication if the type constructor is
>closely held, of course.)
Good question. When you use a BrandMaker, you are making sure that an
object is of the right *implementation*, not type. There may be several
implementations of bank account out there that you don't trust. The brand
gives you assurance that it is an implementation that you trust. The fact
that you know the implementation does typically mean you also know the
type, but that's an incidental convenience (OK, it's a little more useful
than that :-).
>Is this a bad way to think about it? AFAIK it's my own idea coming
>from reading examples and no actual experience.
In spite of what I said above, I often think of it this way too. By
controlling access to the unsealers, you can have several implementations
that obey the same type. Note however that you can just as easily use the
brand to indicate *only* information about the implementation, simply by
sharing the brand among multiple types by the same provider (e.g., Acme
desert topping vs. Acme floor wax--different types, but they both explode...).