Details
-
User Story
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
DaVinci 117, DaVinci 118, DaVinci 119
-
a89fe6038 (dev), 32f726fbc (dev), e14356449 (dev), 3d1e94b84 (dev)
Description
As a developer, I want to break up the Node class so that each part has one clear purpose. This will make the code easier to maintain, test, and extend.
Background
The different functions of the Node class indicate that it's responsible for a myriad of things, e.g., metadata handling, link management, formatting, tree navigation, etc. The multitude of responsibilities cause Node's implementation details to leak into a lot of unrelated parts of QDoc, which makes it harder than necessary to make clean changes to the software.
Proposal
Extract helper components, for example:
- NodeMetadata to manage properties like name, file name, and URL.
- NodePresentation to generate signatures and titles.
- NodeOrdering to hold all ordering functions.
- NodeLinkManager to handle link creation and lookup.
Separate Tree Navigation
- Move tree navigation and parent/child logic into a separate class or module.
Tests
- Write unit tests for each new component to verify that they work as intended.
- Ensure that our existing integration tests pass with the new structure without changes to output.
Documentation
- Update code comments to reflect the changes.
- Add documentation for the new components, as well as for any extracted code if it's missing.
- Assume the existence of the coveted "QDoc Developer Manual".
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-135943 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
639322,3 | QDoc: Extract node ordering logic to new namespace | dev | qt/qttools | Status: NEW | 0 | 0 |
638881,9 | QDoc: Refactor Node to use strongly typed enums | dev | qt/qttools | Status: MERGED | +2 | +1 |
643571,4 | QDoc: Introduce INode interface for Node | dev | qt/qttools | Status: MERGED | +2 | 0 |
643600,5 | QDoc: Clean up some includes | dev | qt/qttools | Status: MERGED | +2 | 0 |
643671,2 | QDoc: Wrap GenusTypes in QT_BEGIN|END_NAMESPACE | dev | qt/qttools | Status: MERGED | +2 | 0 |