orleans-architecture-patterns-code icon indicating copy to clipboard operation
orleans-architecture-patterns-code copied to clipboard

Question: Regarding an interface definition

Open asifshiraz opened this issue 7 years ago • 0 comments

In the BankAccountAggregateBalance class used for event sourcing example, an interface ICanApplyEvent<TEvent, TState> is being used to apply an event to modify an object state.

We are invoking this method on a TState object, to apply the TEvent to it. But I find it redundant to pass in the TState object also, on which we apply the event. This is not a static method, but an instance method, so it knows to apply the TEvent on itself. Can you advise what benefit this is providing, and why not use this, instead of the passed TState.

asifshiraz avatar May 19 '17 14:05 asifshiraz