Codele / How software is built
Design patterns you will meet
Programmers keep running into the same problems, so they reuse the same shapes of solution. Meet three of them through small everyday scenes.
- A design pattern is a well-known shape of solution that programmers reuse. It is an idea, not a library.
- Observer: something keeps a list of watchers and tells every one of them when it changes.
- Strategy: one job, several ways to do it, and you hand in the way you want.
- Factory: ask for “a button” and a helper decides which kind to make.
- Patterns have names so that a team can say “use a factory” and everyone pictures the same thing.
Loading the playable lesson…