WMI Data Organization

[Previous] [Next]

WMI offers a basic set of classes that organize how data should be presented to the user. By using these classes, you avoid much of the burden of schema design—all you have to do is extend the existing design. But you need to understand what WMI provides for free before you extend WMI to represent the special characteristics of your service.

WMI divides management information into categories, which are represented by some of the top-level classes in the WMI schema. These categories are operational data, setting data, statistical data, and historical data.

Operational Data

Operational data is concerned with current state and deals with questions such as "How much memory does the service require?" It represents what the system is actually doing and what it is capable of doing. For example, in the context of a service, the system might indicate whether the service is capable of interacting with the desktop, what the service's display name is, and so on.

Setting Data

Setting data represents desired state and configuration information and deals with questions such as "How much memory should the service use?" When you work with setting data, ask yourself questions such as these: "Is there more than one set of possible values for the property, and do certain values apply to different users or at different times?" These kinds of questions help you organize the data. For example, regarding the preceding questions, if more than one set of values exists for the property, you should separate the data into a separate setting class that provides this configuration information. In many cases you might find similar looking values in both setting and operational data.

Statistical Data

Statistical data answers questions such as "How much memory is the service using?" It is similar to operational data except that it represents infrequently requested statistical data that is useful for understanding performance but not essential for understanding the state of the managed object. Separating statistical data from operational data is essential if for no other reason than to avoid having to evaluate the statistics when accessing regular operational data.

Historical Data

Historical data answers questions such as "How much memory was the service using?" and represents past state. WMI does not provide a log that is intended for capturing large volumes of data, but it does provide a mechanism for delivering the data and a form that is appropriate for representing historical state, as you'll see when you look at events later in this chapter.

When considering whether to extend WMI, first determine whether WMI already supports the data you want to introduce. If it's already there, you don't do anything. If it is not, you figure out whether you are dealing with operational, setting, statistical, or historical data; find a suitable class; and then see whether the data is already populated with content that represents the type of data you are interested in. For example, if you are adding a new service, you will find that the service already turns up as an instance of Win32_Service. If you need to add new operational data, you should derive a new class by using Win32_Service as a base and then populate the derived class in an appropriate way (more about this in a moment).



Programming Server-Side Applications for Microsoft Windows 2000
Programming Server-Side Applications for Microsoft Windows 2000 (Microsoft Programming)
ISBN: 0735607532
EAN: 2147483647
Year: 2000
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net