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

Use sealed abstract case classes to reduce bincompat surface #257

Closed

Conversation

armanbilge
Copy link
Member

sealed abstract case classes don't have apply or copy methods, but still have nice toString, hashCode, and equals.

Unfortunately they still generate unapply methods, so I've overridden those with package-private implementations to prevent the public one from being generated.

I've made the apply methods for events package-private. In ordinary use they should not be necessary, and importantly it protects our bincompat should AWS decide to add more non-optional fields, which technically they can do backwards-compatibly at any time.

Then, we can expose apply methods in the testkit like I propose doing for Context in #247. This will enable them to be mocked.

I didn't finish the DynamoDB-related stuff, I think I might like to make some bigger changes there in a followup.

@armanbilge
Copy link
Member Author

@armanbilge armanbilge closed this Nov 20, 2023
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