Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] Editing multi-valued attributes (was Re: Some changesto IdAS proposal)

Jim,
 
>> b)    we can't foreknow which value will be returned by getValue() method if
>> Attibute has two or more values;
 
> For (b), I don't know that anyone likes this method.  It has been suggested a number of times to just delete it.  I'm beginning > to prefer this as well.
 
I think that in most cases Attribute only contains single value and this method (getValue()) is very convenient. May be we need to add some mechanism based on cardinality restictions to define possible count of values and some methods like getValuesCount(), getValue(int index), setValue(int index, IPropertyValue value), addValue(IPropertyValue value).
 
Thanks,
Sergey Lyakhov
----- Original Message -----
Sent: Tuesday, February 27, 2007 1:43 AM
Subject: [higgins-dev] Editing multi-valued attributes (was Re: Some changesto IdAS proposal)

Hey Sergey,
 
I'm going to make threads for each of these

>1. I propose to remove the method getValues() from IProperty interface.
>There are some reasons to do it:
>
>a)    We need to be able to change a value of Attribute (that extends
>IProperty interface), but we can't say exactly which value will be changed
>in case if Attibute has two or more values;
>b)    we can't foreknow which value will be returned by getValue() method if
>Attibute has two or more values;
>c)    this method (getValues()) has no any sense in case of complex value
>because we unable to set more then one complex value for attribute;
For (a), yes, this is a problem with the current way update APIs are defined.  Update APIs need to be fixed.  We've been talking for some time about refactoring update operations such that one can build up sets of modifications.  In such a model, to change a particular value one would perform an update operation on a digital subject, where the update set contained two modifications.  For example, let's say there's an attribute called "phoneNumber" and it has two values "888-525-1111" and "888-332-8471".  One would build an update set like this:
{ delete("phoneNumber", "888-525-1111"), add("phoneNumber", "888-555-1212") }.  This is just an abstraction of the update set argument. The intent is to allow multiple sub-updates to be grouped as an atomic update operation.  It works well because it not only lets us specify *which* value we're working with, it also allows us to assert that a particular value exists prior to being changed.
 
For (b), I don't know that anyone likes this method.  It has been suggested a number of times to just delete it.  I'm beginning to prefer this as well.
 
For (c), why are we unable to set more than one complex value for an attribute?
 
Jim


_______________________________________________
higgins-dev mailing list
higgins-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins-dev

Back to the top