wiki:UNPLANNED_LOGIC_REFACTORING_R0

Version 3 (modified by mitex, 16 years ago) (diff)

--

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=UNPLANNED_LOGIC_REFACTORING_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

  • The goal of this task is to remove some code smells from controllers:
    • Inconsistent naming in event and handlers.
    • Inconsistent location of controllers - some related controllers are in sepaerate files, some are nested in the corresponding view, others - not, etc.
    • Menu items have clicked method instead of firing an R3 event. For some items it is trivial to switch to R3 Logic.
      • Not all menu items will be refactored.
  • No new functionality is going to be added.

Task requirements

  • Rename all nested enums that contain event IDs to EventIds.
  • In logic enums, names of all items should begin with "ON_", followed by the event ID, where possible.
    • For example, the event CLICK can be handled by ON_CLICK.
  • Check for inconsistent names - for example, FRAME_REMOVED is not a good name if the frame is removed during the handling of the event. FRAME_REMOVE is a better name.
  • In main.app.commons logics should not be in separated subpackage. Instead, move each logic enum to the package with the corresponding views.
  • For halo buttons, extract logics and group them by functionality.
    • For example, create org.sophie2.main.app.halos.grouping.GroupHalosLogic which handles events from all halo buttons related to grouping.
  • In menu items deprecate the method clicked.
    • Create a new event CLICKED that should be fired when a menu item is clicked.
    • For all menu items, that just fire R3 event, remove the clicked method and change the filter in the controllers - it should listen for MenuItem.EventIds.CLICKED.

Task result

  • Source code

Implementation idea

  • Use eclipse's "Open Type Hierarchy" to view all OperationDefs (all R3 controllers), all MenuItems, etc.

How to demo

  • The task has no visible result.

Design

(Describe your design here.)

Implementation

(Describe and link the implementation results here (from the wiki or the repository).)

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)