Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Aug 10, 2025

This pull request refactors the path processing and printing components to improve modularity and code clarity by introducing new interfaces and a factory class. The changes replace concrete class references with interface-based abstractions, making the codebase more extensible and maintainable. Additionally, several classes were moved into a new package structure for better organization.

API Abstraction and Interface Implementation

  • Introduced the DotPath and DotPrinter interfaces in src/main/java/io/github/trackerforce/path/api/, defining common APIs for path processing and JSON printing, respectively. Existing classes like PathCommon and PathPrinter now implement these interfaces. [1] [2] [3] [4] [5]

Factory Pattern and Dependency Injection

  • Added the DotPathFactory class to centralize the creation of DotPath and DotPrinter instances, replacing direct instantiation with factory methods. This improves dependency management and testability. [1] [2]

Package and File Structure Organization

  • Moved core path-related classes (PathCommon, PathExclude, PathFilter, PathPrinter, ExclusionNode) to the new io.github.trackerforce.path package, improving codebase structure and separation of concerns. [1] [2] [3] [4] [5] [6]

Refactoring for Interface Usage

  • Updated DotPathQL to use DotPath and DotPrinter interfaces instead of concrete classes, and to obtain instances via DotPathFactory, further decoupling implementation details from usage. [1] [2]

These changes collectively enhance the flexibility and maintainability of the path processing and printing logic in the codebase.

@petruki petruki self-assigned this Aug 10, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 10, 2025

@petruki petruki merged commit c9f9785 into master Aug 10, 2025
7 checks passed
@petruki petruki deleted the staging branch August 10, 2025 20:57
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.

2 participants