I am using simple 3 tier architecture. In this I am using DTO classes to communicate between UI,BL and DL. So there is any better way for communication between layers? or this is the right way?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
DTO, Data transfer Object, is the concept for distribution layer, you use when transferring data between your consumers and your service. So, if you don't publish any service, get off DTO.
To answer your question, it also depends on how complex your application is. If it's simple, just use CRUD operation, or you can even use
DataTable
,DataSet
for communication.Otherwise, Domain Entity from DDD is the core object for communication between layers: Data Access Layer, Business Logic Layer and Presentation Layer.
Basically, there are some different type of objects in application:
Be careful with the term:
In addition to @Talha's answer, I'd recommend this article. It is EF-oriented, but concepts, described there, are common ones.
Read this tutorial it is very informative. It will help you to decide is DTO right for your scenario.