|Written by||Imar Spaanjaars|
Are you looking to hire an experienced software developer or .NET consultant? Then get in touch with me through my company's web site at devierkoeden.com
Found an interesting article on this site? Got inspired by something you read here? Then consider making a donation with PayPal.
Like this article? Or do you think it sucks? Make yourself heard by casting your vote below.Total number of ratings: 20
The book starts off with an interesting discussion about Enterprise development, what it is, and why it's important. It briefly introduces you to the five key areas of enterprise system development: Reliability, Flexibility, Separation of Concerns, Reusability and Maintainability. These topics are discussed in detail in the remainder of the book.
Chapter 2 introduces you to "enterprise code" and shows you how to design loosely coupled classes (by programming against interfaces instead of concrete classes). This in turn prepares your design for Unit Testing and Inversion of Control, two of the main themes of the book.
In the section The New Code - Changing the Way you Build things start to get more concrete. You see how to change an existing design with many dependencies and tightly coupled classes and refactor it into a more flexible design using interfaces and smart constructors that accept other interface types that are used internally. This manual form of dependency injection lays a nice foundation for Chapter 5 that deals with Inversion of Control / Dependency Injection. But first chapter 4 teaches you how to deploy Test Driven Development in your development strategy. It's an excellent chapter that shows you many best practices for TDD, shows how to use third party tools for TDD (NUnit in particular and a plugin to run NUnit from within Visual Studio), how to design for testability and how to use the many refactoring options that are available inside Visual Studio or through external, commercial tools.
If you're new to Unit Testing and TDD, this chapter may be a bit overwhelming at first, and you may want to read it twice. You're also advised to follow along with all the chapter's code in Visual Studio as I know from experience that actually seeing code run can greatly improve your understanding of it. The only problem I had with this chapter was with mocking. The authors do a great job at explaining how to use mocking to make testing easier, quicker and more reliable by abstracting away a lot of behavior in dummy (mock) classes. However, if you're new to this, you may take this too far and mock everything which in the end means you're testing nothing but your mock classes. It would have been nice if the authors had dug a little deeper in the decision process of what to mock and when, and how to combine unit testing with mocks on the one hand with integration tests using concrete classes on the other hand. While it's nice and useful to mock a lot of your code, there is a time where you really need tests that access your database. You need a way to ensure your database is accessible, your tables are setup as expected and your stored procedures align with your own code and the assumptions you have about them. You can't do this with Unit Testing alone as it would unnecessarily slow down your tests. Integration testing is very important, especially in Enterprise type of applications. More attention to integration testing and how to separate them from your unit tests would have made this chapter even more useful.
Chapter 5 shows you the Inversion of Control, or Dependency Injection principles. Building on the stuff you learned in earlier chapters, you see how to implement IoC using a number of different techniques, including an open source project called Structuremap.
Chapters 6 and 7 deal with middleware. You'll learn more about tiered designs, Service Oriented Architectures and WCF. You'll also find a discussion of a number of "persistence patterns", including Transaction Script, Active Record and the Domain Model pattern. While these two chapters contain a lot of useful information, I don't think two chapters are enough for this topic. In my opinion, this middleware layer is at the heart of your enterprise design. It's here where you make decisions that influence the design and flexibility of your application. I would have loved to see topics like Domain Driven Development and the design principles behind it in much more detail.
In Chapter 8 you learn a lot about data access layers and see frameworks such as LINQ to SQL, Entities Framework and NHybernate at work. You get an excellent introduction to each of these technologies, allowing you to compare them and make up your own mind about these frameworks. Again, I would have loved to see some more depth. It would have been nice to see a real Enterprise example of, say, the repository pattern as a layer on top of EF. Many examples show you how to use small, focused repositories often targeting a single entity. However, in practice I often find that having a single repository spanning multiple entities is a lot easier to work with. The book could have helped you with these design decisions by providing and describing a more detailed implementation of repositories using EF or NHybernate in an Enterprise application.
Chapters 9, 10 and 11 introduce you to the User Interface and to patterns such as MVP and MVC; two separate design patterns to separate the front end of your application from the model and your logic. Each topic only gets a single chapter, so you'll probably want to look at other books (such as Professional ASP.NET MVC 1.0 and Pro ASP.NET MVC Framework) as well if you want to dig real deep into these technologies. I still haven't made up my mind if I like the inclusion of both patterns. Clearly, it's great to see both discussed so you can choose a pattern that best suits your needs and development style. However, the two topics are competing for space which inevitably leads to less detail on each topic.
The last chapter in the book serves as a short summary and overview of what you learned throughout the book.
All in all, I think that Professional Enterprise .NET is well worth reading. Whether you're an intermediate developer looking to learn more about design, or a seasoned software designer looking for tips and ideas to improve your own designs (or maybe just looking for a confirmation of your own design decisions), you'll find valuable information in this book. I especially like the chapters on Unit Testing / TDD and Inversion of Control. I also liked the many pointers to open source applications (Structuremap, NHybernate, NUnit and more) and the instructions on acquiring and using them.
I give the book 4,5 stars out of 5. I would have given it 5 stars if it had dug deeper into integration tests and had given more Enterprise examples of repositories on top of your persistence framework.
Consider making a donation
Please consider making a donation using PayPal. Your donation helps me to pay the bills so I can keep running Imar.Spaanjaars.Com, providing fresh content as often as possible.
I am interested in what you have to say about this article. Feel free to post any comments, remarks or questions you may have about this article. The Talk Back feature is not meant for technical questions that are not directly related to this article. So, a post like "Hey, can you tell me how I can upload files to a MySQL database in PHP?" is likely to be removed. Also spam and unrealistic job offers will be deleted immediately.
When you post a comment, you have to provide your name and the comment. Your e-mail address is optional and you only need to provide it if you want me to contact you. It will not be displayed along with your comment. I got sick and tired of the comment spam I was receiving, so I have protected this page with a simple calculation exercise. This means that if you want to leave a comment, you'll need to complete the calculation before you hit the Post Comment button.
For more information about the Talk Back feature, check out this news item.
Unfortunately, something went wrong and your message or comments have not been submitted successfully.
There's a fair chance things broke down because you tried to post something that looks like HTML. Things that look like HTML include (X)HTML, obviously, XML, ASP.NET markup and c# generics syntax as all of them use the < and > characters.
If that's the case, try altering your message and remove anything that looks like an angled bracket. You can replace them with [ and ] for example so you can still make it look like HTML to some extend.
If, on the other hand, you were trying to spam this web site, I am pretty glad I caught you in the act and stopped you from doing so ;-)
The number you entered is not correct. Please enter the sum of the two numbers again.