Faculty of information technology
Chapter 5 Implementation
Download 1.67 Mb. Pdf ko'rish
|
full thesis
Chapter 5
Implementation As a programming language was chosen C++, because most user modules for routers are written in C/C++ and there exist several C libraries for Advantech routers that could be needed in the future. After choosing this language, it was advantageous to also write Customer Server and Dispatch Server with that, so that the code can be re-used across the entities. Although a website is an integral part of the system, its implementation will not be discussed here, because it was created fully by a third party. The same is also true for an installation script and a build system. 5.1 External API The API between the CS-controller and other applications is divided into 2 layers (shown in figure 5.1 ). The inner layer is a C++ class ExtClientApi that implements checks of the input. It also handles creation of transactions and reading of data from DB. If any other action needs to be taken in response to an API call, it would also be placed here. The outer layer consists of multiple classes, whose sole purpose is to make methods of the inner layer available from different scripting languages. Currently 2 languages are supported: ∙ PHP (needed for website), ∙ Python 3 (needed for regression tests). This outer layer of the API receives arguments from the caller (usually script) wrapped in a special class, different for each language. It converts the arguments into common C++ types, calls a method of ExtClientApi and passes it the converted parameters. Third party libraries Python/C 1 and PHP-cpp 2 were used to implement this. The reason for using Python for regression tests (instead of php, which was already needed for the website) is to make use of a pre-existing test framework, available within the company. 5.2 Download 1.67 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling