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

Port EquinoxWeb template to C# #5

Merged
merged 17 commits into from
Jan 17, 2019
Merged

Port EquinoxWeb template to C# #5

merged 17 commits into from
Jan 17, 2019

Conversation

bartelink
Copy link
Collaborator

@bartelink bartelink commented Jan 4, 2019

This PR is in service of the following missions:

  • Polish Equinox's surface APIs, removing pain points accessing from C# and validating aspects of the F# usage:
    • its not a big conceptual stretch to support it, especially given recent language additions in v6 and 7 wrt pattern matching and expression bodies members etc
    • little effort has been invested in basics such making Equinox be natural for use from languages other than F# to date
  • Providing another way to illustrate the concepts of idempotent command processing, events, folds etc which are commonly agreed
  • provide a base sample that others can use refactor from to illustrate other (read: better) approaches using alternate libraries and techniques
  • improve the F# implementation via the above cross-polination (doing this exercise has highlighted numerous bugs/oversimplifications in the F#)

HT @aarondandy who put in lots of legwork to motivate the work (and various other discussions on the DDD-CQRS-ES Slack)

Components:

  • port wiring for Cosmos, EventStore and MemoryStore in aspnetcore
    • I'm not entirely happy with some of the compromises in how I separate the code vs what works well with DUs in F# and am definitely open to PRs to make things better
    • By the same token, I'm not entirely dissatisfied - its important that the wiring be close to idiomatic C# and not too slavish a translation of what happens to work well in F#
  • Provide basic shims allowing Handler functions to be written without F# interop (FuncConvert etc) littering the place (open to PRs to do more, but for now the key synchronous one is ported and life will go on)
  • port Aggregate.fs to C#
  • port Todo.fs to C#
  • Port TodosController.fs to C#
  • make it compile
  • make sure it actually runs and functions correctly per https://todobackend.com (shouldn't be hard as it this is just a port, but its absolutely not been run)
  • include equinox-web-csharp as a component within the Equinox.Templates nuget (consumption experience should only differ in having to specify a -l C#, i.e. it should go in sharing the same identity as the F# one)
  • make improvements to Equinox (e.g. defaults etc) to enable simplification of some of the wiring (for now the plan is that C# wiring will continue to live in Infrastructure.cs, but if any tweaks and/overloads are needed in the Equinox repo, that'll be done - i.e. this may be experimental, but C# support is intended to be a first class supported thing) - see Tweaks for C# interop equinox#81 - this will merge after final integration test against 1.0.3-rc1 packages
  • Final test required of 1.1.0-rc3 per readme in this branch
  • Merge the key cleanup aspects of Experiment: Polish eqxweb C# template by using OneOf library to pattern match #6 in here (but probably not the OneOf ref)

Future work:

  • Perhaps provide an example of defining the Event and/or Command DUs in F# in order to attempt to see whether that's a better approach that the Encode/TryDecode implementation that's presently in place (I really believe its worth doing this work, even if the likelihood of one doing that for any sustained period is not the most likely)

@bartelink bartelink changed the title WIP Port EquinoxWeb template to C# Port EquinoxWeb template to C# Jan 4, 2019
@bartelink bartelink mentioned this pull request Jan 5, 2019
3 tasks
@bartelink bartelink merged commit 317532d into master Jan 17, 2019
@bartelink bartelink deleted the csharp branch January 25, 2019 00:22
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.

1 participant