On Tue, 29 Feb 2000, Damian Morton wrote:
On Tue, 29 Feb 2000, Damian Morton wrote:
I can quite happily traverse the object and its inheritance tree using obj.__dict__ and obj.__class__.__dict__ and obj.__class__.__bases__ and such, but there seem to be a whole bunch of attributes and methods available for objects that I can only guess at. I assume they are acquired rather than inherited. Not being really familiar with acquisition (even after reading all the available docs), any tips on how best to traverse the acquisition path on my search for attributes and methods would be greatly appreciated.
From: Jeff K. Hoffman [mailto:jeff.hoffman@goingv.com]
It is very hard to come at Zope and say, "Show me all of the possible methods I could apply on this object through acquisition." It is quite easy, though, to say, "Can I call this method on this object, through natural means or through acquisition?"
Hmm, I find myself wanting learn as much as possible. When Im looking at a given object, I can learn heaps by examining all of the methods related to the object. Thats the power of object-orientation.
One of the powers, yes. Others of note would be encapsulation, inheritance, polymorphism, etc.
Being able to take a stab at a method name, and then asking how to apply it to my object seems very weird to me, especially given my meagre knowlege of the possible methods.
In re-reading my message, I realize that I may have mis-stated the reality. You can't ask Zope, "Given this method name, which means will you use to apply it: Normal or Acquisition?" What you have, instead, is, "Given this method name, try normal application first. If that doesn't work, try acquisition. If that doesn't work, throw an exception." Perhaps others would be better equipped to instruct you on how to learn. Myself, I read the Zope source code and look at how other parts of Zope are implemented (the management interface itself is implemented in Zope; there is nothing special about the management interface that you couldn't do yourself.)
For a beginer, the options need to be laid out and explored, that how I like to learn.
I would argue that, for most purposes, the methods and attributes of an object are the most important things for you to know. Methods are acquired, yes, but not as often as they are called directly. IMHO.
Im really not sure how to approach learning Zope given the current state of the documentation, and the seeming impossibility of the object browser I seek.
I know Amos is working on documenting the Zope APIs. This will go a long way towards delivering the help you desire. The object browser has been discussed on this list in the past, and was discussed at IPC8. It ain't gonna happen, unless something changes.
Am I missing something? (othe than a complete mastery of the subject)
A good understanding of acquisition goes a LONG way. Other than that, exploring stuff that already works (learning by example) is a good way to go. The documentation IS helpful; I am training our webmaster in Zope, and he has had the reference/tutorial manual we got at IPC8 by his side for the last week. During that week, coming from a proprietary platform with zero Zope experience, he implemented a web chat room (using ZODB for persistence; he did not use SQL because he wanted to learn Zope), and a few other cool doodads. Needless to say, I was impressed. Lastly, this list is an incredible resource. In the short time I have been involved in the community, I have seen a number of people go from newbies asking "stupid" questions to experts answering the "stupid" questions of others. It's all a matter of persistence, at this point. --Jeff --- Jeff K. Hoffman 704.849.0731 x108 Chief Technology Officer mailto:jeff@goingv.com Going Virtual, L.L.C. http://www.goingv.com/