Changes between Version 10 and Version 11 of UNPLANNED_LOGIC_REFACTORING_R0


Ignore:
Timestamp:
08/25/09 17:47:51 (16 years ago)
Author:
boyan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UNPLANNED_LOGIC_REFACTORING_R0

    v10 v11  
    4242 
    4343= Design = 
     44Since this is a redesign task with critical priority, the design will be described briefly: 
     45 
     46== Naming convention == 
     47 * All enum classes that implement OperationDef should end in Logic. 
     48  * Examples: PlainTextLogic, ResourcePaletteLogic, etc. 
     49  * The name should be self-descriptive about what kind of operations this logic contains. 
     50 * Each operation should start with ON_ 
     51  * Then follows the user action that this operation handles. This should also be self-descriptive. 
     52  * Examples: ON_SET_SCREEN_MODE, ON_ADD_AUDIO_FRAME, etc. 
     53 * The EventIds enum should be an inner class of the class that fires the event when possible and should all be with the same name. 
     54  * The event ids themselves should clearly describe the operation they represent. 
     55  * It should be clear from how the event id is referred (via the wrapper class name) what event it represents. 
     56  * Examples: MainWindow.EventIds.SET_SCREEN_MODE, AllAnnotationsPalette.EventIds.IMPORT_ANNOTATIONS, etc. 
     57 * There might be some cases when these rules cannot be applied (e.g. TextEventIds) but this is the convention that we will try to follow. 
     58 
     59== Duplicate code == 
     60The following places have been identified to contain unnecessary code: 
     61 * The clicked() method of the menu items. It should be made final, firing an event with a MenuItem.EventIds.CLICKED id. Subclasses do not need to override this method. 
     62 * The submitData() method of the bound controls. It should be made final, firing an event with a BoundControl.EventIds.SUBMIT id. Subclasses do not need to override this method. 
     63 * The situation is similar with the AlignElementsButton. Here's mitex's solution: 
     64---- 
    4465 * For the align buttons: 
    4566  * Create two abstract methods in AlignElementsButton: 
     
    5273   * Creates an immutable list of references to elements. Only elements of type {{{MemberElement}}} are collected. 
    5374   * Creates a new {{{AutoAction}}} that iterates over all references and changes {{{MemberElement.KEY_LOCATION}}} with the newly calculated location. 
     75---- 
     76Other places with duplicate code will be identified and fixed as part of the implementation. 
     77 
     78== LogicR3 refactoring == 
     79All existing R3 logics will be changed to use auto actions. They will also be grouped by common functionality. Classes and methods using old logic and trying to set properties of the model will be refactored as well. These things do not need preliminary research and will be done as part of the implementation. 
    5480 
    5581= Implementation = 
     
    6187 
    6288= Testing = 
    63 ^(Place the testing results here.)^ 
     89^Place the testing results here. 
    6490 
    6591= Comments = 
    66 ^(Write comments for this or later revisions here.) 
     92^Write comments for this or later revisions here.