-
Notifications
You must be signed in to change notification settings - Fork 265
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
Support for non-Guid Identity #28
Comments
I have thought about this before, but dropped it because I felt it made things to complex. I don't like the idea of using strings that well and haven't figured out a good solution using generics or something like iidentity without making it unnecessary complex for most users. I'm open to suggestions...
… On 6 Jun 2017, at 23:36, Drew Peterson ***@***.***> wrote:
Continuing my saga of implementing EventStore as an IEventStore implementation, I've found that limiting identity to Guid limits the flexibility in how we store and categorize our aggregates/events, with categorization being the primary driver personally.
I envision being able to use strings, such as Order-, or Order-1, which is especially important for event stores that use an identity prefix to categorize events and aggregates (such as EventStore).
Any thoughts or opinions on implementing something like this? It could be as simple as replacing Guid with string, or introducing some sort of IIdentity to use. I'd be more than happy to submit a PR for this change, but wanted to know what your thoughts were.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I just finally got around to finishing up a proof-of-concept implementing an IIdentity. I included an out-of-the-box GuidIdentity implementation. Those of us who need something more advanced can easily do so. |
We faced a similar issue, internally we name our streams The first thing we did was to add an
We created a new
Then using reflection we pulled out the type name of the aggregate inside the Save and LoadAggregate methods e.g.
and
That type name ultimately gets passed to the ITypedEventStore implementation which is this case pushes to GetEventStore. It's still very much a work in progress and some of the type names can probably be changed to something better but it works for us at the moment. I've attached the files we used and if anyone think's it worthwhile I'm happy to take a fork, make the changes and open a proper PR. Andy |
In the beginnig I too had problems with the id being a Guid. After some meditation I wouldn't introduce a non-Guid id. |
Continuing my saga of implementing EventStore as an IEventStore implementation, I've found that limiting identity to Guid limits the flexibility in how we store and categorize our aggregates/events, with categorization being the primary driver personally.
I envision being able to use strings, such as
Order-<someGuid>
, orOrder-1
, which is especially important for event stores that use an identity prefix to categorize events and aggregates (such as EventStore).Any thoughts or opinions on implementing something like this? It could be as simple as replacing
Guid
withstring
, or introducing some sort ofIIdentity
to use. I'd be more than happy to submit a PR for this change, but wanted to know what your thoughts were.The text was updated successfully, but these errors were encountered: