I'm already using DTO's for data transfer over a network. Now I'm also introducing different DTO-like classes to the DAL. This is to avoid passing the application (business) objects across layers.
To avoid naming confusion, I would like to use another term than DTO but can't find a good one.
What is DTO equivalent term for objects returned from DAL?
DAL (Data Access Layer) DTO (Data Transfer Object)
In the field of programming a data transfer object (DTO) is an object that carries data between processes. The motivation for its use is that communication between processes is usually done resorting to remote interfaces (e.g. web services), where each call is an expensive operation.
A data transfer object (DTO) is an object that carries data between processes. You can use this technique to facilitate communication between two systems (like an API and your server) without potentially exposing sensitive information. DTOs are commonsense solutions for people with programming backgrounds.
A DTO is an object that defines how the data will be sent over the network. Let's see how that works with the Book entity. In the Models folder, add two DTO classes: C# Copy.
"What's in a name? that which we call a rose by any other name would smell as sweet." - William Shakespeare
Also, what Martin Fowler says about POJO:
In the talk we were pointing out the many benefits of encoding business logic into regular java objects rather than using Entity Beans. We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects lacked a fancy name. So we gave them one, and it's caught on very nicely.
By the way, it does not matter that much. Looking at your concern to avoid confusion due to similar naming, you may choose from "DataModel", "Entity", "POCO".
Following are very loose considerations for different terms generally used:
Relational Model [Database Layer]:
Persistence Model [Data Access Layer]:
Domain Model/Business Model [Business Logic/Services Layer]:
View Model [UI Layer]:
DTO:
POCO:
Entity:
Model:
Refer following answers:
https://stackoverflow.com/a/37751345/5779732
https://stackoverflow.com/a/42801839/5779732
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With