Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5053

Refactor ProgramWorkflowServiceImpl.saveProgram

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Could
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Core 2.2.0
    • Component/s: None
    • Labels:
    • Complexity:
      Low

      Description

      ProgramWorkflowServiceImpl.saveProgram's readability can be improved by extracting smaller private methods like

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/api/impl/ProgramWorkflowServiceImpl.java#L81-L85

      into

      ensureProgramIsSet(ProgramWorkflow workflow, Program program)
      

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/api/impl/ProgramWorkflowServiceImpl.java#L93-L97

      into

      ensureProgramWorkflowIsSet(ProgramWorkflowState state, ProgramWorkflow workflow)
      

      also remove the comments in this method which just shows that the method is too complex and needs explanations.

      After these initial refactorings you probably have other ideas to which you could explain in a subtask of this one.

        Attachments

          Activity

            People

            Assignee:
            howardf64 Howard Francis
            Reporter:
            teleivo Ivo Ulrich
            Designated Committer:
            Ivo Ulrich
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h