Replies: 1 comment 1 reply
-
Not really an answer, but I'm struggling to understand how to use the Extensions properly myself. All the samples in the dotnet repo only have simple grain examples with simple interfaces. And the examples on the msdocs also are too basic for me to fully understand how to utilise them or if I am going to make something wrong with extensions. Sorry, not really an answer but thought i'd share youre not the only one not really understanding how to create or use a grain extension, as the documentation is extremely light and there's really no samples. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to write an extension that can be added to a grain that is relatively independant of the grain itself, but it has state. State that the grain in and on it's own, doesn't strictly need to know about.
In theory, I could implement it as a separate grain with a compound key of the parent's primary key and grain type to avoid collisions for this use case, but i feel like extensions would enable some composition of functionality in grains?
Example use case:
The way i interpret the documentation now, is that I should construct the extension component in the OnActivate of the grain, and pass it a reference (or getter/setter) to a state object from the grain, but that would require the grain to have knowledge about the functionality provided by the extension, coupling it a little tighter than i'd like them to be.
Am I trying to abuse something for what it wasn't designed/intended, or is this a legitimate use case that wasn't considered yet?
Beta Was this translation helpful? Give feedback.
All reactions