Applying Domain-Driven Design and Patterns: With Examples in C# and .NET

Jimmy Nilsson

立即出貨 (庫存=1)




“[This] is a book about design in the .NET world, driven in an agile manner and infused with the products of the enterprise patterns community. [It] shows you how to begin applying such things as TDD, object relational mapping, and DDD to .NET projects...techniques that many developers think are the key to future software development.... As the technology gets more capable and sophisticated, it becomes more important to understand how to use it well. This book is a valuable step toward advancing that understanding.”

–Martin Fowler, author of Refactoring and Patterns of Enterprise Application Architecture


Patterns, Domain-Driven Design (DDD), and Test-Driven Development (TDD) enable architects and developers to create systems that are powerful, robust, and maintainable. Now, there’s a comprehensive, practical guide to leveraging all these techniques primarily in Microsoft .NET environments, but the discussions are just as useful for Java developers.


Drawing on seminal work by Martin Fowler (Patterns of Enterprise Application Architecture) and Eric Evans (Domain-Driven Design), Jimmy Nilsson shows how to create real-world architectures for any .NET application. Nilsson illuminates each principle with clear, well-annotated code examples based on C# 1.1 and 2.0. His examples and discussions will be valuable both to C# developers and those working with other .NET languages and any databases–even with other platforms, such as J2EE. Coverage includes


·        Quick primers on patterns, TDD, and refactoring

·        Using architectural techniques to improve software quality

·        Using domain models to support business rules and validation

·        Applying enterprise patterns to provide persistence support via NHibernate

·        Planning effectively for the presentation layer and UI testing

·        Designing for Dependency Injection, Aspect Orientation, and other new paradigms



Table of Contents

About the Author     xxv

Forewords     xxvii

Preface: Bridging Gaps     xxxi

Part I: Background

Chapter 1: Values to Value     3

Chapter 2: A Head Start on Patterns     47

Chapter 3: TDD and Refactoring     77

Part II: Applying DDD

Chapter 4: A New Default Architecture     113

Chapter 5: Moving Further with Domain-Driven Design     143

Chapter 6: Preparing for Infrastructure     181

Chapter 7: Let the Rules Rule     229

Part III: Applying PoEAA

Chapter 8: Infrastructure for Persistence     279

Chapter 9: Putting NHibernate into Action     311

Part IV: What’s Next?

Chapter 10: Design Techniques to Embrace     349

Chapter 11: Focus on the UI     407

Part V: Appendices

Appendix A: Other Domain Model Styles     447

Appendix B: Catalog of Discussed Patterns     483

References     493

Index     501