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

Refactoring Shepherd for testing and maintainability #1008

Open
vkirkl opened this issue Feb 4, 2025 · 0 comments
Open

Refactoring Shepherd for testing and maintainability #1008

vkirkl opened this issue Feb 4, 2025 · 0 comments
Labels
enhancement new or improvements on existing features techdebt work that needs to be done to clean things up testing unit tests, integration tests, etc etc
Milestone

Comments

@vkirkl
Copy link

vkirkl commented Feb 4, 2025

This is a multi-issue story with the goal of breaking the Shepherd class into sub-packages and new classes to facilitate testing and improve maintainability. This iteration will identify and migrate only high priority methods and provide an example for further refactoring as resources allow.
[Sub-issues will be linked as they are created.]

High level tasks include:

  1. Enumerate backwards dependencies of Shepherd, ShepherdPMF, and ShepherdProperties; mark orphaned code for removal;
  2. Create new directory structure / subpackages
    Suggested directory structure with example files:
    src/main/java/org/ecocean/shepherd/
         core/
             Shepherd.java (Coordinates operations between services and utilities)
             ShepherdPMF.java (Persistence Manager Factory, if not separated out)
         services/
             EncounterService.java
             MediaAssetService.java
             ... 
        utils/
             MediaUtils.java
             QueryUtils.java
             ValidationUtils.java
             ... 
      ```
    
  3. Migrate Shepherd and ShepherdPMF to core
  4. Identify util methods in Shepherd and prioritize for migration to new util classes based on usage in backwards dependency analysis; migrate high priority methods; add tests; prune code flagged for removal
  5. Identify entities and their CRUD methods in Shepherd and prioritize for migration to new service classes; migrate high priority entities (e.g. Encounter); add tests; prune code flagged for removal
  6. Identify transaction handling methods; add tests
@vkirkl vkirkl added enhancement new or improvements on existing features techdebt work that needs to be done to clean things up testing unit tests, integration tests, etc etc labels Feb 4, 2025
@vkirkl vkirkl added this to the 10.7.0 milestone Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new or improvements on existing features techdebt work that needs to be done to clean things up testing unit tests, integration tests, etc etc
Projects
None yet
Development

No branches or pull requests

1 participant