Vous voulez voir cette page en français ? Cliquez ici.


or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
More Buying Choices
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Dependency Injection in .NET [Paperback]

Mark Seemann
4.3 out of 5 stars  See all reviews (3 customer reviews)
List Price: CDN$ 58.95
Price: CDN$ 32.92 & FREE Shipping. Details
You Save: CDN$ 26.03 (44%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 1 left in stock (more on the way).
Ships from and sold by Amazon.ca. Gift-wrap available.
Want it delivered Thursday, September 18? Choose One-Day Shipping at checkout.
Save Up to 90% on Textbooks
Hit the books in Amazon.ca's Textbook Store and save up to 90% on used textbooks and 35% on new textbooks. Learn more.
Join Amazon Student in Canada


Book Description

Oct. 10 2011 1935182501 978-1935182504 1

Summary

Dependency Injection in .NET, winner of the 2013 Jolt Awards for Productivity, presents core DI patterns in plain C#, so you'll fully understand how DI works, covers integration with standard Microsoft technologies like ASP.NET MVC, and teaches you to use DI frameworks like Structure Map, Castle Windsor, and Unity.

About the Technology

Dependency Injection is a great way to reduce tight coupling between software components. Instead of hard-coding dependencies, such as specifying a database driver, you inject a list of services that a component may need. The services are then connected by a third party. This technique enables you to better manage future changes and other complexity in your software.

About this Book

Dependency Injection in .NETintroduces DI and provides a practical guide for applying it in .NET applications. The book presents the core patterns in plain C#, so you'll fully understand how DI works. Then you'll learn to integrate DI with standard Microsoft technologies like ASP.NET MVC, and to use DI frameworks like StructureMap, Castle Windsor, and Unity. By the end of the book, you'll be comfortable applying this powerful technique in your everyday .NET development.

This book is written for C# developers. No previous experience with DI or DI frameworks is required.

Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

Winner of 2013 Jolt Awards: The Best Books—one of five notable books every serious programmer should read.

What's Inside

  • Many C#-based examples
  • A catalog of DI patterns and anti-patterns
  • Using both Microsoft and open source DI frameworks

Tabel of Contents

    PART 1 PUTTING DEPENDENCY INJECTION ON THE MAP
  1. A Dependency Injection tasting menu
  2. A comprehensive example
  3. DI Containers
  4. PART 2 DI CATALOG
  5. DI patterns
  6. DI anti-patterns
  7. DI refactorings
  8. PART 3 DIY DI
  9. Object Composition
  10. Object Lifetime
  11. Interception
  12. PART 4 DI CONTAINERS
  13. Castle Windsor
  14. StructureMap
  15. Spring.NET
  16. Autofac
  17. Unity
  18. MEF

Special Offers and Product Promotions

  • Join Amazon Student in Canada


Frequently Bought Together

Dependency Injection in .NET + C# in Depth
Price For Both: CDN$ 65.84

  • C# in Depth CDN$ 32.92

Customers Who Bought This Item Also Bought


Product Details


Product Description

About the Author

Mark Seemann is a software architect living in Copenhagen. Previously a developer and architect at Microsoft, Mark is now an independent consultant.


Inside This Book (Learn More)
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

What Other Items Do Customers Buy After Viewing This Item?


Customer Reviews

3 star
0
2 star
0
1 star
0
4.3 out of 5 stars
4.3 out of 5 stars
Most helpful customer reviews
5.0 out of 5 stars Fantastic explanation of Dependency Injection June 13 2013
By Lorne
Format:Paperback|Verified Purchase
Fantastic explanation of Dependency Injection. This book has completely changed the way I program. The book was clear with great examples.
Was this review helpful to you?
4.0 out of 5 stars An excellent introduction to DI May 22 2013
Format:Paperback
If you want a thorough and comprehensive introduction to dependency injection in .NET, this is your book. The author does an excellent job to explain the basic and more advanced topics of DI. Various containers are covered, including the very popular and mature Castle Windsor.

All DI principles including constructor, property and method injection, anti-patterns, refactoring, object composition, lifetime management, and interception are thoroughly explained. Detailed examples are provided from various .NET technologies including WCF and ASPNET MVC.

The popular DI framework Ninject is not covered in this book, but the author deliberately chose to concentrate on the most popular DI containers at the time of writing. Overall the book is a welcome addition to any architect or developer's bookshelf.
Was this review helpful to you?
4.0 out of 5 stars Use as reference April 6 2013
By S. Fung
Format:Paperback|Verified Purchase
If you already know DI then this book would be okay as a reference. If you are starting DI, i would not recommend it, as there would be gaps where you would not understand without having some context about DI. Author does try to explain and provide background, but just doesn't do it very good. Good book if you are intermediate level.
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.7 out of 5 stars  48 reviews
41 of 41 people found the following review helpful
5.0 out of 5 stars No Adjectives Left Sept. 5 2012
By David Foley - Published on Amazon.com
Format:Paperback|Verified Purchase
The Short Story: This is the best software development book I have ever read. By miles. Or, in deference to Mr. Seeman, in kilometers. Stop. Buy this book. It will change how you think, how you reason, how you sleep at night. See you in a year, we will both be smarter.

The Long Story: I bought this book last year. I can't remember exactly why I bought it, but I suspect that it had something to do with intellectual intimidation and the frightening title. I come from a non-OO background, but I am too young to get through the next 20 years without dealing with the reality of OO prevalence in small (i.e. numerous) projects. I had 2 choices ... start at the bottom or start at the top. Believe me, I chose the latter with this book.

I'm not going to explain the content in every chapter, simply because other reviewers have already done the job as I would have. Read Mr. T. Anderson's fine review if you need that kind of detail. Instead, I will talk about the effect that this book had had on how I think.

Chapter 2 is the velvet sledgehammer in the face. I read along with the case study, nodding my head and exercising my (in retrospect, tiny) brain as Seeman describes how "Mary" and "Jens" go about building a layered application. I'm thinking, yes Mary and Jens, this is what the magazines, blog articles, and dime-a-dozen gurus are saying regarding the construction of layered application. Seeman then dissects the "layered" application. Actually, he doesn't dissect it; he tears it to shreds and stamps all over it. Brilliantly. It's truly scary to read this chapter. You will feel like a complete novice at the end of it. You then have two choices ... (1) reject this stuff as abstract, ivory tower nonsense, or (2) put on your big-boy-pants.

Having lived with this book for almost a year, this is how I suggest you use it:
1. Read from Part 1 through Part 3.
2. Stop. Think. Cry at how embarrassed you feel at the end of Part 1 Chapter 2.
3. Read Part 2 again.
4. Stop. Think. Cry at how happy you feel now that you've lifted yourself beyond 99% of .NET developers. Beyond 99% of software professionals, period.
5. Do some "poor-man's DI" exercises.
6. Read only the introductory sections of each chapter within Part 4.
7. Pick a DI container in Part 4 that appeals to you based on the previous bullet, read its Part 4 chapter, and spend 1-2 months playing with it.
8. Revisit Parts 2 and 3 on a regular basis as references.
9. Don't think about sauces or Fowlerisms.

Criticisms: Very, very, few. I do not think it's too "wordy" at all. Any repetition is done with the realization that this stuff is really, really, hard for most of us. But yes, any mention of nonsense about "Anemic Domain Models" normally sets my blood boiling and warrants an immediate docking of at least 1 star. I can't dock a star from this book. It's that good. It's written by a mildly (but not offensively) dogmatic Danish guy who talks about sauces in every chapter. I like my Filets Mignons dry, thank you very much. And still, at the end of the day ... this is best software development book I have ever read. By far. By miles. By kilometers ...
34 of 35 people found the following review helpful
5.0 out of 5 stars Must read for .NET Devs Nov. 17 2011
By Art Gorr - Published on Amazon.com
Format:Paperback
I have never written a review for Amazon before but I want to take the time here to give major props to the author for this quality book on Dependency Injection. This is easily in the top 2 of software development books that I have read. (The other being R. Martin's Agile Principles, Patterns, and Practices in C#)

I have been using DI successfully for several years, yet I was able to learn an enormous amount about the topic from this book. Explanations of DI principles and related patterns such as Decorator really clicked for me. Read this book and you will understand how to develop loosely coupled software components. Excellent code examples in C#. The section on object composition in MS frameworks like ASP.NET MVC and WCF is an extremely valuable resource. The footnotes will direct you to very interesting reading for an even deeper dive. I could go on.

I highly recommend this book for .NET developers.
23 of 25 people found the following review helpful
5.0 out of 5 stars Awesome, Awesome, Awesome, Awesome, Awesome... Jan. 4 2012
By T. Anderson - Published on Amazon.com
Format:Paperback|Verified Purchase
Uhg. Sometimes my ability to be a complete ignoramus really annoys me. When I first saw this book on the upcoming list of books to be published I thought, "That sucks, I just got done reading Dependency Injection by Dhanji R. Prasanna last year. I don't need to read the .NET version", and so I ignored this book.

As time went on I saw all the great reviews coming out about the book and it made me curious. A buddy of mine had purchased it and I know that Manning gives ebooks with there book purchases, so I asked to borrow it. I ordered the book the next day.

I have nothing bad to say about Dependency Injection by Dhanji R. Prasanna, it was a great book. The difference is this one spoke my language of choice, .NET. It made the read so much better for me. Plus all the coverage of the popular DI Containers for .NET rocks.

This book is broken down into 4 parts the first part introduces DI. Part two is a catalog of patterns, anti-patterns, and refactorings. Part three covers Object Composition, Lifetime Management, and Interception. Part four covers all the popular DI .NET Containers which include Castle Windsor, StructureMap, Spring.NET, Autofac, Unity, and MEF.

One of the coolest things about the book is that it uses poor man's DI in the first 3 parts of the book to teach you how it all works, and then covers the popular DI .NET Containers in details to help you be more productive.

Coverage of the popular DI .NET Containers is nice deep coverage which also highlights the advantages and disadvantages of each one. Each popular DI .NET Container gets its own chapter. There are also some nice feature and lifestyle comparison charts to help you zero in on which DI Container will fit your needs.

The chapter on Object Composition is pretty cool too. It include coverage of console applications, ASP.NET MVC, Windows Communication Foundation, Windows Presentation Foundation, ASP.NET (Web Forms), and PowerShell.

The chapters on patterns and anti-patterns are a really big help in making sure you are using DI correctly. The patterns covered include Constructor Injection, Property Injection, Method Injection, and Ambient Context. The anti-patterns covered include Control Freak, Bastard Injection, Constrained Construction, and Service Locator. Both include nice code samples.

The chapter on DI refactoring covers mapping runtime value to abstractions, working with short-lived dependencies, resolving cyclic dependencies, dealing with constructor over-injection, and monitoring coupling.

This book is packed with diagrams that help you visualize the topic at hand. The author includes just the right amount.

Over all I found this author's writing style made the book a nice cover to cover read, but I will also be keeping it near to use as a reference. I have been on projects that use Castle Windsor, StructureMap, Unity, and MEF, so having coverage of each handy will be nice.

All the downloadable code is very well organized and usable.

This book is not only about DI, it is about proper object oriented programming. Every .NET architect and developer should read this book.
11 of 11 people found the following review helpful
5.0 out of 5 stars Best Book in .NET best practices hands down Dec 14 2011
By T. Stickel - Published on Amazon.com
Format:Paperback|Verified Purchase
I started in the 90's with VB and then VB.NET for .NET in 2001-2002. I made the transition to C# in 2002-2003 and I used the standard code behind model. I didn't know about DI / IOC / Unit Testing etc... until 3 years ago as I was using so many technologies. In the past few years of using MVC 1,2,3 and now doing unit testing , DI, design patterns, Mocking with Moq etc..., this book is vital for my development as a good developer. Mark Seemann writes so well. I now look best at the code I wrote 6 months ago as utter garbage. Knowing fundamental C# development is essential backbone to this book, but to skip on not owning and reading this book may possibly be the difference between having a job and not a having a job in .NET in 5 years. The .NET interviews I have had in the last 3-4 years have been increasingly demanding on what to know etc... This book fosters how to do things the right way. The manning books have also become a favorite, ... so move over Apress and Wrox ... Manning is king IMO. This book was recommended to me by a friend who worked for a Microsoft Gold Partner. Sometimes I go with Ebooks, but I'm glad I was the paperback of this one. Take your .NET to the next leavel. IOC and DI are NOT the same thing! The author is on stackoverflow.com answering questions etc... Even if you do Java or a Dynamic language, you will end up really thinking about software development that is loosely coupled for real, and not just a buzz word. Enjoy as I did.
6 of 6 people found the following review helpful
5.0 out of 5 stars More than just Dependency Injection April 7 2012
By Dennis Rongo - Published on Amazon.com
Format:Paperback|Verified Purchase
My interest as of late has been in the area of Design Patterns and Architecture, and I've decided to give this book a go based on the excellent reviews that it has received so far.
This is one of those books in .NET that I wish I've read much sooner. The more I dig in deeper into the book's content, the more I wished that more books were written similar to this. The writing style is second to none (I can't stop reading), and DI is explained thoroughly.

The author initially goes back to the basics of DI and go over what it is and the problem that it tries to solves. He then proceeds to write code that are tightly coupled, which he then goes back and shows how it can be re-written or refactored to become loosely coupled. The book also covers DI containers or injectors as how it satisfies the need of resolving dependencies. Although DI containers are available, it's valuable to know what going on behind the scene and how to architect a project that is adaptable to any unforeseen scenarios.

There are technical books out there where authors gloss over a subject which means that they're either too lazy to explain it, or they're not knowledgeable enough in that area. This book is different. The author not just understand the subject but knows how to explain it very well. He covers all the grounds of Dependency Injection; the ins-and-outs as well as the finer details. There are no questions that are left unanswered. I was actually surprised how massive the book initially was and didn't think that covering DI would span into so many pages. I assumed a lot of things regarding DI and this book changed those assumptions as well as clarified a lot of things. I've gained not just knowledge in the scope of DI but as well as insights in Design Patterns. Reading this book made me re-evaluate my approach when architecting a new project or even how I approach an existing project's architecture.

I enjoyed reading this book and recommend this to all .NET developers of any level. Whatever you experience level is, you'll gain something from this book. It changed my thinking process on how I approach my code and have become a better developer overall. This is without a doubt a new favorite book of mine and I own tons of technical books already. I definitely had fun reading it and highly recommended.
Search Customer Reviews
Only search this product's reviews


Feedback