You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few dependencies on structs instead of interfaces. This is a violation of the dependency inversion principle. Instead of depending on concrete implementations, we should be depending on abstractions. The most problematic examples are in the mutable and the immutable tree where we have nodeDb member as a struct instead of an interface.
Such violations make the system more brittle because a change in the concrete implementation may affect the code across the system. In addition, it makes it more difficult to test the structs that depend on the concrete implementations because we cannot mock them. Only interfaces can be mocked with gomock. For example, since nodeDB is not an interface, to test the mutable tree, we are forced to mock the database interface instead.
Therefore, we would like to investigate the codebase and create issues for all occurrences of the violation of the dependency inversion principle similar to mutable and immutable trees depending on the.
Acceptance Criteria
The project is investigated for dependency inversion principle violations described above.
Background
There are a few dependencies on structs instead of interfaces. This is a violation of the dependency inversion principle. Instead of depending on concrete implementations, we should be depending on abstractions. The most problematic examples are in the mutable and the immutable tree where we have nodeDb member as a struct instead of an interface.
Such violations make the system more brittle because a change in the concrete implementation may affect the code across the system. In addition, it makes it more difficult to test the structs that depend on the concrete implementations because we cannot mock them. Only interfaces can be mocked with
gomock
. For example, since nodeDB is not an interface, to test the mutable tree, we are forced to mock the database interface instead.Therefore, we would like to investigate the codebase and create issues for all occurrences of the violation of the dependency inversion principle similar to mutable and immutable trees depending on the.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: