Top Banner
DSLs and UML Karl Frank, Principal Architect
30

DSLs and UML Karl Frank, Principal Architect. Topics: Languages, and Languages in computing. The influential book and numerous articles by Jack.

Dec 27, 2015

Download

Documents

Delphia Barber
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

DSLs and UML Karl Frank, Principal Architect

Page 2: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Topics:

Languages, and Languages in computing. The influential book and numerous articles by Jack

Greenfield of Microsoft, with Steve Cook. You can find information about DSL tools at

http://lab.msdn.microsoft.com/teamsystem/workshop/dsltools/default.aspx.

The complexity of UML 2.The triviality of UML 1 profiles.As yet untested strength of UML 2 profilesExperience in defining a metamodel.

a

Page 3: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Goals:

Set out presenter’s views on DSL and UML and all the above topics.

Persuade you these views worth considering.

Page 4: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Overview:

No overview slide.Don’t know how these views will evolve.May end up at unexpected point of view.

Page 5: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

ReferencesEdward Tufte The Visual Display of Quantitative Information 2nd Edition ©1992 Graphics Press, Cheshire CT, ISBN 0-961392-4-2.

Jack Greenfield et al. Software Factories: Assembling Applications with Patterns, Models, Frameworks, and Tools ©2004 by Wiley Publishing Inc., ISBN 0-471-20284-3.

James O. Coplien and Douglas C. Schmidt, editors Pattern Languages of Program Design, Volume 1 ©1995 by Addison Wesley Longman Inc., published by Addison-Wesley, ISBN 0-201-60734-4. A collection of previously published papers.

Krzysztof Czarnecki and Ulrich Eisenacker Generative Programming: Methods, Tools, and Applications ©2000 by Addison-Wesley, Inc., ISBN 0-201-30977-7.

David M. Weiss and Chi Tau Robert Lai Software Product Line Engineering: A Family-Based Software Development Process ©1999 by Lucent Technologies, Bell Labs Innovations, published by Addison Wesley Longman, Inc., ISBN 0-201-69438-7.

Page 6: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Pipe routing in a submarine

A graphic layout program for detailed specification of the routing of pipes thru the spaces in a sub, with output to be used by the pipe-fitters during construction and also used by engineers during design and purchasing agent in providing materials.

Compare with a UML static structure diagram.

Page 7: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

UML Class Diagram sucks.Relative to the

purpose.Rivet

shearStrengthtensileStrengthdiameter

PipeSegment

lengthdiameterweightPerLinealMeter

SupportBracket

orientation:FixtureGeometryloadCapacityKilos:IntegermountingPlateHoles:Integer

<<enumeration>>FixtureGeometry

hangingBracketstandingBracketrightHandSideBracket

FixtureConfiguration

totalWeight:Real

VesselStructuralCompartmentVesselStructuralDesign

2..8

1..2 1..1

Page 8: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

But so does this.

See next slide.

Page 9: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.
Page 10: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

From Tufte's work:

OK, so what is a language?

Page 11: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

User Interface Design

Standards for UI even predate GUIStandards for command-line syntax

don't randomly choose '-' or '/' as option flags

Is this a DSL at work?

Page 12: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Starting Point:

Microsoft introduced term DSL.Contrary to general opinion,

It doesn’t mean Domain Specific Language

It means Little Language For an Application Domain

As in “domain analysis” Or “domain engineering”

Preferably computationally incomplete. In support of product line design.

Page 13: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Reasoning. Part 1.

What ‘domain’ means in relation to a language is well understood in the domain of language theory.

Every artificial language (contrasted with natural) has some domain.

Hence every artificial language is a domain specific language. Every computer language is an artificial language.

So every computer language is a domain specific one. But of course they are not all DSLs.

Page 14: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Reasoning. Part 2

Microsoft “owns” the term ‘DSL’ but Does not own the term ‘domain’ Nor the term ‘specific’ Nor the word ‘language’.

So they can make ‘DSL’ mean whatever they want.

And they mean: Go to above slide wrt little language In support of product line engineering

Page 15: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

But others had already coined the terms

‘little language’‘product line engineering’‘domain analysis’

Smart and Cook invented a new word DSL.

