14 Business logic design

This chapter covers

  • How to organize and structure both server and client applications
  • How to make a web server with Servant and our application framework
  • How to approach validation and what applicative validation is

Sometimes, it’s hard to recognize what’s included in business logic and what’s not. I can imagine some scientific code in Agda, Idris, or Coq that’s not written for business purposes but for verifying some scientific ideas; therefore, it’s strange to call it business logic. However, in research-only companies, such code will be business logic.

14.1 Command-line client application

14.1.1 API data model and HTTP schema

14.1.2 Command-line interaction

14.1.3 HTTP client functionality

14.2 Server application

14.2.1 Extended HTTP schema

14.2.2 Using the framework for business logic

14.2.3 Web server

14.2.4 Validation

Summary