Download Final Report --

Transcript
Error$ErrorType Rule$NodeStackElement
CHAPTER 6. IMPLEMENTATION
104
Error
Error(ErrorType , ComponentMo...
getErrorComponent()
lookupError(ErrorType)
toString()
RuleCheck
RuleCheck(ProjectModel , DiagramModel , ArrayList <Rul...
doCheck()
getErrorComponents()
getErrorLog()
getRules()
Figure 6.16: UML class diagram for the rule check package, part 2
The rule check system consists of the following classes:
• RuleCheck. This class serves as between the graphical user interface and
the rule checking subsystem. It includes methods for performing the actual checking and also produces the error log shown in the GUI after the
rule checking is complete.
• Rule. This is an abstract class containing methods common for all the
specific rules. For example, it contains the addError method which is
called whenever a violation of a specific rule is found.
• Specific rule classes. These classes, which are subclasses of Rule, contain
the actual implementation of the rule checking. For instance,
RuleMemoryProcessing contains methods to check if a diagram follows the memory/processing connectors rule.
• Error. This class represents a single error in a diagram. Typically, a specific rule will add Error objects whenever it finds an error. The Rule class
keeps track of all the errors found with a specific rule.
Let us look at exactly what happens during a rule check. To understand this,
consider the sequence diagram shown in Figure 6.17.