C# Class Gtd.Pcl.CoreDomain.AppServices.TrustedSystem.TrustedSystemState

This is the current in-memory "state" half of our A+ES implementation. We split the Aggregates and Event Sourcing (A+ES) implementation into two distinct classes: - one for state (AggregateNameState), - and one for behavior (AggregateName), with the state object (this class) being held by the behavioral object (the Aggregate). The two objects collaborate exclusively through the Aggregate's Apply() method. This ensures that an Aggregate's state is changed only by means of Events. This AggregateState class typically exists for very short periods at a time (likely milliseconds) when the Aggregate is loaded from Event Stream history and the Events are replayed through this state class to derive current Aggregate state. This current in-memory state ensures that Aggregate behaviors (methods) with multiple steps, have up-to-date state to operate on for each subsequent step. When changes are made to an Aggregate, and the results are persisted back to the Event Stream by the ApplicationService, the system drops all references to this state class instance and it is garbage collected.
Inheritance: ITrustedSystemState
ファイルを表示 Open project: beingtheworst/btw-gtd Class Usage Examples

Public Properties

Property Type Description
Actions ActionInfo>.IDictionary
Inbox HashSet
Projects ProjectInfo>.IDictionary
StuffInInbox StuffInfo>.IDictionary

Public Methods

Method Description
BuildStateFromEventHistory ( IEnumerable events ) : TrustedSystemState
MakeStateRealize ( ITrustedSystemEvent thisEventTypeHappened ) : void
TrustedSystemState ( ) : System
When ( ActionArchived e ) : void
When ( ActionAssignedToProject e ) : void
When ( ActionCompleted e ) : void
When ( ActionDeferDateShifted e ) : void
When ( ActionDeferredUntil e ) : void
When ( ActionDefined e ) : void
When ( ActionDueDateMoved e ) : void
When ( ActionIsNoLongerDeferred e ) : void
When ( ActionMovedToProject e ) : void
When ( ActionOutcomeChanged e ) : void
When ( ActionRemovedFromProject e ) : void
When ( DueDateAssignedToAction e ) : void
When ( DueDateRemovedFromAction e ) : void
When ( ProjectDefined e ) : void
When ( ProjectOutcomeChanged e ) : void
When ( ProjectTypeChanged e ) : void
When ( StuffArchived e ) : void
When ( StuffDescriptionChanged e ) : void
When ( StuffPutInInbox e ) : void
When ( StuffTrashed e ) : void
When ( TrustedSystemCreated e ) : void

Method Details

BuildStateFromEventHistory() public static method

public static BuildStateFromEventHistory ( IEnumerable events ) : TrustedSystemState
events IEnumerable
return TrustedSystemState

MakeStateRealize() public method

public MakeStateRealize ( ITrustedSystemEvent thisEventTypeHappened ) : void
thisEventTypeHappened ITrustedSystemEvent
return void

TrustedSystemState() public method

public TrustedSystemState ( ) : System
return System

When() public method

public When ( ActionArchived e ) : void
e ActionArchived
return void

When() public method

public When ( ActionAssignedToProject e ) : void
e ActionAssignedToProject
return void

When() public method

public When ( ActionCompleted e ) : void
e ActionCompleted
return void

When() public method

public When ( ActionDeferDateShifted e ) : void
e ActionDeferDateShifted
return void

When() public method

public When ( ActionDeferredUntil e ) : void
e ActionDeferredUntil
return void

When() public method

public When ( ActionDefined e ) : void
e ActionDefined
return void

When() public method

public When ( ActionDueDateMoved e ) : void
e ActionDueDateMoved
return void

When() public method

public When ( ActionIsNoLongerDeferred e ) : void
e ActionIsNoLongerDeferred
return void

When() public method

public When ( ActionMovedToProject e ) : void
e ActionMovedToProject
return void

When() public method

public When ( ActionOutcomeChanged e ) : void
e ActionOutcomeChanged
return void

When() public method

public When ( ActionRemovedFromProject e ) : void
e ActionRemovedFromProject
return void

When() public method

public When ( DueDateAssignedToAction e ) : void
e DueDateAssignedToAction
return void

When() public method

public When ( DueDateRemovedFromAction e ) : void
e DueDateRemovedFromAction
return void

When() public method

public When ( ProjectDefined e ) : void
e ProjectDefined
return void

When() public method

public When ( ProjectOutcomeChanged e ) : void
e ProjectOutcomeChanged
return void

When() public method

public When ( ProjectTypeChanged e ) : void
e ProjectTypeChanged
return void

When() public method

public When ( StuffArchived e ) : void
e StuffArchived
return void

When() public method

public When ( StuffDescriptionChanged e ) : void
e StuffDescriptionChanged
return void

When() public method

public When ( StuffPutInInbox e ) : void
e StuffPutInInbox
return void

When() public method

public When ( StuffTrashed e ) : void
e StuffTrashed
return void

When() public method

public When ( TrustedSystemCreated e ) : void
e TrustedSystemCreated
return void

Property Details

Actions public_oe property

public IDictionary Actions
return ActionInfo>.IDictionary

Inbox public_oe property

public HashSet Inbox
return HashSet

Projects public_oe property

public IDictionary Projects
return ProjectInfo>.IDictionary

StuffInInbox public_oe property

public IDictionary StuffInInbox
return StuffInfo>.IDictionary