Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Message Types: Commands, Events, and Queries; Event Notification and Event-Carried State Transfer
A command is imperative and goes to one receiver, an event is a past-tense fact that doesn't know its receivers, and a query expects an answer; that distinction decides a message's name, its contract owner, and its channel. An envelope with message, correlation, and causation ids, Fowler's event notification versus event-carried state transfer, and domain versus integration events, with real output.
Domain Events: Raise, Collect, and Dispatch on SaveChanges
An aggregate records what happened as a past-tense, immutable domain event in its own list; EF Core 10's SaveChangesInterceptor collects the events during SaveChanges, runs same-transaction handlers before the commit and side effects that leave the database after it. A mediator-free dispatcher, the nested SaveChanges and explicit transaction traps with real output, and how integration events and the outbox differ.
Discovering the Domain with EventStorming: From Big Picture to Aggregates
EventStorming is a workshop format that brings domain experts and developers to a shared language by placing what happens in the domain on a timeline as orange, past-tense stickies. We take Bookstore's order flow through the Big Picture, Process Modeling and Software Design levels and turn the hot spots, pivotal events, policies and aggregate candidates from the wall into code.
Observer Pattern in Depth: event, IObservable<T>, IChangeToken and Domain Events
Observer means that the objects depending on an object are notified when its state changes; in C# you meet it as event, in the BCL as IObservable<T>/IObserver<T>, and in ASP.NET Core as IChangeToken and IOptionsMonitor. Starting from a phantom confirmation email sent by an event raised before the save, we study the OnNext/OnError/OnCompleted contract, Rx.NET operators, single-use change tokens and domain events dispatched in isolation after the save, all with real output.