A Letter from the Editor: Celebrating Adam Freeman's 35th Apress Release
June 25th, 2020
Adam Freeman’s Pro ASP.NET Core 3 book, now in its 8th edition, has published. This was a beast (1100 pages +) of a bestseller to revise, but he pulled it off, and beautifully. One might assume that pages of lengthy code examples and marketing fluff “bulk it up”, but anyone who has ever read a technical book by Mr. Freeman knows firsthand that gratuitous text is not his style. His books are laden with unbiased advice, and teach readers in an unassuming and collaborative manner. Here’s a short excerpt that I pulled on the topic of Razor Pages. I love the way he contrasts, parallels, interjects opinion, communicates, and engages the reader.
“As you learn how Razor Pages work, you will see they share common functionality with the MVC Framework. In fact, Razor Pages are typically described as a simplification of the MVC Framework—which is true—but that doesn’t give any sense of why Razor Pages can be useful.
The MVC Framework solves every problem in the same way: a controller defines action methods that select views to produce responses. It is a solution that works because it is so flexible: the controller can define multiple action methods that respond to different requests, the action method can decide which view will be used as the request is being processed, and the view can depend on private or shared partial views to produce its response.
Not every feature in web applications needs the flexibility of the MVC Framework. For many features, a single action method will be used to handle a wide range of requests, all of which are dealt with using the same view. Razor Pages offer a more focused approach that ties together markup and C# code, sacrificing flexibility for focus.
But Razor Pages have limitations. Razor Pages tend to start out focusing on a single feature but slowly grow out of control as enhancements are made. And, unlike MVC controllers, Razor Pages cannot be used to create web services.
You don’t have to choose just one model because the MVC Framework and Razor Pages coexist, as demonstrated in this chapter. This means that self-contained features can be easily developed with Razor Pages, leaving the more complex aspects of an application to be implemented using the MVC controllers and actions.
In the sections that follow, I show you how to configure and use Razor pages, and then I explain how they work and demonstrate the common foundation they share with MVC controllers and actions.”
Adam Freeman has been publishing with Apress, mainly on web dev topics, for as long as I can remember. Pro ASP.NET Core 3 is his 35th book with Apress, a milestone worth celebrating. So hats off to the most prolific technical author I know.