On Jan 14, 2010, at 8:36 PM, Jon Cruz wrote:
- Can we encapsulate it? That is, do we need to leave things in .h files that other things include, or can they be moved inside specific files?
For an example I started seeing warnings from the soon-to-be-removed hash_map in control-point-selection.h
I did a quick grep, and found it referenced in several files under ui/tools/*, which is as expected, but also in widgets/toolbox.cpp, desktop.cpp and verbs.cpp. Those last two, and especially verbs.cpp seem to be not where one might expect the problem to show up.
Looking into this for an eye on removing spaghetti dependencies, I saw and commented out control-point-selection.h and multi-path-manipulator.h. Then... BOOM!!! verbs.cpp fails. Things first break with SP_VERB_EDIT_SELECT_ALL, right after the successful SP_VERB_EDIT_CLEAR_ALL.
So the problem is that more of the other actions use verbs.cpp to just dispatch to their functionality, while the newer selection ones are implementing the functionality directly in verbs.cpp. A bit of find/grep magic on the other functions shows that corresponding things are behind the facade of selection-chemistry.h/cpp
So in this case of moving things from verbs.cpp to selection-chemistry.cpp I don't think the warning count decreases However, the encapsulation is much better as the cohesion goes up while the coupling goes down. The function of verbs.cpp returns to that of just dispatching commands, while all the selection magic goes over into selection-chemistry.cpp.