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

Extract private method in ObsServiceImpl.saveExistingObs

    XMLWordPrintable

    Details

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

      Description

      To reduce the complexity, increase readability and maintainability in

      OrderServiceImpl.saveOrder(Order)

      I suggest to extract related parts into smaller private methods, with longer meaningful names.

      For example:

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/api/impl/ObsServiceImpl.java#L153-L161 into

      private void unsetVoidedAndCreationProperties(Obs obs)
      

      or in two methods like unsetVoidedProperties(Obs) and unsetCreationProperties(Obs)

      + remove comments.

      And only extract the private methods without refactoring them as well in order to ease code review and reduce risk of breaking the code. If you have an idea on how to improve the private methods later on submit another PR.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              pkatopenmrs pkatopenmrs
              Reporter:
              teleivo Ivo Ulrich
              Designated Committer:
              Bharat Akkinepalli
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 day
                  1d