Class FacetName

Namespace
Cratis.Chronicle.Concepts.Patterns
Assembly
Cratis.Chronicle.dll

Represents the name of a facet - one contextual dimension a BehaviorPattern can be expressed in.

public record FacetName : ConceptAs<string>, IComparable<ConceptAs<string>>, IComparable<string>, IComparable, IEquatable<ConceptAs<string>>, IEquatable<FacetName>
Inheritance
FacetName
Implements
Inherited Members
Extension Methods

Constructors

FacetName(FacetName)

protected FacetName(FacetName original)

Parameters

original FacetName

FacetName(string)

Represents the name of a facet - one contextual dimension a BehaviorPattern can be expressed in.

public FacetName(string Value)

Parameters

Value string

The actual value.

Fields

AggregateType

The type of the event source the event was appended to.

public static readonly FacetName AggregateType

Field Value

FacetName

CausedByCommand

The command one level up the causation chain from the one that produced the event.

public static readonly FacetName CausedByCommand

Field Value

FacetName

CommandType

The type of command - or, when nothing above the event named itself, the event type - that produced the event.

public static readonly FacetName CommandType

Field Value

FacetName

CorrelationRootId

The correlation the event belongs to, identifying the flow it took part in.

public static readonly FacetName CorrelationRootId

Field Value

FacetName

Day

The day of week the event occurred on.

public static readonly FacetName Day

Field Value

FacetName

InitiatorId

The identifier of the initiator that caused the event.

public static readonly FacetName InitiatorId

Field Value

FacetName

InitiatorType

What kind of initiator caused the event - a user, an agent or the system itself.

public static readonly FacetName InitiatorType

Field Value

FacetName

Month

The month the event occurred in.

public static readonly FacetName Month

Field Value

FacetName

OnBehalfOf

The identity the initiator acted on behalf of, when it acted for someone else.

public static readonly FacetName OnBehalfOf

Field Value

FacetName

TimeBucket

The TimeBucket the event occurred in.

public static readonly FacetName TimeBucket

Field Value

FacetName

Unspecified

Represents an unspecified FacetName.

public static readonly FacetName Unspecified

Field Value

FacetName

Year

The year the event occurred in.

public static readonly FacetName Year

Field Value

FacetName

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

IsAction

Gets a value indicating whether the facet names the action that was taken rather than the context it was taken in.

public bool IsAction { get; }

Property Value

bool

Remarks

The distinction is what separates the question from its answer. A caller describing a situation can name every context facet, because those are things they know - the day, the time of day, the kind of thing being worked on. They cannot name the action, because the action is what they are asking about.

This is not a query-side convenience: confidence is already defined against it, as the frequency of an itemset over the frequency of the same itemset with its action facets removed - the chance of the action given the context. Naming another facet here therefore changes what confidence means for every pattern that constrains it, so it is a modelling decision rather than a filter.

CausedByCommand is deliberately left as context. It reads as an answer to "what usually follows this" and as context to "what does this person do on a Monday", and only one of those can be true of a single definition.

Methods

Deconstruct(out string)

public void Deconstruct(out string Value)

Parameters

Value string

Equals(FacetName?)

public virtual bool Equals(FacetName? other)

Parameters

other FacetName

Returns

bool

Equals(ConceptAs<string>?)

public override sealed bool Equals(ConceptAs<string>? other)

Parameters

other ConceptAs<string>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Operators

operator ==(FacetName?, FacetName?)

public static bool operator ==(FacetName? left, FacetName? right)

Parameters

left FacetName
right FacetName

Returns

bool

implicit operator FacetName(string)

Implicitly convert from a string to FacetName.

public static implicit operator FacetName(string name)

Parameters

name string

String to convert from.

Returns

FacetName

operator !=(FacetName?, FacetName?)

public static bool operator !=(FacetName? left, FacetName? right)

Parameters

left FacetName
right FacetName

Returns

bool