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

Smaller refactors #153

Merged
merged 4 commits into from
Sep 13, 2023
Merged

Smaller refactors #153

merged 4 commits into from
Sep 13, 2023

Conversation

BryceStevenWilley
Copy link
Collaborator

At the moment, the ecf5 branch is very big, and unfortunately not all of it is related to ECF 5; lots of other smaller refactors snuck in there, and not all of them are directly related to ECF 5 stuff.

This PR splits out a few parts that:

  • don't have any external facing effects to anything (no new features, no bug fixes, etc.)
  • could be simply placed in their own nice little (sometimes) commits

Ran integration tests locally and they run great. The database commit is touches many different parts of the code, so integration tests are the only good tests here.

We were directly saving and using the FilingTypeType enum, which comes from
Tyler's ECF4 extension. With ECF 5 coming up, we should separate it into
a generic enum.

Takens from working ECF 5 code branch.
Adds comments to existing functions, and a new function.

`exists` is a good shorthand for `val != null && !val.isBlank()` when used in
one liners.
Collections can be sets or lists, making it easier to list all possible
choices, without duplicates.
Makes the interface for the various database classes that we use AutoCloseable.
This results in a lot of small changes everywhere, as we don't have to access
the underlying Connection object for convience functions or to close it.

As a result of some of these changes, we also start giving Services a
`Supplier<CodeDatabase>`. This also preps for ECF5; the CodesDatabase will have
two implementations, one for ECF4 and one for ECF5, but the services won't
know which to use without lots of extra configs or globals. So instead we
simply give them a Supplier, that they can call and use as normal; the
constructing object knows which of ECF4 vs ECF5 to use.
@BryceStevenWilley BryceStevenWilley merged commit f2601fe into main Sep 13, 2023
@BryceStevenWilley BryceStevenWilley deleted the smaller_refactors branch September 13, 2023 21:32
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