You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

513 lines
8.8KB

  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <head>
  5. <style>
  6. #header
  7. {
  8. background: #2BA6E3;
  9. padding: 0.7em;
  10. text-align: left;
  11. }
  12. #header a
  13. {
  14. color: white;
  15. text-decoration: none;
  16. padding: 0.5em 1em 0.5em 1em;
  17. }
  18. .news_item
  19. {
  20. background: #FFFFFF;
  21. width: 720px;
  22. padding: 1em;
  23. margin-top: 2em;
  24. margin-bottom: 2em;
  25. border: 1px solid #E0E0E0;
  26. text-align: left;
  27. }
  28. .news_item_contents
  29. {
  30. color: #444;
  31. line-height: 1.5em;
  32. }
  33. .news_item_date
  34. {
  35. margin-bottom: 2em;
  36. color: #aaa;
  37. }
  38. body
  39. {
  40. background: #FAFAFA;
  41. }
  42. code, pre
  43. {
  44. font-family: monospace, serif;
  45. font-size: 1em;
  46. color: #7f0a0c;
  47. }
  48. figure
  49. {
  50. margin: 0px;
  51. padding: 0px;
  52. }
  53. img
  54. {
  55. width: 720px;
  56. }
  57. html
  58. {
  59. font-family: sans-serif;
  60. }
  61. a
  62. {
  63. color: #3A91CB;
  64. text-decoration: none;
  65. }
  66. #lang
  67. {
  68. float: right;
  69. }
  70. figcaption
  71. {
  72. color: #aaa;
  73. }
  74. table
  75. {
  76. border-collapse: collapse;
  77. }
  78. table, th, td
  79. {
  80. border: 1px solid #aaa;
  81. padding: 0.5em;
  82. margin-top: 0.5em;
  83. margin-bottom: 0.5em;
  84. }
  85. </style>
  86. </head>
  87. <body>
  88. <center>
  89. <div id="header">
  90. <a href="../../en/news/index.html">News</a>
  91. <a href="../../en/page/games.html">Games</a>
  92. <a href="../../en/page/about.html">About</a>
  93. <div id="lang">
  94. <a href="2016-august-recap.html">EN</a>
  95. <a href="../../ru/news/2016-august-recap.html">RU</a>
  96. </div>
  97. </div>
  98. <h1>In the news</h1>
  99. <div class="news_item">
  100. <h2 class="news_item_title">
  101. <a href="2016-august-recap.html">August 2016 recap</a>
  102. </h2>
  103. <p class="news_item_date">
  104. 2016-09-03 00:00
  105. </p>
  106. <div class="news_item_contents">
  107. <figure>
  108. <img src="../../images/2016-09-03_august-recap.png" alt="OGS Editor with a spherical scene node" /><figcaption>OGS Editor with a spherical scene node</figcaption>
  109. </figure>
  110. <p>This article explains the most important technical details about development in August: UIQt module, its refactoring, a new feature based development approach, and its benefits.</p>
  111. <p><strong>UIQt module</strong> is a collection of UI components backed by Qt. We only use it for Editor UI at the moment.</p>
  112. Here is a list of UIQt module components with their description and current code size:
  113. <table>
  114. <tr>
  115. <th>
  116. <strong>№</strong>
  117. </th>
  118. <th>
  119. <strong>Component</strong>
  120. </th>
  121. <th>
  122. <strong>Description</strong>
  123. </th>
  124. <th>
  125. <strong>Size (B)</strong>
  126. </th>
  127. <th>
  128. <strong>Size (%)</strong>
  129. </th>
  130. </tr>
  131. <tr>
  132. <td>
  133. 1
  134. </td>
  135. <td>
  136. UIQtAction
  137. </td>
  138. <td>
  139. Actions (events) for menus
  140. </td>
  141. <td>
  142. 11224
  143. </td>
  144. <td>
  145. 9
  146. </td>
  147. </tr>
  148. <tr>
  149. <td>
  150. 2
  151. </td>
  152. <td>
  153. UIQtAux
  154. </td>
  155. <td>
  156. Initializes Qt and main window. Provides widget resolution by name to other components
  157. </td>
  158. <td>
  159. 15518
  160. </td>
  161. <td>
  162. 12
  163. </td>
  164. </tr>
  165. <tr>
  166. <td>
  167. 3
  168. </td>
  169. <td>
  170. UIQtDock
  171. </td>
  172. <td>
  173. Widget docks
  174. </td>
  175. <td>
  176. 5273
  177. </td>
  178. <td>
  179. 4
  180. </td>
  181. </tr>
  182. <tr>
  183. <td>
  184. 4
  185. </td>
  186. <td>
  187. UIQtFileDialog
  188. </td>
  189. <td>
  190. File selection dialogs
  191. </td>
  192. <td>
  193. 8960
  194. </td>
  195. <td>
  196. 7
  197. </td>
  198. </tr>
  199. <tr>
  200. <td>
  201. 5
  202. </td>
  203. <td>
  204. UIQtMenu
  205. </td>
  206. <td>
  207. Menus for main window and pop-ups (like node’s add/copy/paste/delete menu)
  208. </td>
  209. <td>
  210. 4566
  211. </td>
  212. <td>
  213. 3
  214. </td>
  215. </tr>
  216. <tr>
  217. <td>
  218. 6
  219. </td>
  220. <td>
  221. UIQtMenuBar
  222. </td>
  223. <td>
  224. Menu bar for main window
  225. </td>
  226. <td>
  227. 4222
  228. </td>
  229. <td>
  230. 3
  231. </td>
  232. </tr>
  233. <tr>
  234. <td>
  235. 7
  236. </td>
  237. <td>
  238. UIQtRunner
  239. </td>
  240. <td>
  241. Allows to start QApplication
  242. </td>
  243. <td>
  244. 2450
  245. </td>
  246. <td>
  247. 2
  248. </td>
  249. </tr>
  250. <tr>
  251. <td>
  252. 8
  253. </td>
  254. <td>
  255. UIQtThumbnailDialog
  256. </td>
  257. <td>
  258. Dialog with thumbnail images
  259. </td>
  260. <td>
  261. 18615
  262. </td>
  263. <td>
  264. 14
  265. </td>
  266. </tr>
  267. <tr>
  268. <td>
  269. 9
  270. </td>
  271. <td>
  272. UIQtToolBar
  273. </td>
  274. <td>
  275. Tool bar for main window
  276. </td>
  277. <td>
  278. 4276
  279. </td>
  280. <td>
  281. 3
  282. </td>
  283. </tr>
  284. <tr>
  285. <td>
  286. 10
  287. </td>
  288. <td>
  289. UIQtTree
  290. </td>
  291. <td>
  292. Provides complex widgets like Scene tree and Property browser
  293. </td>
  294. <td>
  295. 51216
  296. </td>
  297. <td>
  298. 39
  299. </td>
  300. </tr>
  301. <tr>
  302. <td>
  303. 11
  304. </td>
  305. <td>
  306. UIQtWidget
  307. </td>
  308. <td>
  309. Common widget properties like focus and visibility
  310. </td>
  311. <td>
  312. 5465
  313. </td>
  314. <td>
  315. 4
  316. </td>
  317. </tr>
  318. </table>
  319. <p><strong>UIQt module refactoring</strong> purpose was to replace old State API with new Environment API, which allows to achieve the same functionality with less code, i.e., makes development easier and faster.</p>
  320. <p>Refactoring started in July and should have been done the same month. However, we only finished the work in August. Initial plan assumed 28 hours would be enough, but we spent 65 instead. We estimated planned time by relying on the number of public API calls of each component. That worked fine for small components, because the number of their public API calls was roughly equal to the number of their features, and features themselves were very small. However, it totally failed for UIQtTree, which contains 39% of UIQt module code, because there was no direct connection between public API and features.</p>
  321. <p><strong>Feature based development approach</strong> was born as a result of UIQtTree refactoring struggle. Since Qt uses MVC, UIQtTree component consists of several classes. By the time UIQtTree could display and manage a hierarchy of items, the component was already 27K in size. We noticed UIQtTree started to require abnormal amount of development time even for tiny features. This was an obvious <a href="http://kornerr.blogspot.com/2012/04/complexity-conservation-law-complexity.html">quantitative complexity</a> manifestation.</p>
  322. <p>We decided to separate UIQtTree into base part and additional ones. Base would only contain minimal code required by all features. Addition would contain specific feature code and could be safely modified. In the case of UIQtTree, item hierarchy display and modification is the minimal functionality, while item renaming is an addition.</p>
  323. <p>Here is a list of current UIQtTree features:</p>
  324. <table>
  325. <tr>
  326. <th>
  327. <strong>№</strong>
  328. </th>
  329. <th>
  330. <strong>Feature</strong>
  331. </th>
  332. <th>
  333. <strong>Description</strong>
  334. </th>
  335. <th>
  336. <strong>Size (B)</strong>
  337. </th>
  338. <th>
  339. <strong>Size (%)</strong>
  340. </th>
  341. </tr>
  342. <tr>
  343. <td>
  344. 1
  345. </td>
  346. <td>
  347. Base
  348. </td>
  349. <td>
  350. Allows to construct item hierarchy, modify it, and display it
  351. </td>
  352. <td>
  353. 26966
  354. </td>
  355. <td>
  356. 52
  357. </td>
  358. </tr>
  359. <tr>
  360. <td>
  361. 2
  362. </td>
  363. <td>
  364. Item open state
  365. </td>
  366. <td>
  367. Keeps track of collapsed/expanded item properties
  368. </td>
  369. <td>
  370. 3094
  371. </td>
  372. <td>
  373. 6
  374. </td>
  375. </tr>
  376. <tr>
  377. <td>
  378. 3
  379. </td>
  380. <td>
  381. Item renaming
  382. </td>
  383. <td>
  384. Allows to rename an item
  385. </td>
  386. <td>
  387. 3471
  388. </td>
  389. <td>
  390. 7
  391. </td>
  392. </tr>
  393. <tr>
  394. <td>
  395. 4
  396. </td>
  397. <td>
  398. Item selection
  399. </td>
  400. <td>
  401. Allows to get/set selected item
  402. </td>
  403. <td>
  404. 2338
  405. </td>
  406. <td>
  407. 5
  408. </td>
  409. </tr>
  410. <tr>
  411. <td>
  412. 5
  413. </td>
  414. <td>
  415. Item value
  416. </td>
  417. <td>
  418. Provides 2nd and the rest columns for items, used by Property browser
  419. </td>
  420. <td>
  421. 1307
  422. </td>
  423. <td>
  424. 3
  425. </td>
  426. </tr>
  427. <tr>
  428. <td>
  429. 6
  430. </td>
  431. <td>
  432. Item value editing
  433. </td>
  434. <td>
  435. Allows to edit item values with a default editor widget
  436. </td>
  437. <td>
  438. 1996
  439. </td>
  440. <td>
  441. 4
  442. </td>
  443. </tr>
  444. <tr>
  445. <td>
  446. 7
  447. </td>
  448. <td>
  449. Item value editing with combobox
  450. </td>
  451. <td>
  452. Provides combobox editor
  453. </td>
  454. <td>
  455. 5819
  456. </td>
  457. <td>
  458. 11
  459. </td>
  460. </tr>
  461. <tr>
  462. <td>
  463. 8
  464. </td>
  465. <td>
  466. Item value editing with spinner
  467. </td>
  468. <td>
  469. Provides spinbox editor
  470. </td>
  471. <td>
  472. 5290
  473. </td>
  474. <td>
  475. 10
  476. </td>
  477. </tr>
  478. <tr>
  479. <td>
  480. 9
  481. </td>
  482. <td>
  483. Menu
  484. </td>
  485. <td>
  486. Provides pop-up menu
  487. </td>
  488. <td>
  489. 1248
  490. </td>
  491. <td>
  492. 2
  493. </td>
  494. </tr>
  495. </table>
  496. <p>Here’s an example of UIQtTree Menu feature file: <a href="https://bitbucket.org/ogstudio-history/mjin-pre-pre/src/0c4cc3c3213f4687c0f3bd6a5426a6054cadd79b/f/TREE_MENU.cpp?at=Studio+0.10&amp;fileviewer=file-view-default">TREE_MENU</a>.</p>
  497. <p><strong>Benefits of the approach</strong> include:</p>
  498. <ol type="1">
  499. <li>Faster code reading/understanding due to small size</li>
  500. <li>Easier and safer modification due to isolated code</li>
  501. </ol>
  502. <p>There’s a drawback, too: new approach requires learning.</p>
  503. <p>That’s it for the most important technical details about development in August: UIQt module, its refactoring, a new feature based development approach, and its benefits.</p>
  504. </div>
  505. </div>
  506. </center>
  507. </body>
  508. </html>