DSL - Domain Specific
Languages

quinta-feira, 12 de dezembro de 13
* Soft ware Craftsman
* Web Developer TRE-AL
* Graduando Sistemas de
Informação
@toni_esteves

quinta-feira, 12 de dezembr...
Domain...

quinta-feira, 12 de dezembro de 13
* Visual representation of conceptual
classes or objects real world...
* Identify concepts related to system
requirements....
DSL...

quinta-feira, 12 de dezembro de 13
“DSLs are small languages, focused on a
particular aspect of a soft ware
system. You can't build a full program
with a DSL...
“DSLs are small languages, focused on a
particular aspect of a soft ware
system. You can't build a full program
with a DSL...
A real aplication....

quinta-feira, 12 de dezembro de 13
quinta-feira, 12 de dezembro de 13
If you’ll design a device
driver, which
programming language
do you choose ?!

quinta-feira, 12 de dezembro de 13
Try this then, if you will
build a compiler which
programming language
you choose ?!

quinta-feira, 12 de dezembro de 13
X

quinta-feira, 12 de dezembro de 13
General Purpose
Languages

Domain Specific
Languages
X

quinta-feira, 12 de dezembro de 13
Communication Protocol

Device Drives

Games

Databases

Image Manipulations

Mobile Agents

Music

Medical

quinta-feira,...
Domain Specific Languages
Communication Protocol

Device Drives

Games

Databases

Image Manipulations

Mobile Agents

Musi...
Domain Specific Languages
subroutine libraries/ API`s

Component Framework /
Object-Orientation

Communication Protocol

De...
For example...
Do you know this ?!

=SOMA(D1:D5)

quinta-feira, 12 de dezembro de 13
“ DSLs are very common in computing:
e xample s i nclude CSS, re gul ar
expressions, make, rake, ant, SQL, HQL,
many bits ...
GUI builders can also be
seen as DSLs?

quinta-feira, 12 de dezembro de 13
Characteristics....
* Are usually small...
* Are usually declarative...
* Many DSLs are translated compiled)
into calls to...
Pattern Application....
Model: It`s the problem. May be
a te xt ual e x pre ssion or a
diagram...
Plataform: Used for the ...
Pattern Application....

quinta-feira, 12 de dezembro de 13
Method of Integration...
Reading: part of the platform
i tse lf is de dic ate d t o t h e
mastery of expressions of dsl
an...
Method of Integration...
Craft Techniques: used when a
particular model is not enough
to solve the entire problem...

quin...
DSL types...

quinta-feira, 12 de dezembro de 13
External...
* Independent of a particular programming language...
* Depends on the programming language...
* It`s benefite...
Internal...
* Usually are easy to implement...
* Creator of the language has the freedom to create the
language the way yo...
Advantages...
* Solutions in their own language and domain...
* Increase abstraction level...
* What programming instead h...
Drawback...
* Requires attention to high costs...
* Needs technical expertise on domain...
* Needs to bring all the releva...
Other topics...
* Embedded DSL...
* Language Workbench...
* Visual DSL`s...
* Language-Oriented Programming...

quinta-fei...
Ending....

quinta-feira, 12 de dezembro de 13
References....
http://www.martinfowler.com/articles/languageWorkbench.html
http://www.infoq.com/presentations/domain-speci...
Upcoming SlideShare
Loading in …5
×

Domain Specific Languages - A superficial approach

471 views

Published on

Domain Specific Languages - A superficial approach

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total views
471
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Domain Specific Languages - A superficial approach

  1. 1. DSL - Domain Specific Languages quinta-feira, 12 de dezembro de 13
  2. 2. * Soft ware Craftsman * Web Developer TRE-AL * Graduando Sistemas de Informação @toni_esteves quinta-feira, 12 de dezembro de 13
  3. 3. Domain... quinta-feira, 12 de dezembro de 13
  4. 4. * Visual representation of conceptual classes or objects real world... * Identify concepts related to system requirements... * It is an artifact that represents the domain of problem... * Should be independent of the physical solution... * Communication... * UML... quinta-feira, 12 de dezembro de 13
  5. 5. DSL... quinta-feira, 12 de dezembro de 13
  6. 6. “DSLs are small languages, focused on a particular aspect of a soft ware 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
  7. 7. “DSLs are small languages, focused on a particular aspect of a soft ware 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 WTF ?! quinta-feira, 12 de dezembro de 13
  8. 8. A real aplication.... quinta-feira, 12 de dezembro de 13
  9. 9. quinta-feira, 12 de dezembro de 13
  10. 10. If you’ll design a device driver, which programming language do you choose ?! quinta-feira, 12 de dezembro de 13
  11. 11. Try this then, if you will build a compiler which programming language you choose ?! quinta-feira, 12 de dezembro de 13
  12. 12. X quinta-feira, 12 de dezembro de 13
  13. 13. General Purpose Languages Domain Specific Languages X quinta-feira, 12 de dezembro de 13
  14. 14. Communication Protocol Device Drives Games Databases Image Manipulations Mobile Agents Music Medical quinta-feira, 12 de dezembro de 13
  15. 15. Domain Specific Languages Communication Protocol Device Drives Games Databases Image Manipulations Mobile Agents Music Medical quinta-feira, 12 de dezembro de 13
  16. 16. Domain Specific Languages subroutine libraries/ API`s Component Framework / Object-Orientation Communication Protocol Device Drives Games Databases Image Manipulations Mobile Agents Music Medical quinta-feira, 12 de dezembro de 13
  17. 17. For example... Do you know this ?! =SOMA(D1:D5) quinta-feira, 12 de dezembro de 13
  18. 18. “ DSLs are very common in computing: e xample s i nclude CSS, re gul ar 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
  19. 19. GUI builders can also be seen as DSLs? quinta-feira, 12 de dezembro de 13
  20. 20. 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
  21. 21. Pattern Application.... Model: It`s the problem. May be a te xt ual e x pre ssion 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
  22. 22. Pattern Application.... quinta-feira, 12 de dezembro de 13
  23. 23. Method of Integration... Reading: part of the platform i tse lf is de dic ate d t o t h e mastery of expressions of dsl and execution of your goals... Generation: a separate procedure is used to convert the DSL expression into something t h a t re c o g n i ze s p l a t f o r m natively... quinta-feira, 12 de dezembro de 13
  24. 24. 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
  25. 25. DSL types... quinta-feira, 12 de dezembro de 13
  26. 26. 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
  27. 27. 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
  28. 28. Advantages... * Solutions in their own language and domain... * Increase abstraction level... * What programming instead how programming... * Efforts on productivity... * Encapsulates the problem... * Make concise code... * Prepare code to reuse... * Generate sufficient documentation... quinta-feira, 12 de dezembro de 13
  29. 29. 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
  30. 30. Other topics... * Embedded DSL... * Language Workbench... * Visual DSL`s... * Language-Oriented Programming... quinta-feira, 12 de dezembro de 13
  31. 31. Ending.... quinta-feira, 12 de dezembro de 13
  32. 32. 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://www.infoq.com/presentations/Truth-about-DSL http://martinfowler.com/bliki/DomainSpecificLanguage.html http://blogs.msdn.com/b/wcamb/archive/2009/08/17/algumaspalavrinhas-sobre-domain-specific-language-dsl.aspx http://www.cesar.edu.br/docs/DSL%20CESAR.pdf quinta-feira, 12 de dezembro de 13

×