Skip to content

Refactor constructors of ModelElement #2828

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

Merged

Conversation

jcollins-g
Copy link
Contributor

This makes the constructors for ModelElement private, and makes use of a separate builder that can be overridden in tests or otherwise be plugged-in via mocks or fake objects.

I think this is an overall improvement, but there might be something more extensive we could do that would achieve the same result.

If this works out, I'll do the same thing for ElementType, the other constructor that follows the original pattern.

@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label Oct 6, 2021
@jcollins-g jcollins-g requested a review from srawlins October 6, 2021 22:40
Copy link
Member

@srawlins srawlins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Mostly mechanical, but I like the new structure.

@jcollins-g jcollins-g merged commit 96832aa into dart-lang:master Oct 7, 2021
@jcollins-g jcollins-g deleted the modelelement-constructor-refactor branch October 7, 2021 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants