New answers tagged design-principles
I would consider a class representing a JSON response to be a Data Contract. Keeping it separate from your DTOs and Domain Objects also keeps the clients consuming your service decoupled from the rest of your system.
Umm, no? You seem to be missing fairly significant distinctions! The single responsibility principle doesn't encapsulate anything. It does not de-duplicate any behaviors/code/logic. All it says is that a class should do one thing. You can still have two classes that do the same thing. The principle is totally fine with that. The single source of truth ...
They're two different principles. Pretty much the only thing they have in common is the word "single." Single Source of Truth is the end result of the process of normalizing a database. Every piece of entity information is stored once, and only once. Single Source of Truth explains why we put Customers in one table, and Products in another. By ...
Top 50 recent answers are included