12
Using PowerShell as DSL in .Net applications Joy George K Jr.Architect, Orion India Systems www. joymononline.in , [email protected]

Using PowerShell as DSL in .Net applications

  • Upload
    joy-k

  • View
    745

  • Download
    0

Embed Size (px)

DESCRIPTION

The slide explains about what is DSL? Types of DSL such as external and internal.How to select a DSL for our project ? Pros and Cons of DSL in software. How to use PowerShell as DSL in .Net applications

Citation preview

Page 1: Using PowerShell as DSL in .Net applications

Using PowerShell as DSL in .Net applications

Joy George K

Jr.Architect, Orion India Systems

www.joymononline.in , [email protected]

Page 2: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net– What is DSL?

A computer language that's targeted to A particular kind of problem, rather than A general purpose language that's aimed at any kind of software problem. Domain specific languages have been talked about, and used for almost as long as computing has been done.

Martin fowler

Page 3: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net – What can be DSL

• Excel macros• SQL• CSS• RegEx• .Bat files

Page 4: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net – Why its needed?

• Make the users as programmers.• Tackle ever changing requirements• Easy maintainability• Extensibility ?• …

Page 5: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net– Internal & External

• Internal• Uses existing special language constructs to achieve• Fluid API

• eg : Linq (entries.Where(e => e.Approved) .OrderBy(e => e.Rating)

.FirstOrDefault())• External

• Uses different language• Special parsers

Page 6: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net – Arch

DSL EngineCore app

Files

Objects and DSL script

Return objectsAlter objects, prepare result

DSL

Page 7: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net – Selecting my DSL

• Internal v/s external• If External

• Creating custom parser, compilers• Leverage existing scripting languages

Page 8: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net - Demo

• External DSL• PowerShell as DSL scripting language

• Inbuilt in Windows vista onwards• Pipeling support which helps to write less

Page 9: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net – Pros and Cons

• Pros• Easy customization / extensibility.• Relief from frequent requirement changes.

• Cons• Performance• Maintenance overhead, if its external own DSL• No auto completion

Page 10: Using PowerShell as DSL in .Net applications

PowerShell as DSL in .Net – Referenceshttp://martinfowler.com/books/dsl.htmlhttp:// joymonscode.blogspot.in/2013/01/what-is-domain-specific-language-dsl-in.html

http:// joymonscode.blogspot.in/2013/01/dsl-demo-first-c-application-which-uses.html

DSLs in Action by Debasish Ghosh

Page 11: Using PowerShell as DSL in .Net applications

Are you ready to try DSL in your project ?

PowerShell as DSL in .Net – Q & A

Page 12: Using PowerShell as DSL in .Net applications

Thank YouJoy George K

Jr.Architect, Orion India Systems

[email protected]