Page 16: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Fun way of proving the point C BNF(EBNF) Pascal html awk Fortran Lisp Cobol perl MOF

Credit to Dan Massey for turning this into a quiz

Defining Modeling Languages Operating Systems AI teaching structured programming mathematical computations business IT programming system admin tasks text manipulation web page loading and layout specify program language syntax

Page 17: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Challenging question?

So what domain was Java invented for? And how about UML?

UML is certainly not a DSL, Greenfield and Cook explicitly say it is not a DSL.

But it is certainly a domain specific language, the domain being OO program specification.

Page 18: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

General purpose computer languages

Theoretically any language that is computationally complete.

This includes any that can support recursion or iteration.

From the examples, it appears that DSLs are not meant to be general purpose in this sense.

Page 19: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Are there universal Languages?

Natural languages are used in Empirical Science Love Letters Formal Mathematics Political Editorials Software Specification Travel Itineraries Contract Law Epic Poetry

And we can lexicalize the Inuit concepts for Snow in English or Mandarin if we wish.

Page 20: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

So, DSLs are important but:

They did not come upon us in the Software Factories book.

'DSL' does not mean Domain Specific Language.

Page 21: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

OK, how about UML?

Apart from the fact that it sucks for pipe layout diagrams.

It is a single unified abstract syntax, but the concrete syntax really breaks it into many different languages.

This reflects the reality of its origins. UML aggregated languages of Jacobson, Booch, and

Rumbaugh in a single metamodel with evident strain.

Page 22: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Is it too complex?

Relative to what purpose?Yes, too complex for the implementers whose

programs must wrestle with the stresses inside the single abstract syntax that is holding separate concrete languages together in one structure.

But each user of the language is free to choose and stick with one concrete language from among those aggregated.

Page 23: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Is it the universal language for software?

Obviously not.It serves the class-oriented version of OOIt serves the static modeling of problem

domains only to the extent that these non-software domains are conceptualized in terms of classes, statemachines, and the other handful of concepts in UML.

Structured procedural programming?Pure functional programming? etc. NO.

Page 24: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Agree with Coplien, Cook, Greenfield:

UML does not do it all But not because it is too complicated, but because it is

an aggregation of just a very few domain specific languages.

New domain specific languages needed. But the question is, should they be DSLs in the special

sense of SoftwareFactories, where it does not mean the same as Domain Specific Language.

No reason to restrict our interest to graphic computationally incomplete languages for business application domains.

Page 25: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

A new graphic is not a new language.

It is imo a problem for English and other western European languages that the upper case i looks like the lower case L, and that the uppercase "OHH" looks like a zero.

Changing the concrete notation does not a new language make, if the syntax and semantics are not impacted.

Page 26: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Inertia in software development is human

The cost of creating a new language pales Compared to cost of creating a community of users.

Even with an well-publicized language supported by an army of trainers and a wealth of books on the market, getting the staff to all know and use a new language is COLLOSAL.

And the cost of creating the army of trainers and the library of books?

Page 27: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Consequently, it usually is not worth it.

Most creations of new languages are like the vanity press industry.

It's cool to do it, and people will do it even though it costs more than it earns.

So it is important for Borland and Microsoft and Eclipse to support this with tools such as GMF and Longhorn.

Page 28: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

When is the risk justified?

When the cost of the communication effort using existing languages (because of their inefficiency in expressing the facts and specifying the implementation in a given specific domain), summed over the lifetime of the domain, vastly exceeds the cost of developing and popularizing the new language.

Page 29: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

What are the concepts of the domain?

Protege 3.1 with OWL DL is a good help.Understand the difference between

lexicalized and unlexicalized concepts.Organize terms close to your target in

synsets.Differentiate the relational concepts from

the categorical concepts.Introduce your own lexicalizations.

Page 30: DSLs and UML  Karl Frank, Principal Architect. Topics:  Languages, and Languages in computing.  The influential book and numerous articles by Jack.

Suppose you choose to do it. How?

First look at extending UML 2UML 2 Stereotypes are much better as an

extension mechanism than UML 1.Second, attempt to use EMF (emof) to

define the abstract syntax of your language. Otherwise, you won't have tools to generate or interoperate with your language.