I recently joined a company that uses typed datasets like their "Dto". I think they are really trash and want to change it to something more modern and user-friendly. So, I am trying to update the code so that the data layer is more general, that is, using interfaces, etc., The other guy does not know what Dto is, and we have a little disagreement about how this should be done.
Without trying to shake people to my way of thinking, I would like to receive impartial answers from you about which layers may be present in D. All layers; DAL, BL and presentation or a small subset of these layers.
Also, whether IList objects should or should not be present in the DAL.
Thank.
It really depends on your architecture.
In most cases, you should try to use the code for the interfaces, then it really doesn't matter what your implementation is. If you return ISomething, it may be your SomethingEntity or your SomethingDTO, but your consumer code does not care about it as long as it implements the interface.
You must return IList / ICollection / IEnumerable on top of a specific collection or array.
, , - , , DataAccess. , . . , , .
, IoC, Windsor, , . , .
- DataSets . , non.net. . . , DTO, DTO , .
, . : List<T> DAL, IList<T>. IEnumerable<T>, , , . , , .
List<T>
IList<T>
IEnumerable<T>
, IList<T> List<T> , :
//consider personCollection as IList<Person> (personCollection as List<Person>).ForEach(//Do Something)
. , , , List<T>. .
DTO, DataTable. BL DL . .
, DTO, datatables:
DTO - , ( ) .
DTO , -.