You are previewing .NET Domain-Driven Design with C#: Problem – Design – Solution.
O'Reilly logo
.NET Domain-Driven Design with C#: Problem – Design – Solution

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

  1. Copyright
  2. About the Author
  3. Credits
  4. Acknowledgments
  5. Introduction
    1. Who This Book Is For
    2. What This Book Covers
    3. How This Book Is Structured
    4. What You Need to Use This Book
    5. Source Code
    6. Errata
    7. p2p.wrox.com
  6. 1. Introducing the Project: The SmartCA Application
    1. 1.1. The Problem
    2. 1.2. The Design
      1. 1.2.1. Reliability and Availability
      2. 1.2.2. Scalability
      3. 1.2.3. Maintainability
      4. 1.2.4. Rich Client Application Functionality
      5. 1.2.5. Offline Capable
      6. 1.2.6. Web Access
      7. 1.2.7. Intelligent Installation and Auto-Update Functionality
      8. 1.2.8. Additional Client Device Support
    3. 1.3. The Solution
      1. 1.3.1. Fulfilling the Reliability, Availability, Scalability, Offline Capable, and Additional Client Device Support Requirements
        1. 1.3.1.1. On the Server
        2. 1.3.1.2. On the Client
      2. 1.3.2. Fulfilling the Maintainability Requirement
      3. 1.3.3. Fulfilling the Rich Client Application Functionality Requirement
        1. 1.3.3.1. Windows Application Benefits
        2. 1.3.3.2. Web Application Benefits
        3. 1.3.3.3. Smart Client Definition
        4. 1.3.3.4. Windows Presentation Foundation (WPF)
      4. 1.3.4. Fulfilling the Web Access Requirement
      5. 1.3.5. Fulfilling the Intelligent Installation and Auto-Update Functionality Requirement
    4. 1.4. Summary
  7. 2. Designing the Layered Architecture
    1. 2.1. The Problem
    2. 2.2. The Design
      1. 2.2.1. Designing the Visual Studio Solution
      2. 2.2.2. Designing the Architectural Layers
        1. 2.2.2.1. Designing the Application Layer
        2. 2.2.2.2. Designing the Domain Layer
          1. 2.2.2.2.1. Important Domain-Driven Design Concepts
          2. 2.2.2.2.2. Entities
          3. 2.2.2.2.3. Value Objects
          4. 2.2.2.2.4. Services
          5. 2.2.2.2.5. Application Layer Services
          6. 2.2.2.2.6. Domain Layer Services
          7. 2.2.2.2.7. Infrastructure Layer Services
          8. 2.2.2.2.8. Aggregates
          9. 2.2.2.2.9. Repositories
          10. 2.2.2.2.10. Factories
          11. 2.2.2.2.11. Using Repositories in the Domain Layer
          12. 2.2.2.2.12. Using the Layered Supertype Pattern
        3. 2.2.2.3. Designing the Infrastructure Layer
        4. 2.2.2.4. Designing the Presentation Layer
    3. 2.3. The Solution
      1. 2.3.1. Implementing the Visual Studio Solution
      2. 2.3.2. Implementing the Architectural Layers
        1. 2.3.2.1. Layered Supertype
        2. 2.3.2.2. Repository Framework
          1. 2.3.2.2.1. The Interfaces
          2. 2.3.2.2.2. The Repository Factory
          3. 2.3.2.2.3. Configuration Section
          4. 2.3.2.2.4. Configuration Section Handling
          5. 2.3.2.2.5. The RepositoryFactory Class
          6. 2.3.2.2.6. Unit of Work
          7. 2.3.2.2.7. The Repository Base Classes
          8. 2.3.2.2.8. The RepositoryBase<T> Class
          9. 2.3.2.2.9. The SqlCeRepositoryBase<T> Class
          10. 2.3.2.2.10. The Entity Factory Framework
          11. 2.3.2.2.11. The IEntityFactory<T> Interface
          12. 2.3.2.2.12. Configuration Section
          13. 2.3.2.2.13. Configuration Section Handling
          14. 2.3.2.2.14. The EntityFactoryBuilder Class
        3. 2.3.2.3. The Model-View-ViewModel Pattern
          1. 2.3.2.3.1. Traditional Presentation Patterns
          2. 2.3.2.3.2. Model-View-ViewModel Definition
          3. 2.3.2.3.3. What's a ViewModel?
          4. 2.3.2.3.4. An Example
    4. 2.4. Summary
  8. 3. Managing Projects
    1. 3.1. The Problem
    2. 3.2. The Design
      1. 3.2.1. Designing the Domain Model
      2. 3.2.2. Defining the Project Aggregate
      3. 3.2.3. Defining the Aggregate Boundaries
      4. 3.2.4. Designing the Repositories
        1. 3.2.4.1. The IProjectRepository Interface
        2. 3.2.4.2. The IEmployeeRepository Interface
      5. 3.2.5. Writing the Unit Tests
        1. 3.2.5.1. Setting Up the Unit Tests Project
        2. 3.2.5.2. The IProjectRepository Unit Tests
        3. 3.2.5.3. The FindBySegmentsAndNotCompletedTest Method
        4. 3.2.5.4. The FindByProjectNumberTest Method
        5. 3.2.5.5. The FindAllMarketSegmentsTest Method
      6. 3.2.6. The IEmployeeRepository Unit Tests
        1. 3.2.6.1. The GetPrincipalsTest Method
        2. 3.2.6.2. The GetConstructionAdministratorsTest Method
    3. 3.3. The Solution
      1. 3.3.1. The Project Class
        1. 3.3.1.1. The Private Fields and Constructors
      2. 3.3.2. The Properties
        1. 3.3.2.1. The Name and Number Properties
        2. 3.3.2.2. The Address Property
        3. 3.3.2.3. The Owner Property
        4. 3.3.2.4. The ConstructionAdministrator and PrincipalInCharge Properties
        5. 3.3.2.5. The Segment Property
        6. 3.3.2.6. The ContingencyAllowanceAmount, TestingAllowanceAmount, and UtilityAllowanceAmount Properties
        7. 3.3.2.7. The Contracts Property
      3. 3.3.3. The Repository Implementations
        1. 3.3.3.1. The Project Repository
        2. 3.3.3.2. Refactoring the FindAll and FindBy Methods
        3. 3.3.3.3. The Organization of the ProjectRepository Class
        4. 3.3.3.4. The Constructors
        5. 3.3.3.5. The IProjectRepository Implementation
        6. 3.3.3.6. The BuildChildCallbacks Method
        7. 3.3.3.7. The AppendOwner Callback Method
        8. 3.3.3.8. The AppendConstructionAdministrator and AppendPrincipal Callback Methods
        9. 3.3.3.9. The AppendProjectAllowances Callback Method
        10. 3.3.3.10. The GetBaseQuery Method
        11. 3.3.3.11. The GetBaseWhereClause Method
        12. 3.3.3.12. The Unit of Work Implementation
      4. 3.3.4. The Employee Repository
        1. 3.3.4.1. The Constructors
      5. 3.3.5. The IEmployeeRepository Implementation
        1. 3.3.5.1. The GetBaseQuery Method
        2. 3.3.5.2. The GetBaseWhereClause Method
      6. 3.3.6. The Service Class Implementations
        1. 3.3.6.1. The ProjectService Class
      7. 3.3.7. The EmployeeService Class
      8. 3.3.8. The Project Information ViewModel Implementation
        1. 3.3.8.1. The ViewModel Class Revisited
        2. 3.3.8.2. The ProjectInformationViewModel Class
        3. 3.3.8.3. The Constructors
        4. 3.3.8.4. The MutableAddress Class
        5. 3.3.8.5. Using the C# 3.0 Initializer Features
        6. 3.3.8.6. Transforming the Model Objects into View Objects
        7. 3.3.8.7. The Properties
      9. 3.4.1. The Project Information View Implementation
    4. 3.4. Summary
  9. 4. Companies and Contacts
    1. 4.1. The Problem
    2. 4.2. The Design
      1. 4.2.1. Designing the Domain Model
      2. 4.2.2. Defining the Company and Contact Aggregates
      3. 4.2.3. Defining the Aggregate Boundaries
      4. 4.2.4. Designing the Repositories
        1. 4.2.4.1. The ICompanyRepository Interface
        2. 4.2.4.2. The IContactRepository Interface
        3. 4.2.4.3. The IProjectRepository Interface Revisited
      5. 4.2.5. Writing the Unit Tests
        1. 4.2.5.1. The ICompanyRepository Unit Tests
          1. 4.2.5.1.1. The FindByKeyTest Method
          2. 4.2.5.1.2. The FindAllTest Method
          3. 4.2.5.1.3. The AddTest Method
          4. 4.2.5.1.4. The UpdateTest Method
          5. 4.2.5.1.5. The RemoveTest Method
        2. 4.2.5.2. The IContactRepository Unit Tests
        3. 4.2.5.3. The IProjectRepository Unit Test
    3. 4.3. The Solution
      1. 4.3.1. The Company Class
      2. 4.3.2. The Contact Class
      3. 4.3.3. The ProjectContact Class
      4. 4.3.4. The Repository Implementations
        1. 4.3.4.1. The Company Repository
          1. 4.3.4.1.1. Public Constructors
          2. 4.3.4.1.2. BuildChildCallbacks
          3. 4.3.4.1.3. The AppendAddresses Callback
          4. 4.3.4.1.4. GetBaseQuery
          5. 4.3.4.1.5. GetBaseWhereClause
          6. 4.3.4.1.6. Unit of Work Implementation
        2. 4.3.4.2. The Contact Repository
          1. 4.3.4.2.1. Public Constructors
          2. 4.3.4.2.2. GetBaseQuery
          3. 4.3.4.2.3. GetBaseWhereClause
          4. 4.3.4.2.4. Unit of Work Implementation
      5. 4.3.5. The Refactored Project Repository Implementation
      6. 4.3.6. The Service Class Implementations
        1. 4.3.6.1. The CompanyService Class
        2. 4.3.6.2. The ContactService Class
        3. 4.3.6.3. The ProjectService Class
      7. 4.3.7. The Company ViewModel
        1. 4.3.7.1. Constructor
        2. 4.3.7.2. Properties
        3. 4.3.7.3. Command Handler Methods
      8. 4.3.8. The Company View
        1. 4.3.8.1. Using the Xceed Data Grid
        2. 4.3.8.2. The Headquarters Address Addresses Dropdown
      9. 4.3.9. The Project Contact View Model
        1. 4.3.9.1. Constructor
        2. 4.3.9.2. Properties
        3. 4.3.9.3. Command Handler Methods
        4. 4.3.9.4. The Project Contact View
    4. 4.4. Summary
  10. 5. Submittal Transmittals
    1. 5.1. The Problem
    2. 5.2. The Design
      1. 5.2.1. Designing the Domain Model
      2. 5.2.2. Defining the Submittal Aggregate
      3. 5.2.3. Defining the Aggregate Boundaries
      4. 5.2.4. Designing the Repository
      5. 5.2.5. Writing the Unit Tests
        1. 5.2.5.1.
          1. 5.2.5.1.1. The FindSubmittalsByProjectTest Method
          2. 5.2.5.1.2. The AddSubmittalTest Method
          3. 5.2.5.1.3. The UpdateSubmittalTest Method
          4. 5.2.5.1.4. The RemoveSubmittalTest Method
    3. 5.3. The Solution
      1. 5.3.1.
        1. 5.3.1.1. Implementing the Submittal Class Private Fields and Constructors
        2. 5.3.1.2. The Submittal Properties
          1. 5.3.1.2.1. The SpecSection Property
          2. 5.3.1.2.2. The DeliveryMethod Property
          3. 5.3.1.2.3. The CopyToList Property
          4. 5.3.1.2.4. The TrackingItems Property
          5. 5.3.1.2.5. The Constructor
          6. 5.3.1.2.6. The TotalItemsSent and TotalItemsReceived Properties
          7. 5.3.1.2.7. The DeferredApproval Property
          8. 5.3.1.2.8. The Status Property
          9. 5.3.1.2.9. The RoutingItems Property
          10. 5.3.1.2.10. The Constructor
          11. 5.3.1.2.11. The Properties
          12. 5.3.1.2.12. The Status Property
          13. 5.3.1.2.13. The RemainderLocation Property
      2. 5.3.2. The Submittal Repository Implementation
        1. 5.3.2.1.
          1. 5.3.2.1.1. The AppendFrom Callback
          2. 5.3.2.1.2. The AppendTo Callback
          3. 5.3.2.1.3. The AppendCopyToList Callback
          4. 5.3.2.1.4. The AppendTrackingItems Callback
          5. 5.3.2.1.5. The AppendRoutingItems Callback
          6. 5.3.2.1.6. Unit of Work Implementation
          7. 5.3.2.1.7. The PersistNewItem Method
          8. 5.3.2.1.8. The PersistUpdatedItem Method
          9. 5.3.2.1.9. The PersistDeletedItem Method
      3. 5.3.3. The Submittal Service Implementation
      4. 5.3.4. The Submittal View Model
        1. 5.3.4.1. The Constructor
        2. 5.3.4.2. The Properties
        3. 5.3.4.3. Command Handler Methods
      5. 5.3.5. The Submittal View
        1. 5.3.5.1. Using the StackPanel Element
        2. 5.3.5.2. Using the Xceed DatePicker Control
        3. 5.3.5.3. The CopyToList Section
    4. 5.4. Summary
  11. 6. Requests for Information
    1. 6.1. The Problem
    2. 6.2. The Design
      1. 6.2.1. Designing the Domain Model
      2. 6.2.2. Defining the RFI Aggregate
      3. 6.2.3. Defining the Aggregate Boundaries
      4. 6.2.4. Designing the Repositoryx
      5. 6.2.5. Writing the Unit Tests
        1. 6.2.5.1.
          1. 6.2.5.1.1. The FindRfisByProjectTest Method
          2. 6.2.5.1.2. The AddRfiTest Method
          3. 6.2.5.1.3. The UpdateRfiTest Method
          4. 6.2.5.1.4. The RemoveRfiTest Method
    3. 6.3. The Solution
      1. 6.3.1.
        1. 6.3.1.1. The RFI Class Private Fields and Constructors
        2. 6.3.1.2. The RFI Properties
          1. 6.3.1.2.1. The DaysLapsed Property
          2. 6.3.1.2.2. The NumberSpecification Property
          3. 6.3.1.2.3. The DateToFieldSpecification Property
          4. 6.3.1.2.4. The QuestionAnswerSpecification Property
      2. 6.3.2. The RFI Repository Implementation
        1. 6.3.2.1. The BuildChildCallbacks Method
        2. 6.3.2.2. The AppendFrom Callback
        3. 6.3.2.3. The AppendCopyToList and AppendRoutingItems Callbacks
        4. 6.3.2.4. The Transmittal Refactoring
          1. 6.3.2.4.1. The AppendCopyToList Method
          2. 6.3.2.4.2. The DeleteCopyToList Method
          3. 6.3.2.4.3. The InsertCopyToList and InsertCopyTo Methods
        5. 6.3.2.5. Unit of Work Implementation
          1. 6.3.2.5.1. The PersistNewItem Method
          2. 6.3.2.5.2. The PersistUpdatedItem Method
          3. 6.3.2.5.3. PersistDeletedItem
      3. 6.3.3. The RFI Service Implementation
      4. 6.3.4. The RFI ViewModel Classes
        1. 6.3.4.1. The TransmittalViewModel<T> Class
          1. 6.3.4.1.1. The Constructor
          2. 6.3.4.1.2. The Properties
          3. 6.3.4.1.3. The Command Handler Methods
          4. 6.3.4.1.4. The GetTransmittals Template Pattern Method
        2. 6.3.4.2. The RequestForInformationViewModel Class
          1. 6.3.4.2.1. The Constructor
          2. 6.3.4.2.2. The Properties
          3. 6.3.4.2.3. The Command Handler Methods
          4. 6.3.4.2.4. The GetTransmittals Template Pattern Method
      5. 6.3.5. The RFI View
    4. 6.4. Summary
  12. 7. Proposal Requests
    1. 7.1. The Problem
    2. 7.2. The Design
      1. 7.2.1. Designing the Domain Model
      2. 7.2.2. Designing the Proposal Request Aggregate
      3. 7.2.3. Defining the Aggregate Boundaries
      4. 7.2.4. Designing the Repository
      5. 7.2.5. Writing the Unit Tests
        1. 7.2.5.1.
          1. 7.2.5.1.1. The FindProposalRequestsByProjectTest Method
          2. 7.2.5.1.2. The AddProposalRequestTest Method
          3. 7.2.5.1.3. The UpdateProposalRequestTest Method
          4. 7.2.5.1.4. The RemoveProposalRequestTest Method
    3. 7.3. The Solution
      1. 7.3.1. The Proposal Request Class Private Fields and Constructors
        1. 7.3.1.1. The GetExpectedContractorReturnDays Method
        2. 7.3.1.2. Initializing the expectedContractorReturnDate Class Variable
        3. 7.3.1.3. The ValidateInitialization Method
      2. 7.3.2. The ProposalRequest Properties
        1. 7.3.2.1. The Cause and Origin Properties
        2. 7.3.2.2. The NumberSpecification Property
        3. 7.3.2.3. The DescriptionSpecification Property
      3. 7.3.3. The Validate Method
      4. 7.3.4. The Proposal Request Repository Implementation
        1. 7.3.4.1.
          1. 7.3.4.1.1. The BuildChildCallbacks Method
          2. 7.3.4.1.2. The AppendTo Callback
          3. 7.3.4.1.3. The AppendFrom Callback
          4. 7.3.4.1.4. Unit of Work Implementation
          5. 7.3.4.1.5. The PersistNewItem Method
      5. 7.3.5. The Proposal Request Service Implementation
      6. 7.3.6. The Proposal Request View Model Class
        1. 7.3.6.1. The Constructor
        2. 7.3.6.2. The Properties
        3. 7.3.6.3. The Command Handler Methods
          1. 7.3.6.3.1. The NewCommandHandler Method
          2. 7.3.6.3.2. The SaveCommandHandler Method
        4. 7.3.6.4. The GetTransmittals Template Pattern Method
      7. 7.3.7. The Proposal Request View
        1. 7.3.7.1. The Transmittal User Control
        2. 7.3.7.2. The RoutableTransmittal User Control
    4. 7.4. Summary
  13. 8. Change Orders
    1. 8.1. The Problem
    2. 8.2. The Design
      1. 8.2.1. Designing the Domain Model
      2. 8.2.2. Designing the Change Order Aggregate
      3. 8.2.3. Defining the Aggregate Boundaries
      4. 8.2.4. Designing the Repository
        1. 8.2.4.1. Designing the IChangeOrderRepository Interface
          1. 8.2.4.1.1. Designing the INumberedProjectChild Interface
          2. 8.2.4.1.2. Designing the IAggregateRoot Interface
      5. 8.2.5. Writing the Unit Tests
    3. 8.3. The Solution
      1. 8.3.1.
        1. 8.3.1.1. The Change Order Class Private Fields and Constructors
          1. 8.3.1.1.1. The ValidateInitialization Method
        2. 8.3.1.2. The ChangeOrder Properties
          1. 8.3.1.2.1. The OriginalConstructionCost Property
          2. 8.3.1.2.2. The PreviousAuthorizedAmount Property
          3. 8.3.1.2.3. The NewConstructionCost Property
          4. 8.3.1.2.4. The PreviousTimeChangedTotal Property
          5. 8.3.1.2.5. The DateOfSubstantialCompletion Property
          6. 8.3.1.2.6. The NumberSpecification Property
        3. 8.3.1.3. The Validate Method
      2. 8.3.2. The Change Order Repository Implementation
        1. 8.3.2.1. The BuildChildCallbacks Method
          1. 8.3.2.1.1. The AppendContractor Callback
          2. 8.3.2.1.2. The AppendRoutingItems Callback
        2. 8.3.2.2. The FindBy Method
        3. 8.3.2.3. The GetPreviousAuthorizedAmountFrom Method
        4. 8.3.2.4. The GetPreviousTimeChangedTotalFrom Method
        5. 8.3.2.5. Unit of Work Implementation
          1. 8.3.2.5.1. The PersistNewItem Method
          2. 8.3.2.5.2. The PersistUpdatedItem Method
      3. 8.3.3. The Change Order Service Implementation
      4. 8.3.4. The Change Order View Model Class
        1. 8.3.4.1. The Constructor
        2. 8.3.4.2. The Properties
        3. 8.3.4.3. The Command Handler Methods
          1. 8.3.4.3.1. The NewCommandHandler method
          2. 8.3.4.3.2. The SaveCommandHandler Method
      5. 8.3.5. The Change Order View
    4. 8.4. Summary
  14. 9. Construction Change Directives
    1. 9.1. The Problem
    2. 9.2. The Design
      1. 9.2.1. Designing the Domain Model
      2. 9.2.2. Designing the Construction Change Directive Aggregate
      3. 9.2.3. Defining the Aggregate Boundaries
      4. 9.2.4. Designing the Repository
      5. 9.2.5. Writing the Unit Tests
    3. 9.3. The Solution
      1. 9.3.1. The Construction Change Directive Class Private Fields and Constructors
        1. 9.3.1.1.
          1. 9.3.1.1.1. The ValidateInitialization Method
        2. 9.3.1.2. The ConstructionChangeDirective Properties
          1. 9.3.1.2.1. The DescriptionSpecification Property
          2. 9.3.1.2.2. The HasBeenTransformedToChangeOrder Property
        3. 9.3.1.3. The Validate Method
        4. 9.3.1.4. The TransformToChangeOrder Method
        5. 9.3.1.5. The NumberedProjectChildFactory Class
      2. 9.3.2. The Construction Change Directive Repository Implementation
        1. 9.3.2.1. The BuildChildCallbacks Method
          1. 9.3.2.1.1. The AppendTo Callback
          2. 9.3.2.1.2. The AppendFrom Callback
          3. 9.3.2.1.3. The AppendContractor Callback
          4. 9.3.2.1.4. The FindBy Method
        2. 9.3.2.2. Unit of Work Implementation
          1. 9.3.2.2.1. The PersistNewItem Method
          2. 9.3.2.2.2. PersistUpdatedItem
      3. 9.3.3. The Construction Change Directive Service Implementation
      4. 9.3.4. The Construction Change Directive ViewModel Class
        1. 9.3.4.1. The Constructor
        2. 9.3.4.2. The Properties
        3. 9.3.4.3. The ViewModel Class Refactoring
        4. 9.3.4.4. The EditableViewModel<T> Class
          1. 9.3.4.4.1. The Constructors and Private Fields
          2. 9.3.4.4.2. The Properties
          3. 9.3.4.4.3. The CurrentObjectState Property
          4. 9.3.4.4.4. The CurrentEntity Property
          5. 9.3.4.4.5. The ValidateCurrentObject Method
        5. 9.3.4.5. The Command Handler Methods
          1. 9.3.4.5.1. The NewCommandHandler method
          2. 9.3.4.5.2. The SaveCommandHandler Method
        6. 9.3.4.6. The Newly Refactored TransmittalViewModel Class
          1. 9.3.4.6.1. The Constructor and Private Fields
          2. 9.3.4.6.2. The Properties
          3. 9.3.4.6.3. The NewCommandHandler Method
          4. 9.3.4.6.4. The SaveCurrentEntity Method Override
          5. 9.3.4.6.5. The SetCurrentEntity Method Override
        7. 9.3.4.7. The ConstructionChangeDirectiveViewModel Class Method Overrides
          1. 9.3.4.7.1. The BuildNewEntity Method Override
          2. 9.3.4.7.2. The SaveCurrentEntity Method Override
          3. 9.3.4.7.3. The GetEntitiesList Method Override
      5. 9.3.5. The Construction Change Directive View
    4. 9.4. Summary
  15. 10. Synchronizing With the Server
    1. 10.1. The Problem
    2. 10.2. The Design
      1. 10.2.1. Redesigning the Unit of Work
      2. 10.2.2. The Refactored IUnitOfWork Interface
      3. 10.2.3. The new IClientTransactionRepository Interface
      4. 10.2.4. The Transaction Class Implementations
      5. 10.2.5. Designing the Synchronization
      6. 10.2.6. Writing the Unit Tests
      7. 10.2.7. The IClientTransactionRepositoryAddTest Method
      8. 10.2.8. The FindPendingTransactionsTest Method
      9. 10.2.9. The SetLastSynchronizationTest Method
      10. 10.2.10. The GetLastSynchronizationTest Method
    3. 10.3. The Solution
      1. 10.3.1. Unit of Work Refactoring
        1. 10.3.1.1. The Commit Method
        2. 10.3.1.2. The UnitOfWork Key
        3. 10.3.1.3. New Properties and Changes to the Constructor
        4. 10.3.1.4. The Transaction Class Implementations
          1. 10.3.1.4.1. The Transaction Class
          2. 10.3.1.4.2. The ClientTransaction Class
          3. 10.3.1.4.3. The ServerTransaction Class
          4. 10.3.1.4.4. Data Contracts
        5. 10.3.1.5. The Client Transaction Repository Implementation
          1. 10.3.1.5.1. The ClientTransactionRepositoryFactory Class
        6. 10.3.1.6. The ClientTransactionRepository Class
        7. 10.3.1.7. The SqlCeClientTransactionRepository Class
          1. 10.3.1.7.1. Constructor
          2. 10.3.1.7.2. The PersistNewTransaction Method
          3. 10.3.1.7.3. The FindPending Method
          4. 10.3.1.7.4. The GetLastSynchronization Method
          5. 10.3.1.7.5. The SetLastSynchronization Method
        8. 10.3.1.8. The ClientTransactionService Class
      2. 10.3.2. Synchronizing with the Synchronizer Class
        1. 10.3.2.1. Constructor
          1. 10.3.2.1.1. The GetLastSynchronized Method
          2. 10.3.2.1.2. The SetLastSynchronized Method
          3. 10.3.2.1.3. The ProcessReferenceData Method
          4. 10.3.2.1.4. The IReferenceDataRepository Interface
          5. 10.3.2.1.5. The ReferenceDataRepositoryFactory Class
          6. 10.3.2.1.6. The IReferenceDataRepository Implementation – The SqlCeReferenceDataRepository Class
          7. 10.3.2.1.7. The ProcessServerTransactions Method
        2. 10.3.2.2. The Main Method – the Synchronize Method
    4. 10.4. Summary
  16. 11. The Client Membership System
    1. 11.1. The Problem
    2. 11.2. The Design
      1. 11.2.1. Password Security
      2. 11.2.2. Designing the Client Membership System
    3. 11.3. The Solution
      1. 11.3.1. The Client Membership System Domain Model Classes
        1. 11.3.1.1. The User Class
          1. 11.3.1.1.1. Class Signature and Private Fields
          2. 11.3.1.1.2. The Constructor
          3. 11.3.1.1.3. The Properties
          4. 11.3.1.1.4. The Methods
          5. 11.3.1.1.5. The ChangePassword Method
          6. 11.3.1.1.6. The ChangePasswordQuestionAndAnswer Method
          7. 11.3.1.1.7. The ResetPassword Method
        2. 11.3.1.2. The ClientMembershipUser Class
          1. 11.3.1.2.1. Class Signature and Private Fields
          2. 11.3.1.2.2. The Constructor
          3. 11.3.1.2.3. The Properties
          4. 11.3.1.2.4. The Methods
          5. 11.3.1.2.5. The PasswordAttemptFailed Method
          6. 11.3.1.2.6. The PasswordAttemptSucceeded Method
          7. 11.3.1.2.7. The PasswordAnswerAttemptFailed Method
          8. 11.3.1.2.8. The PasswordAnswerAttemptSucceeded Method
        3. 11.3.1.3. The Application Class
        4. 11.3.1.4. The Client Membership System Provider Framework and Implementation
          1. 11.3.1.4.1. The IClientMembershipProvider Interface
          2. 11.3.1.4.2. The ProviderFactory Class
          3. 11.3.1.4.3. The ClientMembershipProvider Class
          4. 11.3.1.4.4. Class Signature and Private Fields
          5. 11.3.1.4.5. The Constructor
          6. 11.3.1.4.6. The Methods
          7. 11.3.1.4.7. The SqlCeClientMembershipProvider Class
          8. 11.3.1.4.8. Class Signature and Private Fields
          9. 11.3.1.4.9. The Initialize Method Override
          10. 11.3.1.4.10. The GetUser Method Overrides
          11. 11.3.1.4.11. The Other Method Overrides of the SqlCeClientMembershipProvider Class
        5. 11.3.1.5. The ClientMembershipService Class
      2. 11.3.2. Client Membership System Unit Tests
        1. 11.3.2.1. The Login Test
        2. 11.3.2.2. The Change Password Test
        3. 11.3.2.3. The Change Password Question and Answer Test
    4. 11.4. Summary