0

Having a 3 layer application: Presentation, Business and Data with the corresponding models: Presentation using ViewModels, Business using Business Objects and Data using DTOs.

My question is: is there any benefit using DTO's on Data layer and not using the Business Objects? Having DTO a mapping between DTO and BO is also required.

Thanks.

Jake Manet
  • 1,174
  • 3
  • 15
  • 26

1 Answers1

0

Have 2 things here:

  1. It's just the way you're thinking. You're right, you have DTO (Data layer) you can show it on the GUI(Presentation Layer) directly. But the way you make a query and return a DTO that you already do a business. Means you did something for a specified purpose. -> That is business.

  2. If you have a business, not only it is used for GUI, it can be used for other business or another GUI. Example: Example, your business returns a list of companies, your GUI shows these data. But another GUI has a business that show only company addresses, they can ues your business to have the data.

Thanks, Linh