我很难理解何时将业务逻辑偏移到存储过程以及何时包含在 .NET 中。我正在开发一个从其他系统中删除信息的系统。请看下面的代码:
Public Interface Deleteable
Sub Delete()
End Interface
Public Class Database1
Implements Deleteable
Public Sub Delete() Implements Deleteable.Delete
'Logic to implement deletion from system 1 i.e. 1) can I delete? and 2) If I can delete then execute delete.
End Sub
End Class
Public Class Database2
Implements Deleteable
Public Sub Delete() Implements Deleteable.Delete
'Logic to implement deletion from system 1 i.e. 1) can I delete? and 2) If I can delete then execute delete.
End Sub
End Class
Public Class Database3
Implements Deleteable
Public Sub Delete() Implements Deleteable.Delete
'Logic to implement deletion from system 1 i.e. 1) can I delete? and 2) If I can delete then execute delete.
End Sub
End Class
我可以在每个数据库中创建存储过程,而不是这样做。人们是否有标准来决定何时使用存储过程?