Repository logo
 
Publication

Domain specific language generation based on a XML schema

dc.contributor.advisorCarvalho, Fernando Miguel Gamboa de
dc.contributor.authorDuarte, Luís Carlos da Silva
dc.date.accessioned2019-03-07T20:28:43Z
dc.date.available2019-03-07T20:28:43Z
dc.date.issued2019-02-01
dc.descriptionDissertação para obtenção do grau de mestre em Engenharia Informática e de Computadorespt_PT
dc.description.abstractThe use of markup languages is recurrent in the world of technology, with HyperText Markup Language (HTML) being the most prominent one due to its use in theWeb. The requirement of tools that can automatically build well formed documents with good performance is clear. Yet, the most used solution is template engines, which neither ensures well-formed documents nor presents good performance, due to the use of external text files. To tackle the first issue we propose to define HTML templates as first-class functions instead of using text files. To that end, these HTML template functions use a Java Domain Specific Language (DSL) to write HTML. Our main goal is to create the required tools that automatically generate that DSL based on its language definition from an eXtensive Markup Language Schema Definition (XSD) file. The resulting DSL should enforce the restrictions of the given language which are specified in the XSD file. By removing the use of text files we are also suppressing the file load overhead and reducing String manipulation, which in turn increases the overall performance and solves the second issue. My proposal, named xmlet, includes a set of tools that are able to: 1) parse and extract the rules from a XSD file, 2) generate the adequate classes and methods to define the DSL that reflects the language rules, 3) handle the use of the resulting DSL through the implementation of the Visitor pattern. Finally we validated this solution not only for the HTML language, but also with the Android layouts and the regular expressions languages. By comparing the developed solution to some state-of-art solutions, including template engines and some other solutions with specific innovations, we obtained very favorable results with the suggested solution being the best performancewise in all the tests we performed. These results are important, specially considering that apart from being a more efficient solution it also introduces validations of the language usage based on its syntax definition.pt_PT
dc.description.abstractActualmente a utilização de linguagens de markup é recorrente no mundo da tecnologia, sendo o HTML a linguagem mais utilizada graças à sua utilização no mundo da Web. Tendo isso em conta é necessário que existam ferramentas capazes de escrever documentos bem formados de forma eficaz. No entanto, a abordagem mais utilizada, template engines, tem dois problemas principais: 1) não garante a geração de documentos bem formados, 2) não garante um bom desempenho, devido à utilização de ficheiros de texto como ficheiros de template. Para resolver o primeiro problema propomos que um template HTML passe a ser definido como uma first-class function. Para isto é necessário criar uma linguagem específica de domínio para que estas funções possam manipular a linguagem HTML. O nosso objectivo principal é criar as ferramentas necessárias para gerar linguagens específicas de domínio com base no ficheiro de definição da linguagem, explícito num ficheiro XSD. A linguagem de domínio gerada deve também garantir que as restrições da respectiva linguagem são verificadas. Removendo os ficheiros textuais que definem templates minimizam-se também os problemas de desempenho introduzidos pelo carregamento de ficheiros de texto e reduzem-se o número de operações sobre Strings. A minha proposta, chamada xmlet, inclui ferramentas que possibilitam: 1) a análise e a extração de informação de um ficheiro XSD, 2) a geração de classes e métodos que definem uma linguagem específica de domínio que reflete as regras presentes no ficheiro XSD, 3) a abstração da utilização da linguagem de domínio gerada, com a utilização do padrão Visitor. Para validar esta solução criaram-se linguagens de domínio não só para HTML como também para a linguagem utilizada para definir layouts visuais para Android e para a linguagem das expressões regulares. Comparando a solução desenvolvida com soluções semelhantes, incluindo template engines e algumas soluções com inovações face à abordagem dos template engines, obtemos resultados favoráveis. Verificamos que a solução sugerida é a mais eficiente em todos os testes feitos. Estes resultados são importantes, especialmente considerando que apesar de ser a solução mais eficiente introduz também a verificação das restrições da linguagem utilizada tendo em conta a sua definição sintática.pt_PT
dc.description.versionN/Apt_PT
dc.identifier.citationDUARTE, Luís Carlos da Silva - Domain specific language generation based on a XML schema. Lisboa: Instituto Superior de Engenharia de Lisboa, 2019. Dissertação de mestrado.pt_PT
dc.identifier.tid202186300
dc.identifier.urihttp://hdl.handle.net/10400.21/9682
dc.language.isoengpt_PT
dc.peerreviewedyespt_PT
dc.publisherInstituto Superior de Engenharia de Lisboapt_PT
dc.subjectXMLpt_PT
dc.subjecteXtensive markup languagept_PT
dc.subjectXSDpt_PT
dc.subjecteXtensive markup language schema definitionpt_PT
dc.subjectAutomatic code generationpt_PT
dc.subjectGeração automática de códigopt_PT
dc.subjectFluent interfacept_PT
dc.subjectInterface fluentept_PT
dc.subjectDomain specific language.pt_PT
dc.subjectLinguage specífica de domíniopt_PT
dc.titleDomain specific language generation based on a XML schemapt_PT
dc.typemaster thesis
dspace.entity.typePublication
rcaap.rightsopenAccesspt_PT
rcaap.typemasterThesispt_PT

Files

Original bundle
Now showing 1 - 1 of 1
No Thumbnail Available
Name:
Dissertação.pdf
Size:
863.64 KB
Format:
Adobe Portable Document Format
License bundle
Now showing 1 - 1 of 1
No Thumbnail Available
Name:
license.txt
Size:
1.71 KB
Format:
Item-specific license agreed upon to submission
Description: