Should the data access layer contain business logic?

后端 未结 12 1044
醉话见心
醉话见心 2020-12-24 00:09

I\'ve seen a trend to move business logic out of the data access layer (stored procedures, LINQ, etc.) and into a business logic component layer (like C# objects).

12条回答
  •  天命终不由人
    2020-12-24 00:40

    The perfect world doesn't exist. It's about elegance versus what works better. Executing complex SQL queries inside data access layers is much more performative than making a service to ask data many times and then merging and transforming them. When you make complex queries you are putting business logic in those queries.

提交回复
热议问题