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 24. Capstone 4

It’s back to bank accounts again! This time you’re going to apply the lessons you learned on domain modeling into the bank account system. In this exercise, you’ll do the following:

  • Use options in practical situations
  • Use discriminated unions to accurately model a closed set of cases
  • Work with collections with more-complex data
  • Enforce business rules through the type system

24.1. Defining the problem

When you completed lesson 19, you had a version of a working bank account application that could handle persistence to disk and back again, as well as remove mutation for your command handler. Now you’re going to remove some of the “code smells” that have been left lying around by introducing some lovely F# domain modeling. ...

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