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

Назад

Pattern Taxonomy


Метки: python

One of the events that’s occurred with the rise of design patterns is what could be thought of as the “pollution” of the term - people have begun to use the term to mean just about anything synonymous with “good.” After some pondering, I’ve come up with a sort of hierarchy describing a succession of different types of categories:

  1. Idiom: how we write code in a particular language to do this particular type of thing. This could be something as common as the way that you code the process of stepping through an array in C (and not running off the end).
  2. Specific Design: the solution that we came up with to solve this particular problem. This might be a clever design, but it makes no attempt to be general.
  3. Standard Design: a way to solve this kind of problem. A design that has become more general, typically through reuse.
  4. Design Pattern: how to solve an entire class of similar problem. This usually only appears after applying a standard design a number of times, and then seeing a common pattern throughout these applications.

I feel this helps put things in perspective, and to show where something might fit. However, it doesn’t say that one is better than another. It doesn’t make sense to try to take every problem solution and generalize it to a design pattern - it’s not a good use of your time, and you can’t force the discovery of patterns that way; they tend to be subtle and appear over time.

One could also argue for the inclusion of Analysis Pattern and Architectural Pattern in this taxonomy.