I am trying to develop a methodology for using data transfer objects and when to use DataTables.
As an example of the problem that I encountered in our system ...
We have 6 different assemblies of business objects representing the same things, but with different properties. They were created by several developers who have been dealing with various problems for several years.
For example, various applications that use the Bicycle class over the years have dealt with various properties of a bicycle. Therefore, they called different data methods that only retrieved and populated the properties with which they were associated.
Data Service 1 Configures
Data Service 2 Configures
and each uses a different business object. Clearly, this is ridiculous; you cannot create a new class for every possible combination of properties.
The feeling of my feeling tells me that if this is a problem, we should probably use ORM.
But for now I want to say.
If you are populating or returning a whole row from a table, use the DTO / Business Entity, which corresponds to the database.
If you are returning a random set of properties, use datatable.
Can anyone suggest some kind of guidance?
thanks
source share