# Developing Microservice-Based Applications Using the Silvera Domain-Specific Language
## 3 Silvera
### Implementation Phases  
There are several approaches to the implementation of DSLs. These approaches were first classified by [PERSON] [47] in the form of a collection of design patterns. His work was later extended by [PERSON] et al. [48]. The patterns are associated with the development phases of DSLs, which results in the following classes of patterns:  
* _Decision patterns_--which provide a set of common situations for which DSLs have been successfully created in the past,
* _Analysis patterns_--which provide a set of guidelines on how to identify the problem domain and gather the domain knowledge,
* _Design patterns_--which provide a set of guidelines on how to design a DSL,
* _Implementation patterns_--which provide a set of guidelines on how to choose the most suitable implementation approach. \begin{table}
\begin{tabular}{l l l l l l} \hline \hline
\begin{tabular}{l} Remote Procedure call, \\ Messaging \\ \end{tabular} & - & - & - \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of microservice design patterns implemented in Silvera with other tools. \begin{table}
\begin{tabular}{l l l l l l} \hline \hline
**Tool** & **Tectual Notation** & **GUI Editor** & **Arch. Evaluation** & **Database Support** & **Target Language** \\ \hline Silvera & SilveraDSL & no & yes & any & any \\ \hline MAGMA & Java & yes & no & MySQL & Java \\ \hline AjIL & XML & yes & no & \begin{tabular}{l} MySQL, \\ MongoDB \\ \end{tabular} & Java \\ \hline JHipster & JDL & yes & no & \begin{tabular}{l} MySQL, \\ MongoDB, \\ PostgeSQL, \\ etc. \\ \end{tabular} & Java \\ \hline LEMMA & Several DSLs & yes & no & \begin{tabular}{l} MariaDB, \\ MongoDB \\ \end{tabular} & \
\begin{tabular}{l} Java, \\ Python \\ \end{tabular} \\ \hline Jolie & Jolie & yes & no & All supported by JDBC driver &
\begin{tabular}{l} Java, \\ Javasccript \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of available features in Silvera with other tools. Silvera was developed in four successive phases: _Analysis, Decision, Design, and Implementation. Analysis phase._ During the analysis phase, we used the analysis patterns from Table 5.  
Most of the domain knowledge was gathered by analyzing the available literature, the code, and documentation (_Extract from Code_) pattern of available systems. We analyzed the domain in an informal way (_Informal_) pattern, and we gathered the literature mostly via the snowballing approach. We gathered a body of relevant papers, searched the papers that were in the reference list of these starting papers (_Backward Snowballing_[49]), and the papers that cite these starting papers (_Forward Snowballing_[49]). The output of this phase consisted of domain-specific terminology and semantics in more or less abstract form [48]. _Decision phase._ During this phase, we used the decision patterns from Table 6.  
The decision to create a new DSL stemmed from the fact that we wanted to automatically generate the infrastructure code (_Task Automation_) pattern and also to be able to perform domain-specific analysis and evaluation of the designed microservice-based system (_AVOPT_) pattern. _Design phase._ This phase can be characterized along two orthogonal dimensions: the relationship between the DSL and existing languages and the formal nature of the design description [48]. During this phase, we used patterns shown in Table 7.  
The easiest way to design a DSL is to base it on the existing language. DSLs built this way are called _Internal DSLs_. The advantage of this approach is that no new language infrastructure has to be built, but the downside is the limited flexibility since a DSL has to be expressed by using concepts of the host language [50]. Another approach is to create a so-called _External DSL_. An external DSL is a completely independent language built from scratch. As external DSLs are independent of any other language, they need their own infrastructures such as parsers, linkers, compilers, or interpreters [50].