Critical changes to DocumentStructure implementation

Coordinator
Mar 2, 2013 at 9:05 AM
Edited Mar 2, 2013 at 9:08 AM
In the past, we defaulted document key parts such as Reference to a new Paragraph, like
class DocumentStructure 
{
   Paragraph Reference = new Paragraph();
}
to make it easier for developers to build essay checkers (so they don't need to check Null when processing such elements). However, problem arises when a document is missing a required part like abstract or menu. In this case, this default is not feasible as it may create a illusion that results in the misbehave of our checkers. Say our FixedDocumentElementOrderChecker, which is responsible for checking the presence and relative position of document parts(for example, this checker checks if an abstract presence), is processing a document without an abstract, will falsely reports that documentStructute contains an abstract, since abstract isn't null. Although this can be mediated rapidly by further testings(like checking inner text to see if the paragraph is empty), still many problems surface as we code. Therefore, this default is no longer valid and paragraphs will be defaulted to null.
class DocumentStructure 
{
    Paragraph Reference;
}
Checkers should now be aware that they need to deal with null values now ;)

Sent from my Windows Phone