Template method pattern: Difference between revisions

Content deleted Content added
Remuel (talk | contribs)
m sorted stub
m {{comp-sci-stub}}
Line 5:
For example, given a skeleton for common operations on data structures, there may be a few common operations and some specific to the data structure. The data structure template class can provide a template for each newly added data structure class.
 
<pre>
class CDatastructure_Template
{
Line 16 ⟶ 15:
Node* virtual GetNextNode(Node *CurrentNode)=0;
};
 
class CLinkList_ConcTemplate:public Datastructure_Template;
Line 24 ⟶ 23:
class CTree_ConcTemplate:public Datastructure_Template;
</pre>
 
New data structure class can be derived from the <tt>CLinkList_ConcTemplate</tt>, with operations modified as necessary.
 
 
{{compucomp-sci-stub}}
 
[[Category:Software design patterns]]