Hello,
Typically it's a service class as a method container and attribute class
with the parameters each per instance.
----- Original Message -----
From: "John Dennis" <jdennis(a)redhat.com>
To: openlmi-devel(a)lists.fedorahosted.org
Sent: Monday, February 25, 2013 8:06:03 PM
Subject: Re: What is the best way to model a name/value pair in CIM?
On 02/25/2013 01:14 PM, Klaus Kaempf wrote:
Hi John,
* John Dennis <jdennis(a)redhat.com> [Feb 25. 2013 18:52]:
> In the provider I'm writing lists of key/value pairs are needed in a
> few different contexts (as a parameter to a method, as an instance
> property, etc.).
>
> In CIM what is the best way to to model a name/value pair? In CIM I
> dont' think there is any mechanism by which the value can be of an
> arbitrary type (right?). Therefore lets assume both the name and
> value are strings.
can you be more specific about what you're trying to accomplish ?
Do you have an example ?
Certainly. The CIM provider is an interface to an existing RPC based
API. In that API some of the methods accept a "dictionary" of optional
parameters used to control the behavior of the methods. The set of valid
keys in that dictionary is subject to extension. Enumerating every
possible name in the options parameter would yield a CIM method
signature with a large number of parameters, most of which would be
unused and the method signature would need to be changed anytime a new
key of the dictionary was added. Thus the most effective mechanism would
be for the CIM method to accept a single parameter which is a set of
name/value pairs.
Some of the results from the RPC are name/value pairs. Once again, they
are not fixed, they are subject to extension. The idea was to define a
CIM class which along with other properties would also define a property
which was a set of key/value pairs.
The approach CIM takes is to model everything as a CIM class. Either
as an instance class or as an association class.
So when I explicitly asked this question:
> Is the best approach to define a new class that has just a name
and
> value property?
Then why not just answer, yes that is the correct approach?
Maybe you need to get back to the drawing board and spent some time
on
more modeling, so that you can replace the need for key/value lists
with actual classes.
Because it's not obvious to me how sets of arbitrary key/values would be
modeled as a pre-defined class(s).
--
John Dennis <jdennis(a)redhat.com>
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
_______________________________________________
openlmi-devel mailing list
openlmi-devel(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/openlmi-devel