O'Reilly logo

Professional F# 2.0 by Richard Minerich, Talbott Crowell, Aaron C. Erickson, Ted Neward

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

Chapter 21. ASP.NET MVC

WHAT'S IN THIS CHAPTER?

  • Building websites

  • Integrating C# views with F# controllers and models

  • Keeping concerns properly separated

  • Understanding the MVC pattern applied to F#

While F# is a strong contender in many areas of the development stack, it has not been traditionally thought of as a great candidate for development of code on the UI layer. This is especially true for platforms like WinForms, which promote a sense of statefulness that flows through not just the UI, but through the object model that a UI might be bound to. Most UI technologies of the WinForm era (including ASP.NET WebForms) are tied to the idea of mutating control objects as a core mechanism by which you promote interaction between a presentation object (MVP pattern) or ViewModel (MVVM pattern), and mutable UI objects (like controls with a .Text property). For such a stateful model, F# is merely an average OO language on the .NET framework, with no real compelling application besides being yet another language option.

For other models, however, that depend less on state maintenance — such as MVC frameworks — F# is far more compelling. In this chapter, you learn how to use F# with the ASP.NET MVC framework. We demonstrate an example of writing an ASP.NET MVC application that demonstrates how to use F# to simplify web development.

OVERVIEW

It is not that controversial to say that ASP.NET WebForms was designed in a manner to make web development "safe" for programmers from the world of Windows development, ...

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