I've never encountered a well written business layer. Any advice?

后端 未结 9 1713
Happy的楠姐
Happy的楠姐 2021-02-02 00:54

I look around and see some great snippets of code for defining rules, validation, business objects (entities) and the like, but I have to admit to having never seen a great and

9条回答
  •  梦毁少年i
    2021-02-02 01:21

    One problem I find is that even when you have a nicely designed business layer it is hard to stop business logic leaking out, and development tools tend to encourage this. For example as soon as you add a validator control to an ASP.NET WebForm you have let business logic leak out into the view. The validation should occur in the business layer and only the results of it displayed in the view. And as soon as you add constraints to a database you then have business logic in your database as well. DBA types tend to disagree strongly with this last point though.

提交回复
热议问题