Code Smell 25 - Pattern Abusers

Subscribe to my newsletter and never miss my upcoming articles

Patterns are awesome. With great powers comes great responsibility

Problems

  • Over Design

  • Readability

Solutions

  1. Measure the tradeoff of patterns usage.

  2. Create solutions based on real world names (essential) over architecture (accidental).

  3. Choose good names.

  4. User MAPPER technique to find bijection real entities.

Sample Code

Wrong

Detection

It would be very difficult to create automatic detection rules.

A class name with more than one pattern on it, is a warning.

Tags

  • Abuser

  • Naming

Conclusion

Chose when to apply a pattern solution. You are not smarter for using too many patterns. You are smart if you choose the right opportunity for everyone.

Relations

More Info

Credits

Photo by Nathan Dumlao on Unsplash


When you have a hammer, every problem looks like a nail.


This article is part of the CodeSmell Series.

No Comments Yet