Download presentation
Presentation is loading. Please wait.
1
DSL‘s Daniel Frey
2
Roadmap Introduction Definitions Pros/Cons Samples
3
Introduction Sample My way of experiencing DSL‘s Focus on language oriented DSL’s
4
Introduction / 2 Why do we need DSL‘s?
5
Definitions DSL A computer programming language of limited expressiveness focused on a particular domain
6
Definition / 2 computer programming language language nature limited expressiveness domain focus
7
Styles of DSL‘s Internal External Language Workbenches
9
Language Workbench
10
Sample Input File: #123456789012345678901234567890123456789012345678901234567890 SVCLFOWLER 10101MS0120050313......................... SVCLHOHPE 10201DX0320050315........................ SVCLTWO x10301MRP220050329........................... USGE10301TWO x50214..7050329.......................
11
DSL 1
12
Syntax Abstract Syntax - concrete syntax
13
DSL 2 mapping SVCL dsl.ServiceCall 4-18: CustomerName 19-23: CustomerID 24-27 : CallTypeCode 28-35 : DateOfCallString mapping USGE dsl.Usage 4-8 : CustomerID 9-22: CustomerName 30-30: Cycle 31-36: ReadDate
14
DSL 3 mapping('SVCL', ServiceCall) do extract 4..18, 'customer_name' extract 19..23, 'customer_ID' extract 24..27, 'call_type_code' extract 28..35, 'date_of_call_string' end mapping('USGE', Usage) do extract 9..22, 'customer_name' extract 4..8, 'customer_ID' extract 30..30, 'cycle' extract 31..36, 'read_date' end
15
Brownie Example take(MicrowaveableDish) do melt((1/4).cup.butter) mix :with => 6.tablespoon.cocoa add 1.cup.sugar, 2.egg, (1/2).teaspoon.vanilla, (1/3).cup.flour, (1/4).teaspoon.salt mix bake :in => BakingPan, :for => 40.minutes, :at => 325.degrees end
16
RSpec Demo
17
Pro/Cons Evolving into Generality!
18
Different DSL‘s Why do we need DSL‘s? Represent easily businessrules in code
19
Different kinds of DSL‘ Video
20
Domain Experts Read and understand Not necessarly write!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.