Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0.0 #692

Merged
merged 17 commits into from
Mar 10, 2024
Merged

v2.0.0 #692

merged 17 commits into from
Mar 10, 2024

Conversation

idugalic
Copy link
Member

@idugalic idugalic commented Mar 9, 2024

  • Major update of the library
    • Non-compatible changes on the application layer components.
    • Repository interfaces, Aggregate interfaces, and Materialized view interfaces are simplified / many interfaces are replaced by one interface.
    • Repository interfaces, aggregate interfaces, and Materialized view interfaces include metadata of the message (command metadata, event metadata, ...)
    • Metadata types exist only on the application layer, not leaking into the domain, as these don't benefit core logic. Example: traceId, correlationId, ...

Metadata is combined with payload types using Intersection Types in Typescript.

Intersections provide more flexibility and can handle more complex scenarios:

  • Flexibility: If you anticipate needing to access individual components of the combined state separately, using tuples might be more appropriate, as it allows you to maintain separate types for each component. However, if you primarily need to treat the combined state as a single entity with all properties accessible at once, intersections might be more suitable.

  • Readability: It better communicates your intentions and the structure of your data.

TypeScript adopts a structural type system which determines type compatibility and equivalence based on the type structure or definition rather than the declarative relationship between types and interfaces, which contrasts with nominal type system.

Besides keeping the focus on separating data from behavior, we want to split the responsibilities between the domain and application/adapter layers better, steering your design in a good direction.

@idugalic idugalic merged commit a67f1d1 into main Mar 10, 2024
5 checks passed
@idugalic idugalic deleted the v_2_0_0 branch March 15, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant