1

I have a C# solution that uses web services to send asynchronous requests to a database.

I am advised to divide my solution into 4 layers Data Access Layer, Business Logic Layer, Objects Models and UI.

My question is, the web service provides with access to the data directly, i.e. my web service operations can also represent the DAL.

Why should I convert my data to OM and not use it directly?

Thank you in advance

Dimitar Nikovski
  • 973
  • 13
  • 15
  • Possible duplicate of [Should services always return DTOs, or can they also return domain models?](https://stackoverflow.com/questions/21554977/should-services-always-return-dtos-or-can-they-also-return-domain-models) –  Jul 29 '17 at 19:12
  • You don't have to convert to OM when the returned results of your DAL operation calls from the service are exactly what you need in the models that the UI views need. If your views need model objects with a structure that is not provided directly by the DAL, then you can define intermediate objects which fit the UI needs and use them for the query results. That's the purpose of the OM, to be an interface between DAL and views (UI) if this is required. – Dimitar Nikovski Jul 30 '17 at 13:50

0 Answers0