If you are doing 1 and/or 2, how are you preventing accidental (resharper, developer etc) changes to 'earlier' versions in your code base? The only thing I can come up with is some sort of file signing. Is there a better way?
When adding a new version, do you make effort to hide the previous 'legacy' domain event types from your projections / event listeners?
I've search the group archives and haven't found really anything relevant. If there is, please point me :) Any insights (problems / solutions) anyone has in this area is appreciated.
- Damian
Storage Domain Event:
I use joliver's eventstore library and am utilizing pipeline hooks to convert between Storage and Application events when read (up conversion), when committed (commit conversion) and published (an IDispatchCommits wrapper). These converters are in a separate library and are all, at this point, AutoMapper based with minimal configuration. There is now an additional developer cost in creating / managing the storage representation as well as the application one, but it doesn't seem to be completely wild (yet). A test using AutoMapper's AssertConfigurationIsValid catches most event shape mismatch issues very quickly. There is also a perf hit in the mapping but my gut tells me it's small compared to serialization and event store I/O.
For 'locking' a version of the storage events I have a glorified copy -> fine/replace script+tool (me-ware) that duplicates a storage version, changes the namespace (i.e. ".V1." -> ".V2."), generates a type signature, creates a test to make sure that types don't change and updates converters. I'm not convinced that this is ultimately necessary or worth it. I have some time to chew on that and am in no particular rush to settle on an approach.
So, will this stand the test of time? Time will tell I suppose :)
Thx for the help,
- Damian