{"id":1035,"date":"2017-04-27T08:16:31","date_gmt":"2017-04-27T06:16:31","guid":{"rendered":"http:\/\/www.hunggartorino.it\/ql\/?p=1035"},"modified":"2017-04-27T08:20:16","modified_gmt":"2017-04-27T06:20:16","slug":"config","status":"publish","type":"post","link":"http:\/\/www.hunggartorino.it\/ql\/config\/","title":{"rendered":"Software configuration, different approach philosofies."},"content":{"rendered":"<p>In the moment when, during our \u201ccareer\u201d of QL programmer, we overcome the step from creating simple softwares to more complex products, one of the problem we face is the necessity to make our softwares configurable.<\/p>\n<p>The kind of configuration we want to upgrade is unrelevant if compared to the goals of the problems, starting from the colours of the window in which the software works or security settings, the way to solve that problem doesn\u2019t change.<br \/>\nWe have obviously different solutions, all effective but with strong and weak points very different from each other.<br \/>\nIt is a programmer\u2019s duty to orientate himself toward those different philosofic choices linked to his needs.<br \/>\nIn fact, to different needs can match different solutions to the same problem<br \/>\nLet\u2019s analyze now those needs We thougth a serie of a six main needs of a software programmer and we will subsequently apply to the different methods that we will analyze.<\/p>\n<h2>Maintain settings during the upgrade<\/h2>\n<p>Is the user\u2019s needs to not reconfigure its software everytime he installs a new release. We often forget both how the configuration software works (because is used only one time) both which parareters were setted.<br \/>\nThe main difficulties in remembering those particulars come from the sporadic use of this options<\/p>\n<h2>Intercommunicability between applications<\/h2>\n<p>Evolved applications are able to open automatically other softwares to do different operations or to use specific functions<br \/>\nFor example I think at The Reader, which uses an editor decided by the user to write the messages.<\/p>\n<h2>Multiple configurations<\/h2>\n<p>Differently from working environments, where every user has a dedicated station, in private enviroment is normal that more persons have the access to the same computer.<br \/>\nIs not told that the optimal settings for one use is good also for the others: often happens the opposite and every user would like to have its own settings.<br \/>\nThe most common result is to create an infinite serie of small discussions and after a \u201cintermediate\u201d setting wich in reality nobody likes at all.<\/p>\n<h2>Portability between OS<\/h2>\n<p>To the most evolved developers can be important that their application works with different operational systems. Normally, this is a not real important issue in our world. We are more oriented to import softwares from systems more and more evolved and widesrpead (mainly from linux) rather than export our applications to other platforms, where with good probability exists similar and more complete competitors.<br \/>\nBut i find right to consider also this hypotesis, even if is secondary, in order to have a complete view of the situation.<br \/>\nLet\u2019s now make a quick view of the most used methods both on our platform and not, and let\u2019s try to relate them to the already described needs.<\/p>\n<h2>Executable\u2019s alterations<\/h2>\n<p>Alterate the executable code using an external software is the first method appeared on our platorm.<br \/>\nDo you remember the four almighty PSION managment softwares?<br \/>\nThey were setted right in that way thanks to a SuperBASIC\u2019s software supplied toghether with the package. Let\u2019s tell already that is not a good system.<br \/>\nFirst, everytime has to be changed some setting it was necessary to access to the configuration program (usally uninstalled due to space reasons). Then remember how it works and then act.<br \/>\nTo the limits of this method can be added eventual limits of the configuration program.<br \/>\nThe same can be told to the access of settings informations: it is always required to look inside the executable.<br \/>\nIt is not told that different releases of the same programs the parts of the executable to be patched are the same. This requires results in rewriting the configuration program.<\/p>\n<h2>Fileconfig<\/h2>\n<p>Fileconfig represents the evolution on QL platforms of the system described above.<br \/>\nIt is a block of datas written in a standard format that is inserted in head of the executable code. That block not only contains the parameters to be setted but also their description in form of question.<br \/>\nLet\u2019s make an example of a pararmeter which contains the pathname of the help file. I twill have the description of the file itself in form of question or request \u201cindiceate help\u2019s file path\u201d.<br \/>\nIn order to act on the configuration\u2019s block exsist an unique software that while analyse the block is able to adapt automatically to the specifics contained in the entire block.<br \/>\nThis system is definetely more \u201cuser friendly\u201d than the previous system.<br \/>\nLearning to use this system is not neither a big work; once selected the executable to be modified, it will be the program itself that queries the configuration block and give the question to be answered.<br \/>\nCompared to the first method is an enormous further step. However remanis problems connected to setting\u2019s maintenance.<br \/>\nWe must say that the configurator\u2019s commercial settings, delivered by Jochen Merz (www.jms.com) is able to read the configuration block and save it on a separated file. Once installed the new release, it can insert in the new software the data already saved.<\/p>\n<h2>Environments variables<\/h2>\n<p>A totally different method from the previous is the use of environment variables. To each setting is assigned a different environment variable which is read by the software<br \/>\nThis systems allows us to have a different serie of advantages compared to the previous solutions.<br \/>\nFirst of all, to every software\u2019s upgrade we will not have to worry anymore of the reconfiguration. The software will configure itself automatically reading the variables.<br \/>\nEnvironment variables are public, so also the applications can read the content<br \/>\nTo what will be useful this?<br \/>\nLet\u2019s make a pratical example.<br \/>\nBefore we named The Reader, which uses an external editor to create the messages. We have also other softwares which makes the same thing, for example C68Tools.<br \/>\nIf both programs can read the same environment variable, and we have to change just the editor with another (for example from QD to MicroEMACS), it would be just necessary to act in only one point to upgrade both applications.<br \/>\nAnother advantage of environment variable is that different user\u2019s profiles, working on the same station, could have different values. Every user will have their own personal settings without interfere with other profiles.<\/p>\n<h2>Separated configuration file<\/h2>\n<p>In the situation in which the settings begin to become too much is a good idea to evolve the previously described method.<br \/>\nIn this way the software can equally access to informations, maintaining the advantage of the previous system, without block too much the list of environment variables.<br \/>\nThis means on the contrary that an external software in order to act on this archive must know before both the format and the content.<\/p>\n<h2>Configuration register<\/h2>\n<p>Another further step is the creation of an unique archive, managed from the system, which contain in a standard format all the information regarding every software installed on the machine.<br \/>\nIs the solution used by Windows.<br \/>\nEvery application should use this regisiter (I repeat SHOULD HAVE) in order to add its parameters and make them easily accessible.<br \/>\nThe controindication is that this register should be managed by the operating system; this actualy neither SMSQ\/E doesn\u2019t do.<br \/>\nExists also softwares that manages multiple settings, where the user can decide what kind of settings adopts.<br \/>\nTechnically speaking each configuration has its own priorities, so the software can freely decide which of those methods use.<br \/>\nIn this case, to avoid duplicates and\/or unwanted effects is always suggested to valorize only one configuration, so we have the certainty that the program reads only this.<br \/>\nAs you can see there are a lot of possible choices, every one with pros and cons; now the choice is only yours.<\/p>\n<p>Giorgio Garabello<br \/>\n(Translation by Stefano Baccella)<\/p>\n","protected":false},"excerpt":{"rendered":"In the moment when, during our \u201ccareer\u201d of QL programmer, we overcome the step from creating simple softwares to more complex products, one \n<a class=\"moretag\" href=\"http:\/\/www.hunggartorino.it\/ql\/config\/\"> [..more...]<\/a>","protected":false},"author":1,"featured_media":275,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-senza-categoria"],"_links":{"self":[{"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/posts\/1035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/comments?post=1035"}],"version-history":[{"count":2,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/posts\/1035\/revisions"}],"predecessor-version":[{"id":1039,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/posts\/1035\/revisions\/1039"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/media\/275"}],"wp:attachment":[{"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/media?parent=1035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/categories?post=1035"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.hunggartorino.it\/ql\/wp-json\/wp\/v2\/tags?post=1035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}