[ZDP] BackTalk to Document Zope Developer's Guide (2.4 edition)/Object Publishing

webmaster at zope.org webmaster at zope.org
Sat Aug 16 13:56:10 EDT 2003

A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx#3-32


      The URL */basket/apple/numberOfItems* uses acquisition along
      containment lines to publish the 'numberOfItems' method
      (assuming that 'apple' doesn't have a 'numberOfItems'
      attribute). However, the URL */basket/carrot/apple/texture*
      uses acquisition to locate the 'texture' method from the 'apple'
      object's context, rather than from its container. While this
      distinction may be obscure, the guiding idea is to keep URLs as
      simple as possible. By keeping acquisition simple and along
      containment lines your application increases in clarity, and
      decreases in fragility.

        % Anonymous User - Jan. 11, 2002 11:58 am - typo /your/you/. What then is the positive side of aquisition, if its freedom is dangerous and a more restrictive name resolution would suffice?

        % Anonymous User - Dec. 5, 2001 9:23 am - Thus, the first URL returns the number of apples in the basket (i.e. 1)? And the second URL returns the texture of the carrot?

        % rogererens - Dec. 7, 2001 6:14 am - Read chapter 5, Acquisition first.  I think it's instructional to state that the first URL is equivalent to /basket/carrot/apple/numberOfItems. The number of contained items in the basket is 2 (a carrot and an apple).  Furthermore, the second URL uses acquisition by context because the method texture cannot be acquired by containment (i.e. not in apple nor in its container, basket). Please correct me if I'm wrong.

        % Anonymous User - Aug. 16, 2003 12:56 pm:
         I don't begin to comprehend all this guff - and why's it here anyway? Doesn't seem to add anything to the
         matter of publishing - I suggest it's best left to the real chapter on Acquisition...

More information about the ZDP mailing list