A domain-specific language (DSL) is a programming language designed for a specific domain. Examples include LaTeX for document layout, SQL for databases, and HTML for document markup. DSLs allow users without programming expertise to work within their domain. They achieve a high level of abstraction and expressiveness for their domain. However, DSLs can be difficult to build, achieve high performance with, and require learning multiple languages as each domain typically has its own. DSLs are either built upon an existing language as an internal DSL, or built from scratch as an external DSL. This document discusses using a DSL to generate service components for service-oriented architecture applications to simplify implementation.
2. A domain specific language, DSL, is a special
purpose programming language specifically
designed to solve the problems in a particular
domain.
Examples:
◦ LATEX : for document layout
◦ SQL : Databases
◦ HTML: Document markup
◦ Mathematica: Computation
◦ AutoCAD: Computer aided design
3. The level of abstraction is very close to the
domain i.e., they are more expressive.
Users don’t need to be experts in regular
programming languages.
It helps to shift business IT from pure
software developers to domain experts.
4. Achieving higher performance is difficult.
A separate DSL for every domain creates the
need to learn many languages.
Since it is used by a small number of people,
it is not every time profitable to construct a
new language from scratch.
5. Internal DSLs:
◦ They are built upon another language, more often a
general purpose language.
◦ Inherits the tools from the base language.
◦ Restricted by the syntax of the base language.
6. External DSLs:
◦ They are built from the scratch.
◦ Will have their own parsers and compilers.
◦ Hard to build.
7. Preprocessing:
◦ DSL constructs are translated into constructs in the
base language.
Embedding:
◦ Existing mechanisms are used to build a library of
domain-specific operations.
8. Compiler/Interpreter:
◦ The language is built from the scratch.
◦ Compiler generator tools can be used to automate
some of the processes.
Extensible compilers/interpreters:
◦ A general purpose language compiler or interpreter
is extended.
◦ Very hard since most of the notation is already
used.
◦ The DSL notations must not interfere with the
existing one.
10. Service oriented architecture is one of the
modern architecture techniques which are
composed of loosely coupled and flexible
software components called services.
Supports.
◦ Usability.
◦ Scalability.
◦ Flexibility.
11.
12. Every organization has set of services like
cleaning, customer, R&D service etc. All must
communicate effectively to run the
organization.
Services are more like libraries that performs
various independent tasks but communicate
with a mechanism like web rather than using
in-memory function calls.
13.
14. Writing a DSL that generates service
components.
User will be able to generate the service
components by simply writing and compiling
DSL script.
15. Let us assume a simple SOA application
Service-A
◦ Reads data from the data base.
Service-B1
◦ Does some mathematical calculations on data
retrieved by service-A.
Service-B2
◦ Does another kind of mathematical calculations on
data provided by service-A.
Service-C
◦ Displays this processed data to the user.
16.
17. The DSL will generate the skeleton structure
of the above system.
◦ It generates the service components like data
variables and service methods.
◦ It generates the required documentation.
18. A standard procedure can be established
while building SOA, which makes
communication between services
harmonious.
Generating documentation automatically
decreases the time and labor for software
development.
By simply, going through the DSL script,
software can be understood.
19. DSL will become enough powerful to
◦ Generate the ESB.
◦ Generate communicating protocols.
20. SOA is an architectural approach for creating
systems built from autonomous services.
DSL will make implementation of SOA easier.