Book Review: Programming Microsoft ASP.NET MVC, 2nd Edition
|
- Title: Programming Microsoft ASP.NET MVC, 2nd Edition
- Author: Dino Esposito
- Level: Intermediate to advanced
- Publisher: Microsoft Press
- Pages: 438
- Rating: 4 of 5
|
With lots of talk and attention being given to ASP.NET MVC, it has become
necessary for any ASP.NET developer to master ASP.NET MVC concepts.
Programming Microsoft ASP.NET MVC, 2nd Edition by Dino Esposito provides a
very good understanding of the subject. Before I describe the contents of the
book, however, I would like to tell you that this is not a tutorial or
step-by-step kind of book neither it is for absolute beginners. Also, though it
contains code snippets it doesn't give heavy or elaborate code listings usually
found in many books. So, if you are looking for something of that sort you might
want to look into some other titles.
The book is divided into three parts viz. Fundamentals, Software Design and
Client Side. The first part consists of four chapters and begins by describing
MVC Controllers. It discusses the Controller class as well as grouping
controllers and asynchronous operations. Chapter 2 describes MVC view engine
namely ASPX and Razor engines. It also covers HTML helpers and how to create
custom view engines. Chapter 3 covers MVC models and includes topics such as
default model binding and custom model binding. It finishes by demonstrating the
concepts just learnt by developing a DateTime custom model binder. Chapter 4
talks about how to write HTML forms effectively for ASP.NET MVC scenarios. Also
covered are handling GET and POST requests efficiently and AJAX based input
forms. The chapter concludes with data annotations, default and custom templates
for data types and various data validation techniques as applicable to MVC
applications.
Second part consists five chapters that deal with Software Designing for MVC
applications. The topics covered are important in any MVC web applications.
Chapter 5 covers some important aspects of MVC application such as session
management, caching data, error handling and localization. Chapter 6 discusses
security. Concepts such as authentication and authorization are discussed here
along with Membership service. Additionally, information with sample code on
using third party authentication services such as OpenID, OAuth and Twitter is
given. Chapter 7 discusses design considerations for controllers. It details
several topics of interest such as iPODD pattern, dependency injection,
dependency inversion principle, service locator pattern and creating custom
controller factories. Continuing the dissection of Controllers, Chapter 8 talks
about customizing them. Topics such as extensibility and provider model are
discussed along with a couple of real world situations. Also covered are topics
such as embedded and external action filters, built-in action filters and global
filters. Some example scenarios such as response compression, adding response
headers are covered. Further, it talks about view selectors, action name
selectors, action method selectors, AJAX only action methods and action result
types. Chapter 9 deals with an important aspect of software development -
testing and testability. This chapter gives overview of designing for
testability, interface based programming and unit testing. It then focuses on
MVC specific testing and talks about testing various layers, views,
localization, routes, testing asynchronous code. Further discussed are topics
such as mocking data and ASP.NET objects such as HttpContext, Session and
Response. The chapter ends with discussion of testing controller methods with
filters applied to them.
Third part consists of just one chapter that deals with client side scripting
techniques. The initial topics discussed such as types, null handling and
objects are purely related to JavaScript. Then the chapters discusses jQuery.
After introducing you to JavScript and jQuery the chapter talks about -
un-obstructive code, creating Namespaces and Modules. To improve performance of
the pages being loaded it also discusses script loading techniques and sprite.
The chapter then focuses on MVC specific use of JavaScript and AJAX.
Overall this book gives a very good and thorough understanding about ASP.NET
MVC, not just at code level but also at concept and design level. At places the
information presented sounds bit off the track considering the core topic of the
book but if you have time this information can be an interesting read. You may
not read this book in start to end fashion because it presents several topics
which are beyond syntax. They will make you think of how you develop today and
how you can implement what the author is talking about. At places you can also
do some brainstorming with your friends or colleagues about the design and
pattern related topics. This book is not "read and keep aside" kind. You will
need to re-visit, re-refer, re-read it more than once. So, I would definitely
recommend this book provided you are ready to take a serious, in-depth look at
MVC rather than beginner or code intensive tutorials. Reading some basic stuff
from official ASP.NET website
and then picking this book up would be a recommended approach and I think at the
end of the exercise you will certainly find it worth.