Design patterns criticism sources

后端 未结 7 608
梦毁少年i
梦毁少年i 2020-12-30 01:13

I was reading the design patterns page on Wikipedia, particularly the \"Criticism\" section.

Could you point me to some articles or books about shortcomings of desig

7条回答
  •  孤城傲影
    2020-12-30 01:31

    Design patterns are usually presented as a set of tricks in a specific programming language, usually Java or C++. It is usually not explained when and why a pattern needs to be used, and when it is best not to use it. It is usually not explained what would happen in a totally different programming language.

    So one gets an impression that 1) design patterns come from the sky, invented by geniuses, 2) the GoF book needs to be memorized, 3) patterns need to be applied always and ever more in every situation.

    In my view, design patterns are highly language specific (LISP has a totally different set of "design patterns" than Java) and problem specific (depending on the project, you use or don't use a pattern even though it is "theoretically" applicable to this place in your code). The GoF book is a useful companion to a Java language manual, but not a set of eternal principles about "programming in general".

提交回复
热议问题