| Re: [higgins-dev] IdAS: The contract CP's must follow for incomingobjects |
|
Jim,
> So, how does an IdAS consumer get an object to pass to one of
these methods? To date, we've said that they have to get them
> from the context provider -- this is why we have IContext.build*
methods (IContext.buildAttribute for example will build an IAttribute
> instance which could then be passed to IContext.addSubject. On
thee other hand, there are Basic implementations (like
> BasicAttribute) that are easy to instantiate without the help of a
context instance.
1. I do not think it is useful to have BasicComplexValue and BasicArttribute. Their type and
content (properties, values) depends on used higgins schema. So, when
we create "in-memory" instance of ComplexValue or Arttribute
we need to validate its type. We need to validate the type of
value/property which we add to "in-memory" ComplexValue or Arttribute. So I prefer to use Context.build...() methods
for ComplexValue and Arttribute.
2. I am unable to answer what is better - to
have a set of BasicSimpleValue classes such as BasicValueInt,
BasicValueBoolean etc. or one IContext.buildSimpleValue(). I have some
proposals for ISimpleValue:
a) The type of object returned
by getData() should unambiguously correspond to xml type returned by
getType();
b) We may to define default xml type
for some java classes to allow the user to pass
null type into IContext.buildSimpleValue(URI type, Object value) method.
For example, if user pass null type and java.util.Date, this
method should create BasicValueDateTime
instance. c) Add to ISimpleValue a
list of static public constant URIs of used xml
types. User will use this to pass the type of SimpleValue to
IContext.buildSimpleValue(URI type, Object value) method.
d) BasicValueDateTime need to have
BasicValueDateTime(java.util.Date obj) constructor.
Thanks,
Sergey Lyakhov
|