Changes between Initial Version and Version 1 of wxGUIDevelopment/Refactoring


Ignore:
Timestamp:
Feb 2, 2013, 11:09:30 AM (11 years ago)
Author:
wenzeslaus
Comment:

wxGUI refactoring questions

Legend:

Unmodified
Added
Removed
Modified
  • wxGUIDevelopment/Refactoring

    v1 v1  
     1[[TOC]]
     2
     3= wxGUI Refactoring =
     4
     5
     6== !GrassInterface ==
     7
     8!GrassInterface is an interface to access basic wxGUI functionality. Read more about usage at [http://grasswiki.osgeo.org/wiki/WxGUI_Programming_Howto GRASS wiki].
     9
     10The level of generalization as well as the functionality can be determined when creating standalone GUI modules.
     11
     12Implemented for:
     13 * GConsole-!LayerManager relation
     14
     15== Actions ==
     16
     17Action should contain various descriptions, icon and list of handlers to be called. Handlers are registered to the event on runtime.
     18
     19Not in the SVN.
     20
     21== Suggestions for further refactoring ==
     22
     23=== Using wx-like styles for module forms ===
     24
     25There are several different usages of module forms. They may be distinguished by wx-like
     26styles.
     27
     28=== Standalone GUI modules ===
     29
     30These GUI modules are available to user which has the possibility to run lightweight
     31application only with particular functionality. The advantage for a developer is the quicker
     32testing without the need to start main GUI (g.gui).
     33
     34The relation with refactoring is obvious. Classes and places which needs refactoring
     35will appear when you try to create and use some window in standalone application (i.e.,
     36without Layer Manager and Map Displays). In other words, only general classes can be
     37reused in both a module and the main GUI application.
     38
     39
     40== Open questions ==
     41
     42=== How to document events in the Doxygen documentation? ===
     43
     44Posted events are part of a interface of a class. There is wxWidgets Doxygen documentation when events are listed in class description in a list with description ([http://docs.wxwidgets.org/trunk/index.html link]).
     45
     46=== Should event handlers be private? ===
     47
     48According to wxWidgets documentation event handlers should be private: Notice that as the event handlers normally are not called
     49from outside the class, they normally are private. In particular they don’t need to be
     50public ([http://docs.wxwidgets.org/trunk/overview_events.html wxWidgets overview of events]).
     51Private method in Python usually starts with underscore. This is in collision
     52with wxWidgets convention which is naming event handlers like OnSomethingHappened
     53(in C++ these methods are private because they are in private section of class definition).
     54
     55=== Is defining interface of map display on top of the existing class enough? ===
     56
     57''This text is unclear as well as the right answer.''
     58
     59Or would be better to define interface class (similar to GrassInterface) to ensure exclusive
     60use of this interface? Private methods are probably mostly sufficient, however interface of
     61particular class can be wider than defined GrassInterface.
     62
     63For example, some class A which is not expected to use the wider interface, provided by
     64class B, can use this wider interface when class A has direct access to class B. Consequently,
     65the class A depends on class B instead of GrassInterface interface. Using GrassInterface
     66layer ensures that class A depends on the GrassInterface, not the wider interface provided
     67by the class B.
     68
     69However, implementing the GrassInterface is little bit more difficult because beside the
     70particular class (class B in example above), you have to implement also the GrassInterface
     71class.