By Andrey Volkov (aavolkov_3@edu.hse.ru)
The domain analysis is a process by which information used in developing software systems is identified, captured, and organized with the purpose of making it reusable when creating new systems [1].
During the process of domain analysis domain models are produced. One of the main methodologies for producing domain models is domain-specific language.
A Domain-Specific Language (DSL) is a programming language or executable specification language that offers, through appropriate notations and abstractions, expressive power focused on, and usually restricted to, a particular problem domain [2]. This is in contrast to the General Purpose Language (GPL), which is widely applicable across all domains.
Domain Specific Languages are used in software development to improve quality, flexibility, and on-time delivery software systems, taking advantage of certain properties of a specific area of the application.
In this essay the role of domain specific languages on domain analysis will be discussed.
Using a DSL approach for software engineering provides both opportunities and risks. The well-developed DSL aims to find the appropriate balance between the two [2].
The benefits of DSLs include:
The disadvantages of the use of a DSL are:
The development of a domain-specific language includes the following steps [12, 13]:
The goal of analysis steps (1) through (4) is to create a complete understanding of the application domain. Guidance for gaining this understanding is provided in the area of subject analysis research, which explores ways of modeling subject areas. According to [14], a subject analyst is a person who examines the needs and requirements of a set of systems that appear to be “similar”. Neighbors emphasize that this is a job that can only be done by a person who has built many systems for different clients in the same problem area. A domain analyst is similar to a systems analyst, except that his goal is to support the development of families of related systems, not just one-of-a-kind manufacturing [16].
Domain engineering [15] refers to systematic domain modeling activities. Domain design comes from research into software reuse and can be used to create reusable libraries, frameworks, or languages for specific domains.
The implementation steps (1) and (2) of the previous section can be carried out using several approaches:
Interpretation or compilation
This is the classic approach to implementing a new language. The main advantage of creating a compiler or interpreter is that the implementation is fully DSL-specific, and there are no concessions regarding notation, primitives, etc. not required. In addition, error detection, static analysis and optimization can be performed at the level of the subject area, for example, using the system of effects, as in [13].
Obviously, an important issue is the cost of building such a compiler or interpreter from scratch and the lack of reuse from other (DSL) implementations.
As an alternative to implementing a DSL from scratch, a DSL can be implemented by extending a given base language.
Embedded languages / domain-specific libraries
In this approach, existing mechanisms such as function definitions or user-defined syntax definitions are used to create a library of domain-specific operations. Base language syntactic mechanisms are used to express the domain idiom.
The advantage of this approach is that the base language compiler or interpreter is reused, just like a DSL. The main limitation is the expressiveness of the syntactic mechanisms of the base language. In many cases, the optimal domain-specific notation must be compromised to comply with the constraints of the host language.
There are hundreds of DSLs currently in existence. Of these, only a fraction is actually described in the literature on software engineering or programming languages. The best known are such classic examples as PIC, SCATTER, CHEM, LEX, YACC and Make, which are described in [17]. Other well-known examples are SQL, BNF, and HTML.
Domain analysis uses domain-specific language as a methodology for producing domain models. The domain-specific language allows programs to be concise, enhance productivity, reliability, maintainability, and portability. On the other hand, DSL programs come with costs of design, implementation and maintenance. The entry threshold to working with DSL is also higher then in general purpose languages. Overall, in some cases it seems a decent solution for producing domain models in domain analysis.