SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы

Назад

Exercises


Метки: python

  1. Use Command in Chapter 3, Exercise 1.
  2. Implement Chain of Responsibility to create an “expert system” that solves problems by successively trying one solution after another until one matches. You should be able to dynamically add solutions to the expert system. The test for solution should just be a string match, but when a solution fits, the expert system should return the appropriate type of ProblemSolver object. What other pattern/patterns show up here?

Footnotes

[1] In Python, all functions are already objects and so the Command pattern is often redundant.
[2] Design Patterns, Page 235.