What exactly consists of 'Business Logic' in an application?

后端 未结 8 1372
走了就别回头了
走了就别回头了 2020-12-24 03:30

I have heard umpteen times that we \'should not mix business logic with other code\' or statements like that. I think every single code I write (processing steps I mean) con

相关标签:
8条回答
  • 2020-12-24 04:09

    If it contains anything about things like form, button, etc.. it's not a business logic, it's presentation layer. If it contains persistence to file or database, it's DAL. Anything in between is business logic. In reality, anything non-UI sometimes gets called "business logic," but it should be something that concerns the problem domain, not house keeping.

    0 讨论(0)
  • 2020-12-24 04:11

    Simply define what you are doing in plain English. When you are saying things businesswise, like "make those suffer", "steal that money", "destroy this portion of earth" you are talking about business layer. To make it clear, things that get you excited go here.

    When you are saying "show this here", "do not show that", "make it more beautiful" you are talking about the presentation layer. These are the things that get your designers excited.

    When you are saying things like "save this", "get this from database", "update", "delete", etc. you are talking about the data layer. These are the things that tell you what to keep forever at all costs.

    0 讨论(0)
提交回复
热议问题