Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Document Properties Marker
overridefalse
Short DescriptionHtmlSC uses the {template-method-pattern} to enable flexible checking algorithms: 
Doctypearchitecture-aspecthide
NameFlexible Checking Algorithms 
Parent
Parent Property
property-nameName
 
Audience
Name List
doctyperole
propertyAudience
 
Categories
Name List
doctypecategory
propertyCategories
 
Tags
Tag List
propertyTags
 
Iteration
Iteration
valuefacadefilled
 
Sort Key000300hide
Section
titleDescription
Quote External
source-urihttp://sourcemaking.com/design_patterns/template_method
render-anonymousfalse
sourcehttp://sourcemaking.com/design_patterns/template_method

The Template Method defines a skeleton of an algorithm in an operation, and defers some steps to subclasses.

We achieve that by defining the skeleton of the checking algorithm in one operation, deferring the specific checking algorithm steps to subclasses.

 

The invariant steps are implemented in the abstract base class, while the variant checking algorithms have to be provided by the subclasses.

Code Block
languagejava
/**
 * template method for performing a single type of checks
 * on the given @see HtmlPage.
 *
 * Prerequisite: pageToCheck has been successfully parsed,
 * prior to constructing this Checker instance.
 */
 public CheckingResultsCollector performCheck() {
    // assert prerequisite
    assert pageToCheck != null
    initResults()
    return check() // execute the actual checking algorithm
 }
Transclusion
taget-heading-level2
documentTemplate Method
idsContext, Elements

Content Marker
idContent
Section
titleMotivation
Section
level2
titleQuality Scenarios
Display Table
doctypequality-scenario
render-no-hits-as-blanktrue
selectName, Short Description
restrict-to-immediate-childrentrue
empty-as-nonetrue
Section
level2
titleUse Cases
Display Table
doctypeuse-case
render-no-hits-as-blanktrue
selectName, Short Descriptionsort-bySort Key, Name
restrict-to-immediate-childrentrue
sort-bySort Key, Name
empty-as-nonetrue
Section
titleSolution
Section
level2
titleConstraints
Display Table
sort-by
doctypeproject-constraint
render-no-hits-as-blanktrue
selectName, Short DescriptionSort Key, Name
restrict-to-immediate-childrentrue
sort-bySort Key, Name
empty-as-nonetrue
Section
level2
titleDecisions
Display Table
doctypearchitecture-decision
render-no-hits-as-blanktrue
selectName, Short Descriptionsort-bySort Key, Name
restrict-to-immediate-childrentrue
sort-bySort Key, Name
empty-as-nonetrue
Section
titleApplication

Section
titleDiscussion

Section
titleSubordinate Aspects
Display Table
sort-by
doctypearchitecture-aspect
render-no-hits-as-blanktrue
selectName, Short DescriptionSort Key, Name
restrict-to-immediate-childrentrue
sort-bySort Key, Name
Section
required-permissionswrite-access
titleNotes

...