Where can I find tasks for using templates

There are many books / online resources about using templates. But I did not find any tasks to use it. But for a good understanding of patterns, practice is needed. Maybe someone came across some resources where there are tasks for using templates.
For instance. Intermediary: 1) write a chat application where ... Thanks in advance.

UPDATE: I found: http://www.cs.sjsu.edu/~pearce/modules/labs/patterns/

How to learn design patterns?

+4
source share
3 answers

I will give you five, with mild and / or moderate difficulty:

Singleton

  • easy: A single database access class for the entire application.

Factory

  • easy: translator into English. I need to be able to add and then access a new language translator with minimal code changes.

Observer

  • easy: A central data structure that has multiple copies in an application that needs to be updated automatically when the primary DS changes.
  • moderate: do this work over the network with interacting processes, updating the central data structure.

Memento

  • easy: a simple game with the ability to save / load.

decorator

  • easy: a simple read / write resilience class. I want to be able to dynamically switch between saving XML or a database.
+2
source

I know only one such resource, and it is not formulated as you indicated, but it may help a little: in the last chapters of the book Head First Design Patterns MVC is explained as a composite template that includes several others: Composite , Strategy , Adapter , etc. .d. This is explained using a small application. You can look at the chapter and build the one described in practice.

+1
source

Use an iterator? Template. I assume that you are using many templates without even realizing that you are using them. Created a buffered reader from a file reader? decorator; template. Do not try to use patterns - let the problem detect them. They are everywhere, therefore they are patterns.

Things like facades, decorators, iterators, factories, etc., appear in every single domain. Select everything you are interested in writing and find existing templates. The rector mercilessly - patterns.

+1
source

Source: https://habr.com/ru/post/1396395/


All Articles