Menu

#22 api and implementation inconsistent: WsmoFactory.getOntolog

open
nobody
None
5
2008-05-21
2008-05-21
No

In Javadoc, it says the method
WsmoFactory.getOntology() "Returns existing Ontology
instance" but the parser expects that if no existing
instance is found, this method returns some kind of
proxy reference. This is used for imported ontologies -
the parser will call ont=getOntology(id) and then
TopEntity.addOntology(ont) without checking if ont is
null. WSMO4J doesn't return null, my implementation
does (because I didn't know I shouldn't) and things
break because one cannot import a null ontology.

I suggest that the parser doesn't rely on non-null
getOntology but that it instead uses createOntology
because an imported ontology does in fact mean that
there is such an ontology and that should mean a new
Ontology object.

Comments: The documentation on this bug is quite detailed, so I spoke to Jack who filed it. My conclusion is that the ‘Proxy’ based place-holder mechanism that was implemented in the parser was never fully explained or documented and this in-complete documentation has led to both misunderstanding and frustration. So this bug, along with several others, can be closed and a new ‘feature’ request filed that addresses documentation of the ‘Proxy’ based mechanism implemented in the parser.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB