Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] Stored versus in-memory IProperty instances (was: IdAS is now Java 1.4)

>>> "Sergey Lyakhov" <slyakhov@xxxxxxxxxxxxxx> 3/27/07 10:51 AM >>>

<snip>

>I think we need to create a new "stored" instance of IProperty for each stored Digital Subject regardless of which type of IProperty ("stored" or "in-memory") was passed to setValue(). In this case there will be no any two or more Subjects which refers to the same "stored" instance of attribute, metadata or value.
 
I'm trying to envision what this would look like. Let's use some sample code to talk about it:
 
IDigitalSubject mySubject1 = myContext.getSubject("subject1");
IDigitalSubject mySubject2 = myContext.getSubject("subject2");
IAttribute myAttribute = mySubject1.getAttribute("eyeColor", null);
 
// At this point, is myAttribute associated with MySubject1 in terms of updates?
// In other words what happens here, does it only affect the in-memory copy, or does it also affect mySubject1?
// I think you're opinion is that this should affect mySubject1.
myAttribute.setValue(buildSimpleValue("http://www.w3.org/2001/XMLSchema/normalizedString","blue";));


// Next, I assume all would agree that this would add the entire myAttribute to mySubject2
Vector v = new Vector();
v.add(myAttribute);
String s = myContext.addSubject("http://...#person";, "mySubject2", v, null);

// Here's where I'm confused.  Does this affect mySubject1, mySubjet2, both, or neither?
myAttribute.setValue(buildSimpleValue("http://www.w3.org/2001/XMLSchema/normalizedString","brown";));

Jim



Back to the top