We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 991fefa commit 662f087Copy full SHA for 662f087
DesignPatternsInCSharp/TemplateMethod/Inheritance/TemplateBase.cs
@@ -0,0 +1,31 @@
1
+namespace DesignPatternsInCSharp.TemplateMethod.Inheritance
2
+{
3
+ public abstract class TemplateBase
4
+ {
5
+ private bool _importantSetting;
6
+ public void Do()
7
8
+ BeforeDoing();
9
+ Initialize();
10
+ AfterDone();
11
+ }
12
+
13
+ public virtual void BeforeDoing()
14
+ { }
15
16
+ public abstract void AfterDone();
17
18
+ private void Initialize()
19
20
+ _importantSetting = true;
21
22
23
24
+ public class TemplateChild : TemplateBase
25
26
+ public override void AfterDone()
27
28
+ // do other stuff
29
30
31
+}
0 commit comments