Contributes to #21005.
The goal of this PR is to remove gArgs
from database classes (i.e. bdb.h
and sqlite.h
) so that they can be tested without relying on gArgs
in tests.
Notes:
- My goal is to enable unit-testing without relying on
gArgs
as much as possible. Global variables are hard to reason about which in turn makes it slightly harder to contribute to this codebase. When the compiler does the heavy lifting for us and allows us only to construct an object (or call a method) with valid parameters, we may also save some time in code reviews. The cost for this is passing an argument which is not for free but the cost is very miniscule compared to benefits, I think.- GUI code is an exception because it seems fine to have
gArgs
there so I don’t plan to make changes insrc/qt
folder, for example.
- GUI code is an exception because it seems fine to have
- My approach to removal of
gArgs
uses is moving from lower levels to upper ones and passArgsManager
as an argument as needed. The approach is very similar to what #20158.