-
Notifications
You must be signed in to change notification settings - Fork 273
Make all methods of dfcc_utilst static #7683
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
Make all methods of dfcc_utilst static #7683
Conversation
This PR seems to contain changes outside of |
We're in for a lot of refactoring if we go that way: all It is usually a pain to realize you need a logger or a irep for the language mode and to have to modify a whole trail of function signatures just to propagate a context argument. Is there a better solution ? |
Yes, that's #7680, which moves what was introduced as a DFCC utility to wider scope (and use). |
While it was a good way to get us started, I am not sure this is an appropriate application of the Singleton pattern. We end up with many methods that have access to objects that they don't need to be able to access. This makes it very hard to see what a method does/does not change. Also, it's often not clear in what state a method expects a particular object to be in.
Not that I know of. Take #6915 as an example, where I had to thread through a message handler. Wasn't fun, but ultimately the change wasn't all that big. At the moment, we have a lot of maybe-we-need-this-later code, and I'm afraid I haven't yet seen that this would result in small changes/pull requests when new features are added. |
8e2033a
to
334c0b2
Compare
334c0b2
to
7e75c43
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #7683 +/- ##
===========================================
- Coverage 78.55% 78.48% -0.08%
===========================================
Files 1686 1685 -1
Lines 192905 192905
===========================================
- Hits 151536 151393 -143
- Misses 41369 41512 +143
☔ View full report in Codecov by Sentry. |
This class has no state, there is no need to instantiate it. Also remove functions from the interface that are only used by one of the members, and remove those that are not used at all.
7e75c43
to
a79682b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/// the `function_map` with new parameters and an empty body. | ||
/// Returns the new symbol. | ||
/// | ||
/// \param goto_model: target goto_model holding the symbol table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// \param goto_model: target goto_model holding the symbol table | |
/// \param goto_model target goto_model holding the symbol table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CODING_STANDARD.md
suggests to have the colon here, so I'll keep it as-is.
This class has no state, there is no need to instantiate it.
Depends on #7680, among others.