Last post Aug 27, 2015 05:07 PM by Mikesdotnetting
Aug 27, 2015 04:38 PM|newbie2C#|LINK
I've heard of the repository pattern and its use/purpose seems very similar to Data Transfer Objects. Are these two things synonymous? If not, can you please provide an explanation?
Aug 27, 2015 05:07 PM|Mikesdotnetting|LINK
DTOs are objects that are primarily used to transfer data between application boundaries, such as that between an HTTP or SOAP service and a client application (think Web API and an AJAX call from the browser).
The repository pattern describes a component that is responsible for communicating with the database (usually), but presents business objects to the business layer. Entity Framework DbSets are examples of the repository pattern.
Business objects are not DTOs, although Business Objects without behaviour might look like them.