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.
  • multiple UI Layers can be implemented over the same domain layer
  • the UI can be hard to test. By moving the logic to other layers, it becomes easier to test.

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

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

Learn how to apply the Principles of Design Patterns.

You can find me on Medium and Twitter.