[Zope3-dev] Notations for paths
Florent Guillaume
fg@nuxeo.com
19 Dec 2002 18:15:05 +0100
On Thu, 2002-12-19 at 18:01, Phillip J. Eby wrote:
> >So, there are special functions for correctly converting between the
> >string form and the tuple form.
> >
> >I've had to correct a number of bugs where the naive conversion had been
> >used. These bugs were somewhat tricky to track down, becuase the effects
> >didn't point to this as the obvious cause.
>
> I think you missed my point. This is *precisely* why Zope shouldn't use an
> unencapsulated representation like tuples for this in the first place!
>
> Nobody should be doing any conversions directly. There should be a
> location class, and only strings or instances of the location class should
> be allowed. Code which uses locations should invoke the location
> constructor on any input, to ensure that strings become locations.
Why go to those lengths when we can have a perfectly effective location
as a tuple of names in trivial bijection with a string?
Florent
--
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com