fetching the structure / obejctClass defs

Hans Aschauer Hans.Aschauer at Physik.uni-muenchen.de
Mon Jun 3 13:55:07 CEST 2002


On Montag, 3. Juni 2002 13:23, Michael Ströder wrote:

> I'd like to see a base class for a LDAP syntax with a method
> validate() which is called when setting the attribute value. More
> or less like I'm doing form parameter validation in PyWebLib. Also
> one could emulate comparison of values by implementing __cmp__().
> With such a vehicle it would be easy to implement new syntaxes by
> just implementing these two methods.

So this would mean that we change the implementation from "syntaxes are 
instances of the syntax class" to "syntaxes are subclasses an 
(abstract) syntax base class". Which objects would then instanciate the 
syntax classes? Maybe some kind of attribute class instances, through 
multiple inheritance?

This is btw. not the only place where we have to decide if we want to 
use inheritance or instanciation for schema information. The same thing 
holds for objectClasses, etc! For objectClasses, inheritance seems to 
make sense, since they inherit from each other, and I think it would be 
possible (in python), to build a class hirachy from server information 
"on the fly". However, this is quite contrary to what I am used to (and 
I think many other programmers, too): Usually, I consider the class 
hirachy as part of the API, which is static.

> You hit one of the famous problems in schema handling. The good
> news is that it seems you understood the problem... ;-)

Too bad. Seems to be a lot of work, then!

-- 
Hans.Aschauer at Physik.uni-muenchen.de





More information about the python-ldap mailing list