LIST

Domain Model - Architecture

(I don’t remember the source! If anyone can recognise it, let me know please!) Domain Model - Architecture OO model Aggregate - entities consistent (business rules / invariants) - persistence (one repo per aggregate) - guard access Domain Services Aggregate vs Service Repo <= Domain Service handles persistence for an aggregate Antipattern: Anemic Models

March 16, 2019

EventStore in relational DB

CQRS Documents - by Greg Young Events Column Type Comment AggregateId guid indexed, fk aggregates Data blob Version int unique within aggregate (UserId) guid (Timestamp) (CorrelationId) guid all events point to origin command (SequenceNumber) long auto-incrementingeventstore as queue Aggregates Column Type Comment AggregateId guid indexed, fk aggregates Type varchar fully qualified name Version int denormalized from Events Read event Select * from events where AggregateId =? Order by version Write event...

March 16, 2019

high level CQRS and Event sourcing

high level CQRS and Event sourcing client commands write / domain events read model dtos client

March 16, 2019

original code snippets from GregYoung 8 CQRS Class

Code snippets from GregYoung 8 CQRS Class - YouTube public class DeactivateInventoryItemCommand { public readonly Guid InventoryItemId; public readonly string Comment; public DeactivateInventoryItemCommand (Guid id, string comment) { InventoryItemId = id; Comment = comment; } void DeactivateInventoryItem(Guid, string comment) CommandHandler contains no logic, logic is in domain object delegates to domain object public class DeactivateInventoryItemHandler : Handles<DeactivateInventoryItem> { public DeactivateInventoryItemHandler(InventoryItemRepository rep){} void Handle(DeactivateInventoryItem cmd) { var item = repository.GetById(cmd.Id); item....

March 16, 2019

Video: GregYoung 8 CQRS Class

GregYoung 8 CQRS Class ( https://www.youtube.com/watch?v=whCk1Q87_ZI ) Code snippets from GregYoung 8 CQRS Class - YouTube original Code snippets from GregYoung 8 CQRS Class - YouTube

March 16, 2019

Course: CQRS in Practice

Course: CQRS in Practice (https://app.pluralsight.com/library/courses/cqrs-in-practice) CQRS & Onion Architecture Map CQRS & Onion Architecture where do C, Q, E belong? Map where do C, Q, E belong? Where to put Command Handlers Map Where to put Command Handlers Command reuse -> domain service Map Command reuse -> domain service Domain Service called for duplicate code Projections Map Choosing projection type A - database triggers...

March 10, 2019

Course: Clean Architecture: Patterns, Practices, and Principles

(https://www.pluralsight.com/courses/clean-architecture-patterns-practices-principles) Layers and modules Map Screaming architecture Map Screaming architecture ~ Functional organisation (packages) Pros & Cons Map Pros & Cons Types of Tests Map The Last Responsible Moment The Last Responsible Moment avoiding premature decisions by deferring the decisions to a point in time where the cost of not making the decision becomes greater than the cost of making the decision (src: [[course-clean-architecture-patterns-practices-and-principles....

March 9, 2019

Course: Modern Software Architecture: Domain Models, CQRS, and Event Sourcing

Course: Modern Software Architecture: Domain Models, CQRS, and Event Sourcing (https://app.pluralsight.com/library/courses/modern-software-architecture-domain-models-cqrs-event-sourcing) DDD relationships Map DDD relationships Layers Map Layers standard segments concern Business domain layer - invariants Map domain layer - invariants Domain services Map Domain services Infrastructure Map Infrastructure Insight: what do I log/monitor Map Insight: what do I log everything that would be an event in an event-sourced system

March 9, 2019

Greg Young — A Decade of DDD, CQRS, Event Sourcing - YouTube

Greg Young — A Decade of DDD, CQRS, Event Sourcing ( https://www.youtube.com/watch?v=LDW0QWie21s )

March 9, 2019

Greg Young - CQRS and Event Sourcing - Code on the Beach 2014 - YouTube

Greg Young - CQRS and Event Sourcing - Code on the Beach 2014 https://www.youtube.com/watch?v=JHGkaShoyNs Notes: test without getters: 3:28:20 / 6:31:00 don’t care about state if I call ‘Deactivate’ twice, I get an exception that’s the invariant VERSIONING Event Versioning: 4:24:22 / 6:31:00 add both methods in aggregate upcasting old to new event When do we need to versionize events? -> when they were written to production dev? just throw away your local event log...

March 3, 2019