After doing some research, I got confirmation that folder-by-feature structure is superior to folder-by-layer structure in the majority of cases. To get some arguments we can read, among others, the following articles or even this answer.
Package by features, not layers
Feature folders vs Tech folders
Package by feature, not layer
Package by Layer for Spring Projects Is Obsolete
However, all the DDD project examples that I found are made with package-by-layer, most of the time following a structure like:
├── application
├── config
├── domain
├── infrastructure
└── interfaces
So my question is: why the DDD community does not follow package-by-feature even if it’s apparently superior in the majority of cases?
Should we use package-by-feature with DDD? If so, how to do it?
I mention that I’m not talking about the particular case of micro-service architecture where obviously package-by-layer is more relevant.