SlideShare une entreprise Scribd logo
1  sur  18
Domain Specific Languages Dror Helper
About.Me Software developer  Blogger (http://blog.drorhelper.com) Language geek
What do they mean? Bug Feature Release Candidate Show stopper “The next release candidate would contain features X, Y & Z and no more than 5 high priority Bugsandno show stoppers”
Agenda Why should I use DSLs Domain Specific Languages Fluent interface
Domain Specific Languages created specifically to solve problems in a particular domain Layer of abstraction on top of an existing domain model Can be used by domain experts
DSL classification External vs. Internal Textual vs. Graphic
Graphical DSLs
External DSLs SELECTBook.title, count(*) ASAuthors FROMBook JOINBook_authorONBook.isbn = Book_author.isbnGROUPBYBook.title; <([A-Z][A-Z0-9]*)[^>]*>(.*?)</> buyIBM @ 100 forNOMURA sellGOOGLE @ limitprice= 70 for CHASE
Internal DSLs Built on top of an existing language Use languages like Ruby, Python, BOO
Fluent interfaces coined by Eric Evans and Martin Fowler An OOP API that aims to provide readable code Use method chaining an pass context via return value ,[object Object]
DateTime.Now.AddDays(7);  DateTime.Now.AddWeeks(1);,[object Object]
Fluent Interface design Hide your working. Keep your state to yourself. Think really hard about names. Take advantage of your implementation language. If you have them, blocks are you friends. Test first design can be a useful way of exploring what your interface should be. Reasonable defaults.
Tips & Tricks  Use Interfaces Return different interface to change functionality Generics are handy if user need to specify type Lambda and delegates for custom functionality
Books DSLs in Action DSLs in Boo
The shopping cart	 A Domain Specific exercise
The Story You need to create a simple rule engine that would enable developers to add custom rules to the company’s Shopping cart application.
The engine Three customer types: regular, preferred & VIP Customer the following fields:  name  address date of birth The system tracks the customer’s purchases (date, amount) Products can be on Sale (discount) Discount changes according to rules Each rule must have a customer type
Usage examples A VIP customer get 15% discount on all purchases Buying product A would give you 10% discount on product B Preferred and VIP customers can buy 5 + 1 of a specific product All customers can get 20% off purchase using specific coupon If amount of purchase > 100$ customer is entitled for 10% discount. If customer have purchased > 100$ the last three months upgrade him to VIP On the customer’s birthday he’s entitled to 50% discount All customers living in New York can get up to 25% off all purchases

Contenu connexe

En vedette

Introduction to Agile & scrum
Introduction to Agile & scrumIntroduction to Agile & scrum
Introduction to Agile & scrumElad Sofer
 
Infrastructure code in Agile software development
Infrastructure code in Agile software developmentInfrastructure code in Agile software development
Infrastructure code in Agile software developmentElad Sofer
 
Scrum training day 2
Scrum training day 2Scrum training day 2
Scrum training day 2Elad Sofer
 
Scrum training day 1
Scrum training day 1Scrum training day 1
Scrum training day 1Elad Sofer
 
Less intro workshop
Less intro workshopLess intro workshop
Less intro workshopElad Sofer
 
Lean sw development il tech-talks
Lean sw development   il tech-talksLean sw development   il tech-talks
Lean sw development il tech-talksElad Sofer
 
Agile estimation and planning
Agile estimation and planning Agile estimation and planning
Agile estimation and planning Elad Sofer
 
Practical-Agile Product owner workshop
Practical-Agile Product owner workshopPractical-Agile Product owner workshop
Practical-Agile Product owner workshopElad Sofer
 
Advanced Scrum master workshop
Advanced Scrum master workshopAdvanced Scrum master workshop
Advanced Scrum master workshopElad Sofer
 
Get rid of boring retrospectives
Get rid of boring retrospectivesGet rid of boring retrospectives
Get rid of boring retrospectivesElad Sofer
 

En vedette (11)

Introduction to Agile & scrum
Introduction to Agile & scrumIntroduction to Agile & scrum
Introduction to Agile & scrum
 
Infrastructure code in Agile software development
Infrastructure code in Agile software developmentInfrastructure code in Agile software development
Infrastructure code in Agile software development
 
Scrum intro
Scrum intro Scrum intro
Scrum intro
 
Scrum training day 2
Scrum training day 2Scrum training day 2
Scrum training day 2
 
Scrum training day 1
Scrum training day 1Scrum training day 1
Scrum training day 1
 
Less intro workshop
Less intro workshopLess intro workshop
Less intro workshop
 
Lean sw development il tech-talks
Lean sw development   il tech-talksLean sw development   il tech-talks
Lean sw development il tech-talks
 
Agile estimation and planning
Agile estimation and planning Agile estimation and planning
Agile estimation and planning
 
Practical-Agile Product owner workshop
Practical-Agile Product owner workshopPractical-Agile Product owner workshop
Practical-Agile Product owner workshop
 
Advanced Scrum master workshop
Advanced Scrum master workshopAdvanced Scrum master workshop
Advanced Scrum master workshop
 
Get rid of boring retrospectives
Get rid of boring retrospectivesGet rid of boring retrospectives
Get rid of boring retrospectives
 

Similaire à Domain specific languages

Website development proposal - Leadtrance Technologies
Website development proposal - Leadtrance TechnologiesWebsite development proposal - Leadtrance Technologies
Website development proposal - Leadtrance TechnologiesLeadtrance Technologies
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introductionwojtek_s
 
Salesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajSalesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajYuvaraj P
 
Front-End Performance Checklist 2020
Front-End Performance Checklist 2020Front-End Performance Checklist 2020
Front-End Performance Checklist 2020Harsha MV
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignFrank Levering
 
SMX West 2012 - Duplication, Aggregation, Syndication, Affiliates, Scraping &...
SMX West 2012 - Duplication, Aggregation, Syndication, Affiliates, Scraping &...SMX West 2012 - Duplication, Aggregation, Syndication, Affiliates, Scraping &...
SMX West 2012 - Duplication, Aggregation, Syndication, Affiliates, Scraping &...Nick Roshon
 
SBF STEALTH (en)
SBF STEALTH (en)SBF STEALTH (en)
SBF STEALTH (en)StreetLib
 
Ahrefs SEO Toolset Quick Guide ( Updated in August 2013)
Ahrefs SEO Toolset Quick Guide  ( Updated in August 2013) Ahrefs SEO Toolset Quick Guide  ( Updated in August 2013)
Ahrefs SEO Toolset Quick Guide ( Updated in August 2013) Clare Hoang
 
Sage X3 Sales App: Gain Mobile Access to Sage X3
Sage X3 Sales App: Gain Mobile Access to Sage X3Sage X3 Sales App: Gain Mobile Access to Sage X3
Sage X3 Sales App: Gain Mobile Access to Sage X3Net at Work
 
Internal DSLs For Automated Functional Testing
Internal DSLs For Automated Functional TestingInternal DSLs For Automated Functional Testing
Internal DSLs For Automated Functional TestingJohn Sonmez
 
IBM Forms Experience Builder on Cloud
IBM Forms Experience Builder on Cloud IBM Forms Experience Builder on Cloud
IBM Forms Experience Builder on Cloud mlech23
 
Wordpress org support_topic_displaying_phone_numbers
Wordpress org support_topic_displaying_phone_numbersWordpress org support_topic_displaying_phone_numbers
Wordpress org support_topic_displaying_phone_numbersELISEO Lucy
 
AI Builder Deepdive DynamicsPower! Brussels 2019
AI Builder Deepdive DynamicsPower! Brussels 2019AI Builder Deepdive DynamicsPower! Brussels 2019
AI Builder Deepdive DynamicsPower! Brussels 2019Rebekka Aalbers-de Jong
 
Versioned Page Objects: How to handle 12 versions of web application
Versioned Page Objects: How to handle 12 versions of web applicationVersioned Page Objects: How to handle 12 versions of web application
Versioned Page Objects: How to handle 12 versions of web applicationAlexandr Khotemskoy
 
Responsive Web Design Basics
Responsive Web Design BasicsResponsive Web Design Basics
Responsive Web Design BasicsAustin Walker
 

Similaire à Domain specific languages (20)

Website development proposal - Leadtrance Technologies
Website development proposal - Leadtrance TechnologiesWebsite development proposal - Leadtrance Technologies
Website development proposal - Leadtrance Technologies
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Salesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajSalesforce CPQ by yuvaraj
Salesforce CPQ by yuvaraj
 
Front-End Performance Checklist 2020
Front-End Performance Checklist 2020Front-End Performance Checklist 2020
Front-End Performance Checklist 2020
 
Code & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven DesignCode & Cannoli - Domain Driven Design
Code & Cannoli - Domain Driven Design
 
SMX West 2012 - Duplication, Aggregation, Syndication, Affiliates, Scraping &...
SMX West 2012 - Duplication, Aggregation, Syndication, Affiliates, Scraping &...SMX West 2012 - Duplication, Aggregation, Syndication, Affiliates, Scraping &...
SMX West 2012 - Duplication, Aggregation, Syndication, Affiliates, Scraping &...
 
SBF STEALTH (en)
SBF STEALTH (en)SBF STEALTH (en)
SBF STEALTH (en)
 
Ahrefs SEO Toolset Quick Guide ( Updated in August 2013)
Ahrefs SEO Toolset Quick Guide  ( Updated in August 2013) Ahrefs SEO Toolset Quick Guide  ( Updated in August 2013)
Ahrefs SEO Toolset Quick Guide ( Updated in August 2013)
 
Sage X3 Sales App: Gain Mobile Access to Sage X3
Sage X3 Sales App: Gain Mobile Access to Sage X3Sage X3 Sales App: Gain Mobile Access to Sage X3
Sage X3 Sales App: Gain Mobile Access to Sage X3
 
Internal DSLs For Automated Functional Testing
Internal DSLs For Automated Functional TestingInternal DSLs For Automated Functional Testing
Internal DSLs For Automated Functional Testing
 
IBM Forms Experience Builder on Cloud
IBM Forms Experience Builder on Cloud IBM Forms Experience Builder on Cloud
IBM Forms Experience Builder on Cloud
 
SDWest2005Goetsch
SDWest2005GoetschSDWest2005Goetsch
SDWest2005Goetsch
 
Local edge
Local edgeLocal edge
Local edge
 
Wordpress org support_topic_displaying_phone_numbers
Wordpress org support_topic_displaying_phone_numbersWordpress org support_topic_displaying_phone_numbers
Wordpress org support_topic_displaying_phone_numbers
 
AI Builder Deepdive DynamicsPower! Brussels 2019
AI Builder Deepdive DynamicsPower! Brussels 2019AI Builder Deepdive DynamicsPower! Brussels 2019
AI Builder Deepdive DynamicsPower! Brussels 2019
 
Versioned Page Objects: How to handle 12 versions of web application
Versioned Page Objects: How to handle 12 versions of web applicationVersioned Page Objects: How to handle 12 versions of web application
Versioned Page Objects: How to handle 12 versions of web application
 
Responsive Web Design Basics
Responsive Web Design BasicsResponsive Web Design Basics
Responsive Web Design Basics
 
How to reduce DTP and translation costs with FrameMaker
How to reduce DTP and translation costs with FrameMakerHow to reduce DTP and translation costs with FrameMaker
How to reduce DTP and translation costs with FrameMaker
 
Conga composer
Conga composerConga composer
Conga composer
 
Select an e forms vendor
Select an e forms vendorSelect an e forms vendor
Select an e forms vendor
 

Plus de Dror Helper

Unit testing patterns for concurrent code
Unit testing patterns for concurrent codeUnit testing patterns for concurrent code
Unit testing patterns for concurrent codeDror Helper
 
The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutDror Helper
 
Debugging with visual studio beyond 'F5'
Debugging with visual studio beyond 'F5'Debugging with visual studio beyond 'F5'
Debugging with visual studio beyond 'F5'Dror Helper
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better codeDror Helper
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better codeDror Helper
 
A software developer guide to working with aws
A software developer guide to working with awsA software developer guide to working with aws
A software developer guide to working with awsDror Helper
 
The secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutThe secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutDror Helper
 
The role of the architect in agile
The role of the architect in agileThe role of the architect in agile
The role of the architect in agileDror Helper
 
Harnessing the power of aws using dot net core
Harnessing the power of aws using dot net coreHarnessing the power of aws using dot net core
Harnessing the power of aws using dot net coreDror Helper
 
Developing multi-platform microservices using .NET core
 Developing multi-platform microservices using .NET core Developing multi-platform microservices using .NET core
Developing multi-platform microservices using .NET coreDror Helper
 
Harnessing the power of aws using dot net
Harnessing the power of aws using dot netHarnessing the power of aws using dot net
Harnessing the power of aws using dot netDror Helper
 
Secret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutSecret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutDror Helper
 
C++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the uglyC++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the uglyDror Helper
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy codeDror Helper
 
Visual Studio tricks every dot net developer should know
Visual Studio tricks every dot net developer should knowVisual Studio tricks every dot net developer should know
Visual Studio tricks every dot net developer should knowDror Helper
 
Secret unit testing tools
Secret unit testing toolsSecret unit testing tools
Secret unit testing toolsDror Helper
 
Electronics 101 for software developers
Electronics 101 for software developersElectronics 101 for software developers
Electronics 101 for software developersDror Helper
 
Navigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupNavigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupDror Helper
 
Building unit tests correctly
Building unit tests correctlyBuilding unit tests correctly
Building unit tests correctlyDror Helper
 
Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbgDror Helper
 

Plus de Dror Helper (20)

Unit testing patterns for concurrent code
Unit testing patterns for concurrent codeUnit testing patterns for concurrent code
Unit testing patterns for concurrent code
 
The secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you aboutThe secret unit testing tools no one ever told you about
The secret unit testing tools no one ever told you about
 
Debugging with visual studio beyond 'F5'
Debugging with visual studio beyond 'F5'Debugging with visual studio beyond 'F5'
Debugging with visual studio beyond 'F5'
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better code
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better code
 
A software developer guide to working with aws
A software developer guide to working with awsA software developer guide to working with aws
A software developer guide to working with aws
 
The secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you aboutThe secret unit testing tools no one has ever told you about
The secret unit testing tools no one has ever told you about
 
The role of the architect in agile
The role of the architect in agileThe role of the architect in agile
The role of the architect in agile
 
Harnessing the power of aws using dot net core
Harnessing the power of aws using dot net coreHarnessing the power of aws using dot net core
Harnessing the power of aws using dot net core
 
Developing multi-platform microservices using .NET core
 Developing multi-platform microservices using .NET core Developing multi-platform microservices using .NET core
Developing multi-platform microservices using .NET core
 
Harnessing the power of aws using dot net
Harnessing the power of aws using dot netHarnessing the power of aws using dot net
Harnessing the power of aws using dot net
 
Secret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutSecret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you about
 
C++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the uglyC++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the ugly
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy code
 
Visual Studio tricks every dot net developer should know
Visual Studio tricks every dot net developer should knowVisual Studio tricks every dot net developer should know
Visual Studio tricks every dot net developer should know
 
Secret unit testing tools
Secret unit testing toolsSecret unit testing tools
Secret unit testing tools
 
Electronics 101 for software developers
Electronics 101 for software developersElectronics 101 for software developers
Electronics 101 for software developers
 
Navigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupNavigating the xDD Alphabet Soup
Navigating the xDD Alphabet Soup
 
Building unit tests correctly
Building unit tests correctlyBuilding unit tests correctly
Building unit tests correctly
 
Who’s afraid of WinDbg
Who’s afraid of WinDbgWho’s afraid of WinDbg
Who’s afraid of WinDbg
 

Dernier

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 

Dernier (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 

Domain specific languages

  • 2. About.Me Software developer Blogger (http://blog.drorhelper.com) Language geek
  • 3. What do they mean? Bug Feature Release Candidate Show stopper “The next release candidate would contain features X, Y & Z and no more than 5 high priority Bugsandno show stoppers”
  • 4. Agenda Why should I use DSLs Domain Specific Languages Fluent interface
  • 5. Domain Specific Languages created specifically to solve problems in a particular domain Layer of abstraction on top of an existing domain model Can be used by domain experts
  • 6. DSL classification External vs. Internal Textual vs. Graphic
  • 8. External DSLs SELECTBook.title, count(*) ASAuthors FROMBook JOINBook_authorONBook.isbn = Book_author.isbnGROUPBYBook.title; <([A-Z][A-Z0-9]*)[^>]*>(.*?)</> buyIBM @ 100 forNOMURA sellGOOGLE @ limitprice= 70 for CHASE
  • 9. Internal DSLs Built on top of an existing language Use languages like Ruby, Python, BOO
  • 10.
  • 11.
  • 12. Fluent Interface design Hide your working. Keep your state to yourself. Think really hard about names. Take advantage of your implementation language. If you have them, blocks are you friends. Test first design can be a useful way of exploring what your interface should be. Reasonable defaults.
  • 13. Tips & Tricks Use Interfaces Return different interface to change functionality Generics are handy if user need to specify type Lambda and delegates for custom functionality
  • 14. Books DSLs in Action DSLs in Boo
  • 15. The shopping cart A Domain Specific exercise
  • 16. The Story You need to create a simple rule engine that would enable developers to add custom rules to the company’s Shopping cart application.
  • 17. The engine Three customer types: regular, preferred & VIP Customer the following fields: name address date of birth The system tracks the customer’s purchases (date, amount) Products can be on Sale (discount) Discount changes according to rules Each rule must have a customer type
  • 18. Usage examples A VIP customer get 15% discount on all purchases Buying product A would give you 10% discount on product B Preferred and VIP customers can buy 5 + 1 of a specific product All customers can get 20% off purchase using specific coupon If amount of purchase > 100$ customer is entitled for 10% discount. If customer have purchased > 100$ the last three months upgrade him to VIP On the customer’s birthday he’s entitled to 50% discount All customers living in New York can get up to 25% off all purchases

Notes de l'éditeur

  1. An internal DSL is one that uses the infrastructure of an existing programming language(also called the host language of the DSL) to build domain-specific semanticson top of it. One of the most popular internal DSLs used today is Rails, which is implementedon top of the Ruby programming language. When you write Rails code,you’re programming in Ruby, based on the semantics that Rails implements for developingweb applications. In most cases, an internal DSL is implemented as a library ontop of the existing host language.An external DSL is one that’s developed ground-up and has separate infrastructure forlexical analysis, parsing techniques, interpretation, compilation, and code generation.Developing an external DSL is similar to implementing a new language fromscratch with its own syntax and semantics. Build tools like make, parser generators likeYACC, and lexical analysis tools like LEX are examples of popular external DSLs.
  2. Fromhttp://en.wikipedia.org/wiki/Fluent_interface