The ADSI object model provides a client-side property cache for each ADSI object. An object's property cache enables client applications to set multiple properties in a single call. This capability is critical for clients written in languages, such as Microsoft Visual Basic, that have no native batching mechanism for setting properties. Without the ADSI property cache, such clients would have to hit the wire for each and every put call, with a predictable drop in performance.
Think of the cache as a table in memory that contains the names and values of all an object's properties. When an object is created, its property cache is empty. Calling IADs::GetInfo loads the object's properties from the underlying directory service. If a property is multi-valued, use the GetInfoEx method instead. If the cache is empty, calling get or get_propertymethod from a client written in C or C++, or calling .propertymethod from an Automation client, , forces an implicit GetInfo. Once the cache is filled, all get and put calls work on the contents of the cache only. You change the property values in the tables as necessary for your application using IADs methods or IADsPropertyList methods, then write the changes back out to the directory service when they are in a consistent state using SetInfo. After the SetInfo is called, the cache values remain until they are explicitly refreshed with a GetInfo. The following figure shows the different methods used to operate on the cache.
As shown in the preceding figure, while the property values are in the cache, you can access them in two ways:
Accessing an Individual Property in the Property Cache
Accessing All Properties in the Property Cache