Uploaded image for project: 'Commons OGNL (Dormant)'
  1. Commons OGNL (Dormant)
  2. OGNL-191

Move "toString" implementations into visitor pattern.

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.0
    • None
    • None

    Description

      Using the Visitor pattern allows for a cleaner implementation of toString().

      I have a patch which will remove toString() from all AST classes, and replace it with a single toString() in "SimpleNode" which delegates to a ToStringVisitor to build the String efficiently.

      This patch can also be used as an example of how to move other business logic out of the AST classes into their own visitor classes.

      Attachments

        1. to_string_visitor_with_style_recommendations.patch
          39 kB
          Daniel Pitts
        2. to_string_visitor1.patch
          36 kB
          Daniel Pitts
        3. to_string_visitor2.patch
          38 kB
          Daniel Pitts

        Activity

          People

            simone.tripodi Simone Tripodi
            danielpitts Daniel Pitts
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: