Is UML a domain specific language (DSL)?

Is it appropriate to think of UML as DSL?

I know that everyone thinks of UML as a way of drawing images, but there is a model at the heart of the "presentation" of UML diagrams ... and the "L" in UML stands for language.

Another question is SysML DSL?

+4
source share
6 answers

UML is NOT DSL because UML can be used to model any vertical domain (insurance software, embedded systems, ...)

UML is a (horizontal) DSL because UML is a specialized language for modeling software systems.

Thus, UML is and is not DSL, depending on how you look at it. You can apply the same reasoning to many other languages, such as html or SQL. They are common because they can be used to represent / process any data, but they are specific because they are single-task oriented.

+3
source

UML is DSL.

"Domain-specific language" allows you to specify a problem or solution in a narrow field of application; banking, telephone telephony schemes .... One way to distinguish a DSL is that it cannot perform general purpose computing (although there are some DSLs that can). Java, C #, Python, and COBOL fail this test. (Some would say that COBOL is domain-specific for “business,” but its only major concession is the decimal data type, and C # also has this.) ColdFusion does not perform this test; non-standard syntax does not create DSL, but IIRC ColdFusion has some support for generating HTML. Fortran completes this test, but its sublingual array (-section) is only good for arrays, not general purpose. Verilog is very domain specific: it is designed to record digital circuits.

UML focuses on identifying various aspects of software structuring. [You will notice that he cannot perform general purpose calculations; one sign]. (In fact, it has 9 or more different aspects that it addresses: classes, state diagrams, deployment, ... I will stick to the class aspect for this discussion). The aspect of the class diagram allows you to describe how the data is organized and the operations on that data. You can argue about this with the software so that it cannot be "domain specific". What, software creation is not a problem domain?

SYSML focuses on expressing how systems connect, so it fits this category as well.

A more useful question is to ask IMHO: "If I think of UML as DSL, what will I get?" Here I do not think that you will get much. The DSL concept is useful when you are arguing with someone who is not (designed or possessed), because the point is the best expressiveness for the general problem and may be useful for the argument "you do not want to fully integrate your system into it because it is not a Turing ability" . It is also useful if you want to explain that your language will have a lot of funny notations, precisely because they serve special purposes. People already know about UML, so ... they didn't know anything.

While I am a big fan of DSL, I am also a big fan of GPL (General Purpose Languages). I think that in large systems you should definitely find “a lot” of both: DSL to express what they can succinctly (reduces engineering and maintenance costs), and GPL to provide arbitrary calculations and gluing between parts of the system. For me, what matters in the language:

  • what class of problem does it pretend to be an address and how well does it do it?
  • what is the syntax (and is it relatively standard for the problem area)?
  • What is the exact semantics (which is where you will learn the most)?
  • How good is tool support?
  • How well does DSL integrate into other parts of a large system?
  • How large and supported is the community?

UML (after 15 years) received fairly good answers to these questions.

Home DSLs often do not work as well, partly due to poor design, but often because tool support is difficult to obtain. My company provides equipment to give DSL developers excellent support to improve this situation.

+6
source

The short answer is NO to both questions.

Think of UML as a tool that allows you to describe software architectures, interactions with software, etc. .... describe them in general , an agnostic language.

DSLs are strong, specialized syntaxes that make it easy to describe some specific problems.

+1
source

I think the answer to your first question depends on how you define “General” in the term “General Purpose Language”. Wikipedia says this is not DSL:

Opposite:

  • general purpose programming language such as C, Java or Python,

  • or a general-purpose modeling language, such as a unified modeling language (UML).

+1
source

I am an MDA enthusiast, so I think I can give you a very detailed answer to your question. What is UML: Object Management Group (OMG), a consortium of companies aimed at providing standard languages ​​and technologies, has defined a meta-meta-modeling language called “Meta-Object Object” or MOF (http://www.omg.org/mof). A metamodel is a model that describes a model or, in other words, a dictionary description (elements that you can use in a model), syntax (ho they are related to each other) and their semantics (which means each object and how its value changes in this context etc.). The meta-model plays the same role as Context-Free grammars in relation to the languages ​​they produce. So you can think of a meta-meta-model as a language that you can use to define a meta-model. This is what OMG has done with UML. UML has a metamodel described using MOF in two documents: UML Infrastructure and UML Supersturcture (http://www.omg.org/specifications/UML).

The UML metamodel was defined with the goal of being sufficiently general to deal with the modeling of various systems belonging to different domains. When you define a new UML model, you instantiate the UML metamodel. You can do this for many reasons: analyze some of the characteristics of the system, share some aspects of the system with other interested parties, and so on. However, one of the most important aspects of OMG's vision is model transformations . When transforming, you can think of it as a set of rules telling the interpreter how to explore the model and produce something else. You can basically convert a model into two different types of thins, other models (Model2Model, M2M transforms defined using the QVT language), or text such as code or documentation (Model2Text, M2T, specific transformations using the MOFM2T transform language ). Therefore, it is VERY IMPORTANT to understand that the UML model is not its diagram. A diagram is simply a graphical representation of the contents of a model, useful to umans, but not machine readable. You cannot apply transformations to a chart.

The Eclipse Modeling Framework (EMF) is a very powerful (and free!) Structure that implements all the technologies that I mentioned. A subset of MOF is implemented in ECORE Eclipse. Using ECORE, the UML metamodel is defined so that UML graphical editors (that is, Papyrus, TopCased, etc.) actually create an XMI representation of graphically defined UML models corresponding to the ECORE representation of the UML metamodel. Such a representation may be presented as input to the converter. Two conversion languages ​​and related engines are also available in EMF with the QVTo plugin and ACCELEO (implementing the MOFM2T conversion language).

As mentioned, UML is intentionally shared. However, it also provides lightweight extension mechanisms to extend the original language vocabulary with domain-specific constructs. This can be done using stereotypes. A stereotype is a kind of label (actually with meta attributes) that you can attach to model elements to create new objects in the language. For example, you can say that in your models some of the classes may be requirements or something else. Of course, there are some rules, for example, when you are a stereotype of a metaclass, you cannot violate its original semantics, just reduce it.

SySML is a UML profile http://www.omgsysml.org/ . A SysML block is simply a UML class stereotyped as Block, a SysML requirement is another UML class stereotyped as Block, and so on.

Profiling a metamodel such as UML is a fairly simple way to create a kind of DSL (like with stereotypes that you add to a more general language, some constructs belonging to your domain) that are compatible with UML (i.e. you can use SysML and UML together). There is another way to create a DSL that defines its metamodel using MOF (ECORE). In this case, you are creating a completely new language that is conceptually at the same level as UML itself.

Many say that UML is just diagrams, because in many cases they don’t know what they are talking about. The topic is much more complicated, interesting and promising.

+1
source

UML is a general modeling language that is not specific to any field, while S in DSL means specific. UML is used to model systems that can also be represented by multi-purpose programming languages. DSLs, on the other hand, are limited programming / scripting languages ​​that belong to a specific domain.

0
source

Source: https://habr.com/ru/post/1411542/


All Articles