Should the data access layer contain business logic?

后端 未结 12 1042
醉话见心
醉话见心 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条回答
  •  萌比男神i
    2020-12-24 00:48

    Separation of layers does not automatically mean not using stored procedures for business logic. This separation is equally possible:

    Presentation Layer: .Net, PHP, whatever

    Business Layer: Stored Procedures

    Data Layer: Stored Procedures or DML

    This works very well with Oracle, for example, where the business layer may be implemented in packages in a different schema from the data layer (to enforce proper separation of concerns).

    What matters is the separation of concerns, not the language/technology used at each level.

    (I expect to get roundly flamed for this heresy!)

提交回复
热议问题