domain specific languages - a superficial approach
DESCRIPTION
Domain Specific Languages - A superficial approachTRANSCRIPT
![Page 1: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/1.jpg)
DSL - Domain Specific Languages
quinta-feira, 12 de dezembro de 13
![Page 2: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/2.jpg)
@toni_esteves
* Software Craftsman
* Web Developer TRE-AL
* Graduando Sistemas de Informação
quinta-feira, 12 de dezembro de 13
![Page 3: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/3.jpg)
Domain...
quinta-feira, 12 de dezembro de 13
![Page 4: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/4.jpg)
* Identify concepts related to system requirements...
* It is an artifact that represents the domain of problem...
* Should be independent of the physical solution...
* Communication...
* Visual representation of conceptual classes or objects real world...
* UML...
quinta-feira, 12 de dezembro de 13
![Page 5: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/5.jpg)
DSL...
quinta-feira, 12 de dezembro de 13
![Page 6: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/6.jpg)
“DSLs are small languages, focused on a particular aspect of a software
system. You can't build a full program with a DSL, but you often use multiple DSLs in a system mainly written in a general purpose language....” - Matin Fowler
quinta-feira, 12 de dezembro de 13
![Page 7: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/7.jpg)
WTF ?!
“DSLs are small languages, focused on a particular aspect of a software
system. You can't build a full program with a DSL, but you often use multiple DSLs in a system mainly written in a general purpose language....” - Matin Fowler
quinta-feira, 12 de dezembro de 13
![Page 8: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/8.jpg)
A real aplication....
quinta-feira, 12 de dezembro de 13
![Page 9: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/9.jpg)
quinta-feira, 12 de dezembro de 13
![Page 10: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/10.jpg)
If you’ll design a device driver, which
programming language do you choose ?!
quinta-feira, 12 de dezembro de 13
![Page 11: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/11.jpg)
Try this then, if you will build a compiler which programming language
you choose ?!
quinta-feira, 12 de dezembro de 13
![Page 12: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/12.jpg)
X
quinta-feira, 12 de dezembro de 13
![Page 13: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/13.jpg)
X
General Purpose Languages
Domain Specific Languages
quinta-feira, 12 de dezembro de 13
![Page 14: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/14.jpg)
Communication Protocol Device Drives Games Databases
Image Manipulations MusicMobile Agents Medical
quinta-feira, 12 de dezembro de 13
![Page 15: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/15.jpg)
Communication Protocol Device Drives Games Databases
Image Manipulations MusicMobile Agents Medical
Domain Specific Languages
quinta-feira, 12 de dezembro de 13
![Page 16: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/16.jpg)
Communication Protocol Device Drives Games Databases
Image Manipulations MusicMobile Agents Medical
Domain Specific Languages
subroutine libraries/ API`s Component Framework / Object-Orientation
quinta-feira, 12 de dezembro de 13
![Page 17: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/17.jpg)
For example...
=SOMA(D1:D5)
Do you know this ?!
quinta-feira, 12 de dezembro de 13
![Page 18: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/18.jpg)
“ DSLs are very common in computing: e x a m p l e s i n c l u d e C S S , r e g u l a r expressions, make, rake, ant, SQL, HQL, many bits of Rails, expectations in JMock, graphviz's dot language, FIT, strut's configuration file....” - Matin Fowler
quinta-feira, 12 de dezembro de 13
![Page 19: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/19.jpg)
GUI builders can also be seen as DSLs?
quinta-feira, 12 de dezembro de 13
![Page 20: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/20.jpg)
Characteristics....* Are usually small...
* Are usually declarative...
* Many DSLs are translated compiled) into calls to APIs...
* Are divided into External DSL and Internal DSL...
* Unambiguous...
quinta-feira, 12 de dezembro de 13
![Page 21: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/21.jpg)
Pattern Application....Model: It`s the problem. May be a te xtual e xpre ss ion or a diagram...
Plataform: Used for the execution of the problem...
Integration: method to express the integration of language on the platform...
quinta-feira, 12 de dezembro de 13
![Page 22: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/22.jpg)
Pattern Application....
quinta-feira, 12 de dezembro de 13
![Page 23: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/23.jpg)
Method of Integration...Reading: part of the platform i tse l f i s de dicate d to the mastery of expressions of dsl and execution of your goals...
G e n e r a t i o n : a s e p a r a t e procedure is used to convert the DSL expression into something t h at re c o gn ize s p l at f or m natively...
quinta-feira, 12 de dezembro de 13
![Page 24: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/24.jpg)
Method of Integration...
Craft Techniques: used when a particular model is not enough to solve the entire problem...
quinta-feira, 12 de dezembro de 13
![Page 25: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/25.jpg)
DSL types...
quinta-feira, 12 de dezembro de 13
![Page 26: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/26.jpg)
External...* Independent of a particular programming language...
* Depends on the programming language...
* It`s benefited by existing resources in the host language...
* It`s limited by the rules of the host language restrictions...
* May be readable to people who do not know anything about the language, but have experience in the field...
quinta-feira, 12 de dezembro de 13
![Page 27: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/27.jpg)
Internal...* Usually are easy to implement...
* Creator of the language has the freedom to create the language the way you want...
* Is necessary to create a compiler for parsing, processing syntax and mapping semantics...
* Very flexible but takes time to create and maintain the compiler...
quinta-feira, 12 de dezembro de 13
![Page 28: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/28.jpg)
Advantages...* Solutions in their own language and domain...
* Increase abstraction level...
* What programming instead how programming...
* Efforts on productivity...
* Encapsulates the problem...
* Prepare code to reuse...
* Make concise code...
* Generate sufficient documentation...quinta-feira, 12 de dezembro de 13
![Page 29: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/29.jpg)
Drawback...* Requires attention to high costs...
* Needs technical expertise on domain...
* Needs to bring all the relevant domain knowledge...
* Difficulty in seeking the general scope and the construction of domain-specific languages...
* Experts must possess the relevant knowledge domain...
quinta-feira, 12 de dezembro de 13
![Page 30: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/30.jpg)
Other topics...
* Embedded DSL...
* Language Workbench...
* Visual DSL`s...
* Language-Oriented Programming...
quinta-feira, 12 de dezembro de 13
![Page 31: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/31.jpg)
Ending....
quinta-feira, 12 de dezembro de 13
![Page 32: Domain Specific Languages - A superficial approach](https://reader034.vdocuments.site/reader034/viewer/2022051322/5468c00caf7959a75e8b5500/html5/thumbnails/32.jpg)
References....http://www.martinfowler.com/articles/languageWorkbench.html
http://www.infoq.com/presentations/domain-specific-languages
http://blog.caelum.com.br/domain-specific-languages-em-acao/
http://martinfowler.com/books/dsl.html
http://martinfowler.com/bliki/DomainSpecificLanguage.html
http://blogs.msdn.com/b/wcamb/archive/2009/08/17/algumas-palavrinhas-sobre-domain-specific-language-dsl.aspx
http://www.infoq.com/presentations/Truth-about-DSL
http://www.cesar.edu.br/docs/DSL%20CESAR.pdf
quinta-feira, 12 de dezembro de 13