Book description
As the first technical book of its kind, this unique resource walks you through the process of building a real-world application using Domain-Driven Design implemented in C#. Based on a real application for an existing company, each chapter is broken down into specific modules so that you can identify the problem, decide what solution will provide the best results, and then execute that design to solve the problem. With each chapter, you'll build a complete project from beginning to end.
Table of contents
- Copyright
- About the Author
- Credits
- Acknowledgments
- Introduction
-
1. Introducing the Project: The SmartCA Application
- 1.1. The Problem
- 1.2. The Design
-
1.3. The Solution
- 1.3.1. Fulfilling the Reliability, Availability, Scalability, Offline Capable, and Additional Client Device Support Requirements
- 1.3.2. Fulfilling the Maintainability Requirement
- 1.3.3. Fulfilling the Rich Client Application Functionality Requirement
- 1.3.4. Fulfilling the Web Access Requirement
- 1.3.5. Fulfilling the Intelligent Installation and Auto-Update Functionality Requirement
- 1.4. Summary
-
2. Designing the Layered Architecture
- 2.1. The Problem
-
2.2. The Design
- 2.2.1. Designing the Visual Studio Solution
-
2.2.2. Designing the Architectural Layers
- 2.2.2.1. Designing the Application Layer
-
2.2.2.2. Designing the Domain Layer
- 2.2.2.2.1. Important Domain-Driven Design Concepts
- 2.2.2.2.2. Entities
- 2.2.2.2.3. Value Objects
- 2.2.2.2.4. Services
- 2.2.2.2.5. Application Layer Services
- 2.2.2.2.6. Domain Layer Services
- 2.2.2.2.7. Infrastructure Layer Services
- 2.2.2.2.8. Aggregates
- 2.2.2.2.9. Repositories
- 2.2.2.2.10. Factories
- 2.2.2.2.11. Using Repositories in the Domain Layer
- 2.2.2.2.12. Using the Layered Supertype Pattern
- 2.2.2.3. Designing the Infrastructure Layer
- 2.2.2.4. Designing the Presentation Layer
-
2.3. The Solution
- 2.3.1. Implementing the Visual Studio Solution
-
2.3.2. Implementing the Architectural Layers
- 2.3.2.1. Layered Supertype
-
2.3.2.2. Repository Framework
- 2.3.2.2.1. The Interfaces
- 2.3.2.2.2. The Repository Factory
- 2.3.2.2.3. Configuration Section
- 2.3.2.2.4. Configuration Section Handling
- 2.3.2.2.5. The RepositoryFactory Class
- 2.3.2.2.6. Unit of Work
- 2.3.2.2.7. The Repository Base Classes
- 2.3.2.2.8. The RepositoryBase<T> Class
- 2.3.2.2.9. The SqlCeRepositoryBase<T> Class
- 2.3.2.2.10. The Entity Factory Framework
- 2.3.2.2.11. The IEntityFactory<T> Interface
- 2.3.2.2.12. Configuration Section
- 2.3.2.2.13. Configuration Section Handling
- 2.3.2.2.14. The EntityFactoryBuilder Class
- 2.3.2.3. The Model-View-ViewModel Pattern
- 2.4. Summary
-
3. Managing Projects
- 3.1. The Problem
- 3.2. The Design
-
3.3. The Solution
- 3.3.1. The Project Class
-
3.3.2. The Properties
- 3.3.2.1. The Name and Number Properties
- 3.3.2.2. The Address Property
- 3.3.2.3. The Owner Property
- 3.3.2.4. The ConstructionAdministrator and PrincipalInCharge Properties
- 3.3.2.5. The Segment Property
- 3.3.2.6. The ContingencyAllowanceAmount, TestingAllowanceAmount, and UtilityAllowanceAmount Properties
- 3.3.2.7. The Contracts Property
-
3.3.3. The Repository Implementations
- 3.3.3.1. The Project Repository
- 3.3.3.2. Refactoring the FindAll and FindBy Methods
- 3.3.3.3. The Organization of the ProjectRepository Class
- 3.3.3.4. The Constructors
- 3.3.3.5. The IProjectRepository Implementation
- 3.3.3.6. The BuildChildCallbacks Method
- 3.3.3.7. The AppendOwner Callback Method
- 3.3.3.8. The AppendConstructionAdministrator and AppendPrincipal Callback Methods
- 3.3.3.9. The AppendProjectAllowances Callback Method
- 3.3.3.10. The GetBaseQuery Method
- 3.3.3.11. The GetBaseWhereClause Method
- 3.3.3.12. The Unit of Work Implementation
- 3.3.4. The Employee Repository
- 3.3.5. The IEmployeeRepository Implementation
- 3.3.6. The Service Class Implementations
- 3.3.7. The EmployeeService Class
- 3.3.8. The Project Information ViewModel Implementation
- 3.4.1. The Project Information View Implementation
- 3.4. Summary
-
4. Companies and Contacts
- 4.1. The Problem
- 4.2. The Design
-
4.3. The Solution
- 4.3.1. The Company Class
- 4.3.2. The Contact Class
- 4.3.3. The ProjectContact Class
- 4.3.4. The Repository Implementations
- 4.3.5. The Refactored Project Repository Implementation
- 4.3.6. The Service Class Implementations
- 4.3.7. The Company ViewModel
- 4.3.8. The Company View
- 4.3.9. The Project Contact View Model
- 4.4. Summary
-
5. Submittal Transmittals
- 5.1. The Problem
- 5.2. The Design
-
5.3. The Solution
-
5.3.1.
- 5.3.1.1. Implementing the Submittal Class Private Fields and Constructors
-
5.3.1.2. The Submittal Properties
- 5.3.1.2.1. The SpecSection Property
- 5.3.1.2.2. The DeliveryMethod Property
- 5.3.1.2.3. The CopyToList Property
- 5.3.1.2.4. The TrackingItems Property
- 5.3.1.2.5. The Constructor
- 5.3.1.2.6. The TotalItemsSent and TotalItemsReceived Properties
- 5.3.1.2.7. The DeferredApproval Property
- 5.3.1.2.8. The Status Property
- 5.3.1.2.9. The RoutingItems Property
- 5.3.1.2.10. The Constructor
- 5.3.1.2.11. The Properties
- 5.3.1.2.12. The Status Property
- 5.3.1.2.13. The RemainderLocation Property
-
5.3.2. The Submittal Repository Implementation
-
5.3.2.1.
- 5.3.2.1.1. The AppendFrom Callback
- 5.3.2.1.2. The AppendTo Callback
- 5.3.2.1.3. The AppendCopyToList Callback
- 5.3.2.1.4. The AppendTrackingItems Callback
- 5.3.2.1.5. The AppendRoutingItems Callback
- 5.3.2.1.6. Unit of Work Implementation
- 5.3.2.1.7. The PersistNewItem Method
- 5.3.2.1.8. The PersistUpdatedItem Method
- 5.3.2.1.9. The PersistDeletedItem Method
-
5.3.2.1.
- 5.3.3. The Submittal Service Implementation
- 5.3.4. The Submittal View Model
- 5.3.5. The Submittal View
-
5.3.1.
- 5.4. Summary
-
6. Requests for Information
- 6.1. The Problem
- 6.2. The Design
-
6.3. The Solution
- 6.3.1.
- 6.3.2. The RFI Repository Implementation
- 6.3.3. The RFI Service Implementation
- 6.3.4. The RFI ViewModel Classes
- 6.3.5. The RFI View
- 6.4. Summary
-
7. Proposal Requests
- 7.1. The Problem
- 7.2. The Design
-
7.3. The Solution
- 7.3.1. The Proposal Request Class Private Fields and Constructors
- 7.3.2. The ProposalRequest Properties
- 7.3.3. The Validate Method
- 7.3.4. The Proposal Request Repository Implementation
- 7.3.5. The Proposal Request Service Implementation
- 7.3.6. The Proposal Request View Model Class
- 7.3.7. The Proposal Request View
- 7.4. Summary
-
8. Change Orders
- 8.1. The Problem
- 8.2. The Design
-
8.3. The Solution
- 8.3.1.
- 8.3.2. The Change Order Repository Implementation
- 8.3.3. The Change Order Service Implementation
- 8.3.4. The Change Order View Model Class
- 8.3.5. The Change Order View
- 8.4. Summary
-
9. Construction Change Directives
- 9.1. The Problem
- 9.2. The Design
-
9.3. The Solution
- 9.3.1. The Construction Change Directive Class Private Fields and Constructors
- 9.3.2. The Construction Change Directive Repository Implementation
- 9.3.3. The Construction Change Directive Service Implementation
- 9.3.4. The Construction Change Directive ViewModel Class
- 9.3.5. The Construction Change Directive View
- 9.4. Summary
-
10. Synchronizing With the Server
- 10.1. The Problem
-
10.2. The Design
- 10.2.1. Redesigning the Unit of Work
- 10.2.2. The Refactored IUnitOfWork Interface
- 10.2.3. The new IClientTransactionRepository Interface
- 10.2.4. The Transaction Class Implementations
- 10.2.5. Designing the Synchronization
- 10.2.6. Writing the Unit Tests
- 10.2.7. The IClientTransactionRepositoryAddTest Method
- 10.2.8. The FindPendingTransactionsTest Method
- 10.2.9. The SetLastSynchronizationTest Method
- 10.2.10. The GetLastSynchronizationTest Method
-
10.3. The Solution
-
10.3.1. Unit of Work Refactoring
- 10.3.1.1. The Commit Method
- 10.3.1.2. The UnitOfWork Key
- 10.3.1.3. New Properties and Changes to the Constructor
- 10.3.1.4. The Transaction Class Implementations
- 10.3.1.5. The Client Transaction Repository Implementation
- 10.3.1.6. The ClientTransactionRepository Class
- 10.3.1.7. The SqlCeClientTransactionRepository Class
- 10.3.1.8. The ClientTransactionService Class
-
10.3.2. Synchronizing with the Synchronizer Class
-
10.3.2.1. Constructor
- 10.3.2.1.1. The GetLastSynchronized Method
- 10.3.2.1.2. The SetLastSynchronized Method
- 10.3.2.1.3. The ProcessReferenceData Method
- 10.3.2.1.4. The IReferenceDataRepository Interface
- 10.3.2.1.5. The ReferenceDataRepositoryFactory Class
- 10.3.2.1.6. The IReferenceDataRepository Implementation – The SqlCeReferenceDataRepository Class
- 10.3.2.1.7. The ProcessServerTransactions Method
- 10.3.2.2. The Main Method – the Synchronize Method
-
10.3.2.1. Constructor
-
10.3.1. Unit of Work Refactoring
- 10.4. Summary
-
11. The Client Membership System
- 11.1. The Problem
- 11.2. The Design
-
11.3. The Solution
-
11.3.1. The Client Membership System Domain Model Classes
- 11.3.1.1. The User Class
-
11.3.1.2. The ClientMembershipUser Class
- 11.3.1.2.1. Class Signature and Private Fields
- 11.3.1.2.2. The Constructor
- 11.3.1.2.3. The Properties
- 11.3.1.2.4. The Methods
- 11.3.1.2.5. The PasswordAttemptFailed Method
- 11.3.1.2.6. The PasswordAttemptSucceeded Method
- 11.3.1.2.7. The PasswordAnswerAttemptFailed Method
- 11.3.1.2.8. The PasswordAnswerAttemptSucceeded Method
- 11.3.1.3. The Application Class
-
11.3.1.4. The Client Membership System Provider Framework and Implementation
- 11.3.1.4.1. The IClientMembershipProvider Interface
- 11.3.1.4.2. The ProviderFactory Class
- 11.3.1.4.3. The ClientMembershipProvider Class
- 11.3.1.4.4. Class Signature and Private Fields
- 11.3.1.4.5. The Constructor
- 11.3.1.4.6. The Methods
- 11.3.1.4.7. The SqlCeClientMembershipProvider Class
- 11.3.1.4.8. Class Signature and Private Fields
- 11.3.1.4.9. The Initialize Method Override
- 11.3.1.4.10. The GetUser Method Overrides
- 11.3.1.4.11. The Other Method Overrides of the SqlCeClientMembershipProvider Class
- 11.3.1.5. The ClientMembershipService Class
- 11.3.2. Client Membership System Unit Tests
-
11.3.1. The Client Membership System Domain Model Classes
- 11.4. Summary
Product information
- Title: .NET Domain-Driven Design with C#: Problem – Design – Solution
- Author(s):
- Release date: April 2008
- Publisher(s): Wrox
- ISBN: 9780470147566
You might also like
book
Design Patterns in .NET Core 3: Reusable Approaches in C# and F# for Object-Oriented Software Design
Implement design patterns in .NET Core 3 using the latest versions of the C# and F# …
book
Design Patterns in .NET: Reusable Approaches in C# and F# for Object-Oriented Software Design
Implement design patterns in .NET using the latest versions of the C# and F# languages. This …
book
Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
“[This] is a book about design in the .NET world, driven in an agile manner and …
book
An Atypical ASP.NET Core 5 Design Patterns Guide
A .NET developer's guide to crafting robust, maintainable, and flexible web apps by leveraging C# 9 …