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

Build service abstraction around Objects #1392

Merged
merged 3 commits into from
Nov 25, 2022
Merged

Build service abstraction around Objects #1392

merged 3 commits into from
Nov 25, 2022

Conversation

hannobraun
Copy link
Owner

This new service is the only code that mutates Objects, and it only does so through events. Those events can later be accessed and used to recreate any intermediate state. This should help with building better debugging tools (#1385), and barely complicates the code that was previously using Objects directly!

This has the side effect of turning validation errors into panics, for the time being. This is fine for now, as it matches how validation errors are used so far pretty well. It also enables a lot of simplifications, which I'm going to realize in follow-up pull requests.

My mid-term plan for validation is to decouple it from object insertion and move it into a service. This will enable geometry to be generated despite validation errors (which is good, because the user needs to see what's wrong; not just be confronted with an error message and no result). It will also allow any future debugging tools to provide better insight into exactly where and how these validation errors were generated.

Close #1387

This turns validation errors into panics, which is unfortunate but fine
for now. I have a plan to improve validation by moving it into its own
service, where it produces its own events.
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