如何将应用程序分为三个主要层

Discover Functional JavaScript was named one of the best new Functional Programming books by BookAuthority!

“发现功能JavaScript”BookAuthority评为最佳新功能编程书籍之一

A common way to split responsibilities in an application is to separate them into the three principal layers:

在应用程序中划分职责的一种常见方法是将职责分为三个主要层:

  • UI (aka Presentation)

    用户界面(又名演示)
  • domain (aka Business)

    域(又名业务)
  • data access

    资料存取

Some of the benefits of doing so are:

这样做的一些好处是:

  • a better understanding of the layer’s purpose

    更好地了解层的目的
  • the layer implementation can be replaced. For example we can switch between AngularJS, VueJS, and ReactJS in the UI layer.

    层实现可以替换。 例如,我们可以在UI层中的AngularJS,VueJS和ReactJS之间切换。
  • multiple UI Layers can be implemented over the same domain layer

    可以在同一域层上实现多个UI层
  • the UI can be hard to test. By moving the logic to other layers, it becomes easier to test.

    用户界面可能很难测试。 通过将逻辑移到其他层,测试变得更加容易。

Read Functional Architecture with React and Redux and learn how to build apps in function style.

阅读具有React和Redux的功能架构,并学习如何以函数样式构建应用程序。

Discover Functional JavaScript was named one of the best new Functional Programming books by BookAuthority!

发现功能JavaScript被称为 BookAuthority最好的新功能编程书籍

For more on applying functional programming techniques in React take a look at Functional React.

有关在React中应用函数式编程技术的更多信息,请查看 Functional React

You can find me on Medium and Twitter.

您可以在MediumTwitter上找到我。

翻译自: https://www.freecodecamp.org/news/how-to-split-an-application-into-its-three-main-layers-fd18b11994a0/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值