Skip to main content

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

Jim,

// 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);

I think we should consider myAttribute as a parameter by value not by reference. For mySubject2 we should create its own attribute instance, not just set a reference to myAttribute. So there should not be any two DigitalSubjects which have a reference to the same attribute/value instance.

// 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";));

I think we should separate two possible situations:

1. Attribute is "in-memory" instance created by IContext.buildAttribute(). In this case IAttribute.setValue() shouldn't cause any changes for DigitalSubject. In other words setValue() for "in-memory" attribute should invoke only "in-memory" changes for this attribute.

2. Attibute was returned by IDigitalSubject.getAttribute(). In this case it is "stored" attribute and its value should be changed.

Thanks,
Sergey Lyakhov
----- Original Message ----- From: "Jim Sermersheim" <jimse@xxxxxxxxxx> To: "'Higgins (Trust Framework) Project developer discussions'" <higgins-dev@xxxxxxxxxxx>
Sent: Wednesday, March 28, 2007 12:23 AM
Subject: [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

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


Back to the top