Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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. #lang
  19. {
  20. float: right;
  21. }
  22. .news_item
  23. {
  24. background: #FFFFFF;
  25. width: 720px;
  26. padding: 1em;
  27. margin-top: 2em;
  28. margin-bottom: 2em;
  29. border: 1px solid #E0E0E0;
  30. text-align: left;
  31. }
  32. .news_item_contents
  33. {
  34. color: #444;
  35. line-height: 1.5em;
  36. }
  37. .news_item_date
  38. {
  39. margin-bottom: 2em;
  40. color: #aaa;
  41. }
  42. html
  43. {
  44. font-family: sans-serif;
  45. }
  46. body
  47. {
  48. background: #FAFAFA;
  49. }
  50. code, pre
  51. {
  52. font-family: monospace, serif;
  53. font-size: 1em;
  54. color: #7f0a0c;
  55. }
  56. img
  57. {
  58. width: 720px;
  59. }
  60. a
  61. {
  62. color: #3A91CB;
  63. }
  64. table
  65. {
  66. border-collapse: collapse;
  67. }
  68. table, th, td
  69. {
  70. border: 1px solid #aaa;
  71. padding: 0.5em;
  72. margin-top: 0.5em;
  73. margin-bottom: 0.5em;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div id="header">
  79. <strong id="title">Open Game Studio</strong>
  80. <a href="../../en/news/index.html">News</a>
  81. <a href="../../en/game/index.html">Games</a>
  82. <a href="../../en/tool/index.html">Tools</a>
  83. <a href="../../en/page/about.html">About</a>
  84. <div id="lang">
  85. <a href="../../en/news/2016-august-recap.html">EN</a>
  86. <a href="../../ru/news/2016-august-recap.html">RU</a>
  87. </div>
  88. </div>
  89. <center>
  90. <h1>In the news...</h1>
  91. <div class="news_item">
  92. <h2 class="news_item_title">
  93. <a href="2016-august-recap.html">August 2016 recap</a>
  94. </h2>
  95. <p class="news_item_date">
  96. 2016-09-03 00:00
  97. </p>
  98. <div class="news_item_contents">
  99. <p><img src="../../images/2016-09-03_august-recap.png" alt="OGS Editor with a spherical scene node" /></p>
  100. <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>
  101. <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>
  102. <p>Here is a list of UIQt module components with their description and current code size:<table>
  103. <tr>
  104. <th><strong>№</strong></th>
  105. <th><strong>Component</strong></th>
  106. <th><strong>Description</strong></th>
  107. <th><strong>Size (B)</strong></th>
  108. <th><strong>Size (%)</strong></th>
  109. </tr>
  110. <tr>
  111. <td>1</td>
  112. <td>UIQtAction</td>
  113. <td>Actions (events) for menus</td>
  114. <td>11224</td>
  115. <td>9</td>
  116. </tr>
  117. <tr>
  118. <td>2</td>
  119. <td>UIQtAux</td>
  120. <td>Initializes Qt and main window. Provides widget resolution by name to other components</td>
  121. <td>15518</td>
  122. <td>12</td>
  123. </tr>
  124. <tr>
  125. <td>3</td>
  126. <td>UIQtDock</td>
  127. <td>Widget docks</td>
  128. <td>5273</td>
  129. <td>4</td>
  130. </tr>
  131. <tr>
  132. <td>4</td>
  133. <td>UIQtFileDialog</td>
  134. <td>File selection dialogs</td>
  135. <td>8960</td>
  136. <td>7</td>
  137. </tr>
  138. <tr>
  139. <td>5</td>
  140. <td>UIQtMenu</td>
  141. <td>Menus for main window and pop-ups (like node's add/copy/paste/delete menu)</td>
  142. <td>4566</td>
  143. <td>3</td>
  144. </tr>
  145. <tr>
  146. <td>6</td>
  147. <td>UIQtMenuBar</td>
  148. <td>Menu bar for main window</td>
  149. <td>4222</td>
  150. <td>3</td>
  151. </tr>
  152. <tr>
  153. <td>7</td>
  154. <td>UIQtRunner</td>
  155. <td>Allows to start QApplication</td>
  156. <td>2450</td>
  157. <td>2</td>
  158. </tr>
  159. <tr>
  160. <td>8</td>
  161. <td>UIQtThumbnailDialog</td>
  162. <td>Dialog with thumbnail images</td>
  163. <td>18615</td>
  164. <td>14</td>
  165. </tr>
  166. <tr>
  167. <td>9</td>
  168. <td>UIQtToolBar</td>
  169. <td>Tool bar for main window</td>
  170. <td>4276</td>
  171. <td>3</td>
  172. </tr>
  173. <tr>
  174. <td>10</td>
  175. <td>UIQtTree</td>
  176. <td>Provides complex widgets like Scene tree and Property browser</td>
  177. <td>51216</td>
  178. <td>39</td>
  179. </tr>
  180. <tr>
  181. <td>11</td>
  182. <td>UIQtWidget</td>
  183. <td>Common widget properties like focus and visibility</td>
  184. <td>5465</td>
  185. <td>4</td>
  186. </tr>
  187. </table></p>
  188. <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>
  189. <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>
  190. <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>
  191. <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>
  192. <p>Here is a list of current UIQtTree features:</p>
  193. <table>
  194. <tr>
  195. <th>**№**</th>
  196. <th>**Feature**</th>
  197. <th>**Description**</th>
  198. <th>**Size (B)**</th>
  199. <th>**Size (%)**</th>
  200. </tr>
  201. <tr>
  202. <td>1</td>
  203. <td>Base</td>
  204. <td>Allows to construct item hierarchy, modify it, and display it</td>
  205. <td>26966</td>
  206. <td>52</td>
  207. </tr>
  208. <tr>
  209. <td>2</td>
  210. <td>Item open state</td>
  211. <td>Keeps track of collapsed/expanded item properties</td>
  212. <td>3094</td>
  213. <td>6</td>
  214. </tr>
  215. <tr>
  216. <td>3</td>
  217. <td>Item renaming</td>
  218. <td>Allows to rename an item</td>
  219. <td>3471</td>
  220. <td>7</td>
  221. </tr>
  222. <tr>
  223. <td>4</td>
  224. <td>Item selection</td>
  225. <td>Allows to get/set selected item</td>
  226. <td>2338</td>
  227. <td>5</td>
  228. </tr>
  229. <tr>
  230. <td>5</td>
  231. <td>Item value</td>
  232. <td>Provides 2nd and the rest columns for items, used by Property browser</td>
  233. <td>1307</td>
  234. <td>3</td>
  235. </tr>
  236. <tr>
  237. <td>6</td>
  238. <td>Item value editing</td>
  239. <td>Allows to edit item values with a default editor widget</td>
  240. <td>1996</td>
  241. <td>4</td>
  242. </tr>
  243. <tr>
  244. <td>7</td>
  245. <td>Item value editing with combobox</td>
  246. <td>Provides combobox editor</td>
  247. <td>5819</td>
  248. <td>11</td>
  249. </tr>
  250. <tr>
  251. <td>8</td>
  252. <td>Item value editing with spinner</td>
  253. <td>Provides spinbox editor</td>
  254. <td>5290</td>
  255. <td>10</td>
  256. </tr>
  257. <tr>
  258. <td>9</td>
  259. <td>Menu</td>
  260. <td>Provides pop-up menu</td>
  261. <td>1248</td>
  262. <td>2</td>
  263. </tr>
  264. </table>
  265. <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&fileviewer=file-view-default">TREE_MENU</a>.</p>
  266. <p><strong>Benefits of the approach</strong> include:</p>
  267. <ol>
  268. <li>Faster code reading/understanding due to small size</li>
  269. <li>Easier and safer modification due to isolated code</li>
  270. </ol>
  271. <p>There's a drawback, too: new approach requires learning.</p>
  272. <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>
  273. </div>
  274. </div>
  275. <div id="footer">
  276. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  277. from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
  278. The site is hosted by <a href="https://pages.github.com">GitHub Pages</a>.
  279. </div>
  280. </center>
  281. </body>
  282. </html>