Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-11456

MacroFormRenderer refactoring

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: In Progress
    • Minor
    • Resolution: Unresolved
    • Trunk, Upcoming Branch
    • None
    • framework/widget
    • None

    Description

      Class MacroFormRender is 3400 lines long and performs the following:

      • Renders the various form structure parts and field widgets to FTL macros calls.
      • Configures the FTL environment.
      • Executes the FTL macro calls to generate HTML and write it to a caller provided Appendable.

      Implementing the above means that MacroFormRenderer does not meet the Single Responsibility Principle. The current implementation of multiple responsibilities makes unit testing difficult.

      As discussed on the dev mailing list https://markmail.org/message/adtkk6cb6o7mmy7f it is proposed that MacroFormRenderer is refactored.

      Refactoring should separate the rendering of form structure parts and field widgets to FTL macro calls from the execution of those macros.

      To support the refactoring effort JMockit is being introduced (OFBIZ-4035) to allow test creation against the current implementation of MacroFormRenderer, helping to ensure functionality is preserved once refactoring is complete.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            danwatford Daniel Watford
            danwatford Daniel Watford

            Dates

              Created:
              Updated:

              Slack

                Issue deployment