Author: Stefano Mostarda, Marco De Sanctis & Daniele Bochicchio
Publisher: Manning, 2011
Aimed at: .NET database developers
Pros: Comprehensive - goes from very basics to advanced topics
Cons: Size of screen dumps inadequate
Reviewed by: Alex Armstrong
Entity Framework is the big revolution going on in database access - but ADO.NET is still at the bottom of it all so don't worry too much. The revolution is going on at the top end of the stack, in the code beyond the database access. The idea is simple - use objects. The practice seems to be remarkably difficult however and explaining it is even harder.
This book makes a good attempt at making it seem all very simple. Part I is called Redefining Your Data-Access Strategy and it consists of two longish chapters. The first takes you through the standard arguments for object models. Starting from a simple table structure you are walked though creating table objects and eventually objects representing entities. At this point you should be sold on the idea - it convinced me. Chapter 2 is a "getting-started-with" that introduces the example that runs thought the entire book. When I moved on to Part 2. it assumed that I was happy about creating and working with an Entity Framework project - and I realized that I'd read all of Part I and just not taken it in. The problem is that in Chapter 2 there is a very intimate mix of theory and do-this, do-that step-by-step practical work. I'd clearly taken in the theory but not the practice.
Trying to see what is going on is made much more difficult by the use of screen dumps that are too small - you can't actually see or read what is going on. I went back and read it all again with particular attention to the practical steps and then Part 2 made more sense.
Part 2 Getting Started With Entity Framework gets increasingly sophisticated as it goes on. Chapter 3 is about basic queries and Chapter 4 is about using Linq to do the same job. Then Chapter 5 is on model mapping, Chapter 6 on the entity lifecycle, Chapter 7 on persisting objects and finally Chapter 8 deals with concurrency and transactions. This is a fast pace and to be honest it made the subject seem more, not less, complicated.
If you have survived Part 2 then Part 3 has a worrying title - Mastering Entity Framework. You mean we haven't mastered it yet! This introduces Entity SQL, stored procedures, functions and views, EDM metadata and customizing code and the designer. Part 4 Applied Entity Framework moves on to applying the ideas and it looks at how Entity Framework fits into the bigger design of an application - ASP.NET, n-tier, windows applications and testing.
Does this book succeed in making the Entity Framework seem easy?
No it doesn't. Its mix of explanation of the ideas and a big example, didn't work for me. I liked the explanations but the step-by-step practical parts simply left me wondering what other methods there might be waiting to be introduced. There is also the point that Entity Framework is evolving and 4.1 is now out. There is an argument that the framework itself isn't ready for real use and many of the shortcoming of this book could be put down to the same fact. There are lots of places where it hints that it would be nice to do something in a way that the designer or indeed framework doesn't support - yet. Don't be fooled by the version number being 4 - this is just to stay in line with the current version of the .NET framework itself. The Entity Framework is still very young.
This isn't the book that simplifies Entity Framework for me but if you like having things explained using a big single example then perhaps this book will work better for you. It certainly covers lots of ground and will take you from the very basics to more advanced topics. A good book on the Entity Framework is still to be written but it might be this one a few editions and versions down the road.