What do you think is the most abused design pattern?

Work with Java and Java wireframes. I started to shudder when I came across abstract Factory patterns. In my opinion, this is the most cruel design template. Not all structures abuse it, but there are many of them. It is not suitable for all models, and when almost 100% of the time you are going to do the same thing, why abstract it?

Which design template do you think is the most abused design template? The one where the developer used it, but it does not approach this problem so well. The case with a golden hammer and everything that looks like a nail. So, which design pattern makes you tremble when you encounter it in the wild?

EDIT: Just thought of Singleton. But this arose in the question of the most abuse. I ask for the most abuse. (Or misused).

+3
source share
4 answers

Singleton, this is very difficult for unit test code because it creates very strong links to other parts of the system.

+16
source

I agree with Singleton.

But since people usually implement it as direct GoF vanilla and do not think about how to destroy it.

Read the interesting Kill Singleton chapter, also available in John Vlissides' book, Hatch Pattern: Applied Design Templates ( Amazon sanitized link )

: " " .

+2

java , . .

0

.

Singleton, , . Singleton, , .

, ( ). Registry Singleton.

0

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


All Articles