Template Method Design Pattern
denvaar.dev·1d
🔧API Design
Preview
Report Post

Example of the Template Method design pattern with Python.

2015-11-09

programming python

Introduction

An algorithm is basically a formula, or a set of steps to solve a problem. There are usually several different ways to solve a problem. Take the act of baking a loaf of bread for example. Your grandma bakes bread a little bit differently than my grandma does, but the process that they use is probably very similar:

Generalized Bread Recipe

1. Put some ingredients into a bowl to make the dough.

2. Turn and knead the dough on a floured surface.

3. Shape and place the dough into baking pans.

4. Stick the pans into the oven to bake.

These are four basic steps that can be followed to bake bread. Following these steps will result in different kinds …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help