5.3.1 Enumeration Behavior

Active Directory providers can follow one of three models for caching collections during enumeration. The caching model affects the behavior of Active Directory when an object in a collection is deleted from the underlying namespace "outside" of Active Directory.

Regardless of the caching model implemented by a given provider, it is important to note that Active Directory enumeration returns Active Directory interfaces to the caller. Active Directory applications should cache the returned interface pointers for any object(s) they intend to manipulate, to avoid the overhead of obtaining a new interface pointer. For example, a Visual Basic program that enumerates a container and populates a listbox with names can cache the interface pointers associated with the names for later use. This approach will provide greater performance than populating the listbox during enumeration and obtaining a new interface pointer when the user makes a selection.