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

后端 未结 8 1450
走了就别回头了
走了就别回头了 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: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.

提交回复
热议问题