Implement EventProjection base class with declarative domain-event-to-RenderOp mapping #303
Labels
No labels
Blocked
Duplicate
MoSCoW/Could Have
MoSCoW/Must Have
MoSCoW/Should Have
Points/1
Points/13
Points/2
Points/21
Points/3
Points/5
Points/8
Priority/Backlog
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
State/Completed
State/In progress
State/In review
State/Paused
State/Unverified
State/Verified
State/Wont Do
Type/Bug
Type/Epic
Type/Feature
Type/Legendary
Type/Task
Type/Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#302 Epic: Event Projection System
aethyr/Aethyr
Reference: aethyr/Aethyr#303
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
feature/m2-event-projectionfeat: implement EventProjection base class with declarative mappingBackground and Context
The Event Projection System needs a base class that subclasses can use to declare mappings between domain events and RenderOps. This is the foundation of the projection layer — a clean, declarative DSL that makes it easy to define how each domain event should be rendered.
Expected Behavior
EventProjectionis an abstract base class. Subclasses declare mappings using anonDSL:A
ProjectionRegistrystores all projection classes and provides lookup by event type. When an event arrives, the registry finds all projections that handle that event type and invokes them.Acceptance Criteria
EventProjectionbase class providesonDSL for declaring event-to-RenderOp mappings.onblocks for different event types.onblocks receive the event and return one or moreRenderOpinstances.ProjectionRegistry.registeraccepts projection classes.ProjectionRegistry.project(event_type, event)returns all RenderOps from matching projections.Subtasks
Code
EventProjectionbase class withonclass-level DSL.#project(event)instance method invoking the matching block.ProjectionRegistrysingleton with#registerand#projectmethods.Quality
tests/unit/event_projection.featurecovering declaring projections with on DSL, projecting events to RenderOps, multiple projections for same event, unknown event type, registry registration and lookup, multi-op return from single projection.tests/integration/for EventProjection base class and ProjectionRegistry projecting domain events to RenderOps.bundle exec rake unit_profileand verify no performance regressions.bundle exec rake unit. If coverage is <97% then review the current unit test coverage report atbuild/tests/unit/coverage/and use it to write new Cucumber based unit tests to improve coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerunbundle exec rake unitto verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.bundle exec rake(default task: unit tests with coverage) andbundle exec rake integration, fix any errors if needed ensuring both pass across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.Definition of Done
This issue is complete when:
master, reviewed, and merged before this issue is marked done.Implementation Progress
Created the EventProjection and ProjectionRegistry classes:
Files Created
lib/aethyr/core/render/event_projection.rb- Base class withonDSLlib/aethyr/core/render/projection_registry.rb- Singleton registrytests/unit/event_projection.feature- 26 unit test scenariostests/integration/event_projection_integration.feature- 8 integration test scenariosTest Results
Key Features
onclass-level DSL for declaring event handlers