[Zope3-dev] zwiki: performance of findChildren()

Shane Hathaway shane@zope.com
Tue, 06 May 2003 10:44:24 -0400


Tres Seaver wrote:
> Weren't you arguing that (apparent, at least) attribute access was an
> absolute requirement?  I don't see how to achieve that goal without
> either:
> 
>   - Coupling the two classes directly,
> 
> or:
> 
>   - Wrapping the class to simulate the attribute access, hiding the
>     existence of the adapter.
> 
> Also, I think I misunderstood you to say that you were pondering
> solutions which wouldn't require the component architecture.

Sorry, I must have made it unclear somehow.  I understand now why it 
seemed magical.  I don't mean for objects to have attributes that their 
classes do not define.

Programmers should have the option of writing a class something like this:


class Student:
     courses = RelationshipView()


If the author of the Student class chooses to do this, the expression 
"somestudent.courses" yields a set of course objects.  If the author of 
the Student class chooses not to provide this descriptor, people who 
need to find out the current registrations for a student will need to 
get that information another way, such as through the component 
architecture.

The requirement is that programmers be able to write classes with or 
without relationship descriptors.

(I'm not sure about the name RelationshipView.)

Shane