-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* limit visibility of implementation details -> we don't want users of ArchUnit to be able to access the class `LocationPatternImportOption`, but it was public * use composition instead of inheritance to reuse the patterns -> inheritance to share some common logic is IMHO a bad pattern. On this scale it probably does not matter, but ArchUnit usually follows composition over inheritance for such use cases (i.e. when the "is a" relationship is unimportant and it is more a "I want to share some code" intention) * use predicates instead of Set<Pattern> -> I think is easier to understand Predicate<Location> TEST_LOCATION and not(TEST_LOCATION) instead of `return exclude ? false : true` ... `return exclude ? true : false`; in general the boolean `exclude` is a little confusing to me in this context; I've measured performance and found no noticeable difference on ~40000 locations when I compared the predicate based approach to the iteration over the pattern set * add test -> I've added tests analogously to DoNotIncludeTests to ensure this does not break in the future * rename `OnlyTests` -> `OnlyIncludeTests`, as it is more consistent with the other `ImportOptions` which all contain "include" * add `OnlyIncludeTests` to `Predefined`, since there are predefined constants for all the other `ImportOptions` Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
- Loading branch information
1 parent
6da9e43
commit fa0b8ca
Showing
2 changed files
with
123 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters