Write to Byte
Editorial Calendar

Categories
Previous Editions
Columns
Features
Audio



Resources
BYTE Forums
WebTools
Java Resources
Downloads
History Of Byte

BYTE Humor
Ian Shoales' Page

Print Archives
By Issue   By Topic

About Us
Byte Editorial Staff
Sales Staff
Privacy Policy




Search DDJ

DDJ Links

ARTICLES
SOURCE CODE
DEVSEARCHER
TECHNETCAST
BOOK REVIEWS
OP-EDS
COMMUNITY UNIVERSITY
MICROPROCESSOR RESOURCES
MACINTOSH DEVELOPER
HISTORY OF COMPUTING
MAILINGLISTS




Tangled in the Threads

BYTE Magazine > Tangled in the Threads > 2001 > June

Nature vs. Nurture

(Nature vs. Nurture:  Page 1 of 3 )

In This Article
Nature vs. Nurture

Examples Of Acquisition

A Glimpse Of The Deep Magic
A newsgroup thread that has influenced two earlier columns on document engineering and the future of the file system -- continues to unfold in thought-provoking directions. Of course, as Rich Kilmer reminds us, these paths were trodden long ago:

Rich Kilmer:

I'm reminded of the Memex idea of Vannevar Bush. All the way back in 1945, he realized that the ultimate system was one that allowed the storage of associations between objects.

To me, context is the collection of meaningful associations between objects. An object's ontology (what it is) defines its basic attributes and behavior, but it exists in a Web of contextual links. If both of these things were standardized, itwould let tools that operated on specific types of ontological objects (messages or people or orders) interoperate via the contextual linkages. Order-management systems would then just focus on order management, and messaging systems would focus on messaging ... but both would extend a common context. Then new tools could emerge that let us benefit from the context between and around these things.

Although the ideas in that prescient paper by Vannevar Bush have been kicking around for a long time, the technologies that let us implement them may only now be emerging. One of these, as Patrick Phalen points out, is acquisition, at once the most powerful and mystical feature of Zope.

Patrick Phalen:

Jon has elsewhere brought up Zope's concept of containment through "Folderishness." Zope folders are also informed by notions of environmental acquisition and its powerful means of context control, perhaps best explicated here:

http://www.cs.technion.ac.il/Labs/Lpcr/publications/lpcr9507.html

Here is the abstract of that seminal paper, Environmental Acquisition -- a New Inheritance Mechanism, by Joseph Gil and David Lorenz:

Nature vs. Nurture? The debate has obsessed the minds of psychologists and philosophers for many years. However, for the object-orienter, it has never been a problem: an object inherits all of its properties. In this work we ask if an object should not be subject to environmental effects. We answer this question in the affirmative by demonstrating many cases in which the character of an object must be affected by the environment it is put in. We present a new abstraction mechanism -- Environmental Acquisition -- which allows a component to inherit properties from its enclosing composite(s).

Why would this technique be useful? The authors point out that "there are abundant cases of containment hierarchies where contained objects have different behaviors depending on their surrounding environment." Although acquisition as an object-oriented programming discipline is wildly complex and esoteric, its uses are common and familiar. Here are two cases they cite: In a GUI system, the coordinates of a button within a dialog box are acquired by virtue of the button's containment within the dialog box, not by virtue of an inheritance relationship. In LATEX, emphasized text normally prints as italic, but prints as roman if contained within an emphasized block.

I now must confess that although I am a Zope user, and have written a lot about Zope, Patrick's reference was my first introduction to the formal concepts underlying acquisition in Zope. That research, Patrick says, suggested to Zope architect Jim Fulton a way "to handle authorization issues that inheritance couldn't."

Patrick Phalen:

Zope sets out to implement a fine-grained, hierarchical security model. Zope is an object-oriented system, so the primary operation is attribute access. Zope allows access to any attribute with a non-elementary datatype to be protected individually by a permission. Zope does not associate permissions with individual users, but rather with roles -- an abstraction. If security were built out of "is-a" inheritance stuff, users could conceivably override attributes of security-defined objects from higher up. Acquisition works the other way around. You can't have an object at the top whose contents can be overridden as you go down. Acquisition permits aggregating permission data in a global and secure way.

This explanation, Patrick hastened to add, only scratches the surface. For more information, he referred us to the environmental acquisition page maintained by David Lorenz, which gathers a number of useful links, and includes these pithy comments:

David Ascher:

It's very cool, somewhat non-trivial to use right (it affects the way one designs massively), and requires a fairly deep brain-tweak. Still, worth knowing about when designing a new framework where containment is such an important notion. It's one of the few "new" concepts in programming that I've seen in the past few years that I think has huge potential for simplifying complex designs.

Samual A. Falvo II:

What Zope describes in several pages of text, I can describe in two sentences: "If the file or variable isn't defined in the current folder, check the parent folder. If it's not there, continue checking parent folders until you can't anymore." This is also true of properties as well as files.

These two comments nicely bracket my experience with acquisition in Zope. On the one hand, it does require a "deep brain-tweak," which I feel I have yet to really achieve. On the other hand, I've been using acquisition without really thinking much about it. In this respect, Zope reminds me of Perl. Both are large and complex programming environments. But when I started with Perl, I was able to get useful results without really understanding more than a fraction of all that Perl was and could do. And it's been the same way with Zope. It has the excellent property of "discoverability" -- that is, you can build simple things in simple ways, without knowing about the deep magic, and then gradually over time begin to discover and apply the deep magic.


 Page 1 of 3 

BYTE Forums
Want to talk about this article?

 Tangled in the Threads
 


CMPnet


 

 

www1