-
Notifications
You must be signed in to change notification settings - Fork 105
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
Provide a way to specify a reference to identity using annotation #81
Comments
You're right. In the type-based model, What exactly would the purpose of the |
I agree with everything you wrote. You are absolutely right, the |
To tell you what I'm currently building: it is Axon Framework byte buddy integration. For support of Axon Framework |
I would happily have a look at a PR.
Nice! Looking forward to seeing that PR as well! |
This commit adds an annotation equivalent of the Association type for both Java and Kotlin.
Renamed identifiableType attribute to aggregateType as the reference must be towards aggregates only. Fix license headers and Javadoc including references to other concepts (annotation flavors instead of type ones).
#82 has been polished and merged. |
Short
Introduce a new stereotype
IdentityRef
expressing a reference to aIdentity
as annotation.Description
I stumbled upon an interesting question implementing command dispatching in CQRS. The command model accessed via aggregate root needs to be able to build an identifier from the context of a command to target the correct aggregate / entity.
A very easy way to target is to specify the target identifier inside the command. Firstly, I thought I could use
Identifier
or@Identity
fromjmolecules-ddd
for this purpose, but it seems to be very strange... The command itself is an immutable value object and putting a field inside of it marked with@Identity
seems to be confusing... A better approach is to use a different stereotypeIdentityRef
(as a annotation) to express the "pointer-to-identity" semantics.Look on the follow example:
Is the
Association
marker interface is exactly designed for this? Then I think the definition of the association with an annotation should be possible:The text was updated successfully, but these errors were encountered: