0

There are design patterns and there are architectural patterns.

I have understood that design patterns aim at solving code complexity, like the Singleton pattern, Repository pattern is a design pattern.

Then on the other side, you have architectural patterns which is aimed at organizing and structuring code. - MVVM, MVC are examples.

However, where does TDD and DDD falls?

57913
  • 783
  • 1
  • 6
  • 13
  • [From reading here](https://stackoverflow.com/questions/3840125/useful-design-patterns-for-unit-testing-tdd), it seems that TDD itself can be implemented using a number of different design patterns. – Tim Biegeleisen Mar 27 '19 at 05:20
  • TDD and DDD are not patterns. They are processes. Patterns prescribe what to do. Processes prescribe how to do it. – jaco0646 Mar 27 '19 at 22:50

2 Answers2

4

TDD

TDD is a software development practice which comes from "if it hurts, do it more often". it's neither design pattern nor architectural pattern, it's a practice to write well designed and testable code. You can use design patterns to write a well designed tests just like the production code, you have to keep it clean and DRY if you will, because you have to maintain it.

DDD

DDD is a software development approach which tells you how manage your domain complexity. If you follow DDD approach your code and architecture will change, then you can use architectural styles like "Hexagonal architecture" or you can use design patterns or practices like factories to adapt to this approach

MSH
  • 81
  • 1
  • 3
0

I had pondered on this and after going through a lot of articles, I have decided to call them as follows

  • TDD, BDD : Testing patterns that are a subset of Architectural Styles.
  • DDD: Architecture style.

Please check here: link 1, link 2, link 3

bharath muppa
  • 1,070
  • 12
  • 30