O'Reilly logo

Get Programming with F#: A guide for .NET developers by Isaac Abraham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 23. Business rules as code

In this last lesson of the unit, you’ll see how to use F# language features such as records, options, and discriminated unions to write code that can enforce business rules within code. This lesson covers the following:

  • Conventional ways to validate business rules
  • Exploring domain modeling in F# more closely
  • Exploring single-case discriminated unions
  • Encoding business rules through types
  • Exception handling

Our code always has some form of business rules within it. Generally, we validate that our code is correct either by running the application and manually seeing whether it does the right thing, or by writing some form of automated test suite that sits alongside our code. This test suite often is as large ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required