277294.ijbsn.asia
TemplateMethod.py
2001-12-26T16:00:00Z
2001-12-26T16:00:00Z
<br/><TEXTAREA name="code" class="py" rows="16" cols="100">#: c03:TemplateMethod.py
# Simple demonstration of Template Method.
class ApplicationFramework:
def __init__(self):
self.__templateMethod()
def __templateMethod(self):
for i in range(5):
self.customize1()
self.customize2()
# Create a "application":
class MyApp(ApplicationFramework):
def customize1(self):
print "Nudge, nudge, wink, wink! ",
def customize2(self):
print "Say no more, Say no more!"
MyApp()
#:~</TEXTAREA><br><br/><script type="text/javascript"><!--google_ad_client = "pub-9426659565807829";google_ad_slot = "9359905831";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
2001-12-26T16:00:00Z