----- Original Message -----
Sent: Tuesday, March 27, 2007 4:27
AM
Subject: Re: [higgins-dev] IdAS is now
Java 1.4
>>> "Sergey Lyakhov" <
slyakhov@xxxxxxxxxxxxxx> 3/26/07
2:17 PM >>>
>Jim,
>
>Now IProperty interface
doesn't contain setValue method. As a result we
>unable to change a
value of Attribute or Metadata directly. As I understand
>we need to
use new UpdateOperation object to update a value of Attribute or
>Metadata of DigitalSubject. We need to make a lot of changes to
implement
>new interfaces but it looks more complicated in using
comparing with
>previous version. Please explain which benefits we will
have using this
>approach.
Let's assume there was a setValue method on IProperty. What are the
exact semantics of it?
- If the IProperty instance was gotten by the IdAS consumer by calling
IDigitalSubject.getAttribute, would setValue cause that value to be updated on
the underlying data at that point in time?
- If the IProperty instance was gotten by the IdAS consumer by calling
IDigitalSubject.getAttribute.getMetadata, would setValue cause that value to
be updated on the underlying data at that point in time?
- Same question for all other interfaces which extend IHasMetadata.
Those are the easy questions, this is where it gets ugly:
- If the IdAS consumer got the IProperty instance from
IContext.buildAttribute, and then called setValue, we can assume it sets the
value only on the in-memory IProperty instance (I think)
- If the IdAS consumer got an IProperty instance from
IContext.buildAttribute, then used that IProperty instance to call
IContext.addSubject, and after that called setValue on the IProperty instance,
does that update the value on the new subject in the context?
- If the IdAS consumer uses the same IProperty instance when creating two
Digital Subjects (via IContext.addSubject), and then calls setValue on that
IProperty instance, does it update both Digital Subjects?
- If the IProperty instance was gotten by the IdAS consumer by calling
IDigitalSubject.getAttribute, and then used that IProperty instance to create
a new Digital Subject, would setValue update both Digital Subjects?
If we allow IProperty instances to be used to update the Digital Subjects
to which they are associated, it means Context Providers will need to maintain
associations between IProperty instances and the Digital Subject(s) to which
the IdAS consumer has associated them. Further, there is nothing for the
IdAS consumer which would indicate whether calling setValue will cause an
immediate update to backing data.
All of these questions had been asked at one point or another and
remained unanswered when I began refactoring the update operations.
Rather than leaving them unanswered, I removed the set* methods. When we
decide what the exact semantics are, and find useful applications, we can
re-introduce them.
My preference would be that IPropertyValue.setValue only update that
instance of IPropertyValue and some other method would have to be called to
update any backing data store. This might make things unnecessarily
cumbersome for a CP which only deals with in-memory objects, but I think it
would be better for most other CP's. What do you think?
>Also I do not see how we will update a metadata value of
>Attribute.
> Also I do not understand how we can update an Attibute of
>DigitalSubject using UpdateOperation if this subject has a few
Attributes of
>the same type.
I assume you're asking how the IdAS consumer distinguishes among those
Attributes (all of which have the same type.
The UpdateOperation has (in this case), an IAttribute instance.
Each Attribute in the data model is distinguished by it's Attribute Type +
Metadata combination. The IAttribute would actually have to be populated
with it's type and all the metadata in order to distinguish it from other
attributes of the same type.
I note that this seems cumbersome to some people (Tom and I had a long
talk about it a week ago, neither of us like it much). This is a case of
the data model driving the design. We may want to revisit this aspect of
the data model on this week's phone call.
Again, thanks for the good feedback -- this is really helping to move
things along.
Jim
_______________________________________________
higgins-dev mailing
list
higgins-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins-dev