Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

So, what to do when there is no data to satisfy a mandatory method? That all depends on what it means to the OSID Provider.

Let's use osid.org.resource.ResourceRelationship as an example and try to pretend absolutely no data exists in a database used by an OSID Resource Provider. This ResourceRelationship is broken, but it demonstrates how to be compliant with the specification. 

MethodReturn SyntaxReturn Value or ErrorComments
getId()osid.id.IdUnknownId

This is an implementation of osid.id.Id that identifies "I don't know." However, since every OsidObject is uniquely identified by its Id, there can only be one of these.

One should be able to: ResourceRelationshipLookupSession.getResourceRelationship(brokenResourceRelationship.getId())

If that works, then all is well as far as the OSIDs are concerned. But you have serious design issues if you can't figure out the identifier from your data store.

isCurrent()booleanfalsethis is connected to the nature of the implementation. Unless it is a real-time implementation where the information is current, the answer is always false.
getRecordTypes()osid.type.TypeListEmptyTypeListan osid.type.TypeList with no Types
hasRecordType(osid.type.Type)booleanfalsealways false if getRecordTypes() is empty
getProperties()osid.PropertyListempty listan osid.PropertyList with no properties
getPropertiesByRecordType(osid.type.Type)osid.PropertyListUNSUPPORTEDgetRecordTypes() is empty
getDisplayNameosid.locale.DisplayTextEmptyDisplayTextAn osid.locale.DisplayText with an empty string.
getDescriptionosid.locale.DisplayTextEmptyDisplayTextAn osid.locale.DisplayText with an empty string.
getGenusTypeosid.type.TypeUnknownTypeAn osid.type.Type that identifies nothing.
isOfGenusTypebooleantrue if the given Type matches getGenusType() 
hasEndReason()booleanfalse 
getEndReasonId()osid.id.IdILLEGAL_STATEthe end reason state is only available if hasEndReason is true
getEndReason()osid.process.StateILLEGAL_STATEthe end reason state is only available if hasEndReason is true
getSourceResourceId()osid.id.IdUnknownResource.getId()we don't know what this is, so let's make up a Resource and return that
getSourceResource()osid.resource.ResourceUnknownResource 
getDestinationResourceId()osid.id.IdUnknownResource.getId() 
getDestinationResource()osid.resource.ResourceUnknownResource() 
getResourceRelationshipRecord(osid.type.Type)osid.resource.records.ResourceRelationshipRecordUNSUPPORTEDgetRecordTypes() is empty, so we don't support any