Presentation is loading. Please wait.

Presentation is loading. Please wait.

Domain-Specific Development Stuart Kent, Senior Program Manager, DSL Tools, Visual Studio Team System, Microsoft.

Similar presentations


Presentation on theme: "Domain-Specific Development Stuart Kent, Senior Program Manager, DSL Tools, Visual Studio Team System, Microsoft."— Presentation transcript:

1 Domain-Specific Development Stuart Kent, Senior Program Manager, DSL Tools, Visual Studio Team System, Microsoft

2 Domain-Specific Development Pattern Model Fixed Part Abstraction of the variable part, expressed in a Domain-Specific Language Framework, API, Interpreter … Hand-crafted Generate, interpret, some of each Integrate

3 Contents Domain-Specific Development Pattern Demo 1 – Wizard UIP example DSD in Software Factories Domain-Specific Languages (DSLs) Integration: Generation versus Interpretation from/of models Costs & benefits of the DSD approach DSL Tools in Visual Studio Demo 2 – Building and deploying a DSL Release schedule Difference between Feb CTP and V1 Follow-up session

4 Demo 1 – Wizard User Interaction Process Model Fixed Part Integrate Expressed in Graphical Page Flow DSL UIP framework Windows Forms Additional control logic code added Generate: Some control logic code Starter UI Config file that’s interpreted

5 07713248 call Call Record call length  base rate: £/s store Architecture Framework, Components Process and roles Tools Patterns DSD Is Part of Software Factories Libraries Domain-Specific languages Test suites Models Method & procedures Templatizing … … …Templatizing … … … Guidelines

6 Reminder – DSD Pattern Model Fixed Part Abstraction of the variable part, expressed in a Domain-Specific Language Framework, API, Interpreter … Hand-crafted Generate, interpret, some of each Integrate

7 Domain-Specific Language Classification Horizontal GUI web business logic database deployment Vertical telephone bills insurance ticketing hardware construction Domain-Specific Language general purpose specific next slide …

8 Parts of a DSL Domain Model + validation

9 Reminder – DSD Pattern Model Fixed Part Abstraction of the variable part, expressed in a Domain-Specific Language Framework, API, Interpreter … Hand-crafted Generate, interpret, some of each Integrate

10 What does ‘Integrate’ Mean? Generate Generate code that talks to framework APIs E.g. completely new classes Generate code that completes a framework E.g. C# partial classes Interpret The model file itself or some data pushed into a live environment from the model (e.g. xml configuration file, data in a database) is interpreted A Combination of the above Easier to produce initially More customisation options Behaviour can be changed at run-time Fewer artifacts to keep in sync

11 Customisation (1) What? Customise/extend the behaviour expressed by the model + fixed part Why? However good the fixed part, not every point of variability will have been predicted Some things (e.g. complex logic) are just easier to express in code – avoids reinventing programming languages in a DSL There will be undiscovered bugs in the code generators / interpreter / framework which need to be fixed somehow DSL Area customisation

12 Customisation (2) DSL Area Customisation step Expert customisation step Platform customisation Hand crafted code for specific plug-points Change the code generators Change the framework customisation

13 Customisation (2) DSL Area Customisation step Expert customisation step Platform customisation Hand crafted code for specific plug-points Change the code generators Change the framework Interpretation Generation

14 Domain-Specific Development – Cost / Benefit Benefits Fewer copies of the same code to maintain Fix bug in code generators or framework fixes for all Change in requirements (e.g. business rules) = change in model Change in technology = change in code generators / framework Better communication with stakeholders Cost Creating/maintaining the DSL / code generators / framework potentially across many projects and versions Model Fixed Part Integrate Goal of Microsoft DSL Tools is to bring down this cost

15 DSL Tools in Visual Studio What? Tools for authoring and deploying DSLs and template- based text artefact (e.g. code) generators Where? Now installed as part of the Visual Studio SDK http://msdn.microsoft.com/vstudio/extend/ Also see http://msdn.microsoft.com/vstudio/DSLTools/

16 Reminder – Parts of a DSL Domain Model + validation DSL Tools V1

17 Designer for a DSL in Visual Studio

18 Domain Model Framework Design Surface Framework Shell Framework Templating Engine Validation F’work DSL Tools – Modeling Platform In-memory graph database with rich services (e.g., transactions, serialisation, rules …) Extensible drawing surface with support for routing and auto-layout Artefact generation Checks constraints and guides user to resolve issues Visual Studio UI integration for components like toolbox, menus, properties grid, explorer

19 DSL Tools – Architecture of a Designer Domain Model Framework Design Surface Framework generated domain classes generated shapes Shell Framework generated serialisers Templating Engine generated directive processor generated shell code generated shape 2 class mappings text templates DSL Definition generate hand-crafted designer extensions Validation F’work hand- coded validation logic

20 A DSL for Activities Apply for pre-approved Loan Setup on-line account for customer Create credit check report Accepted Rejected

21 Defining a DSL, Step 1: Define Domain Model Apply for pre-approved Loan Setup on-line account for customer Create credit check report

22 Defining a DSL, Step 2: Define Notation Apply for pre-approved loan Rounded Rectangle Outline color: orange Outline color: orange Fill color: white Fill color: white Text Decorator Position: Centre Position: Centre Accepted Connector solid solid orange orange filled arrowhead filled arrowhead Text Decorator Position: Source, bottom Position: Source, bottom

23 Apply for pre-approved loan Defining a DSL, Step 3 Define visualisation of domain model via notation elements Shape Domain Model

24 Demo 2 – Building & Deploying a DSL

25 Contents Domain-Specific Development Pattern Demo 1 – Wizard UIP example DSD in Software Factories Domain-Specific Languages (DSLs) Integration: Generation versus Interpretation from/of models Costs & benefits of the DSD approach DSL Tools in Visual Studio Demo 2 – Building and deploying a DSL Release schedule Difference between Feb CTP and V1 Follow-up session

26 Release Schedule February 2006, part of VS SDK May 2006, V1 Release Candidate (as part of VS SDK CTP released in that month) August 2006, V1 RTM (as part of VS SDK V3 released in that month)

27 Differences between Feb CTP and V1 Cleaner APIs A single DSL definition format combines domain model and notation aspects more flexible mapping between notation and domain model A DSL Designer (edits the DSL definition format) Serialisation Domain-Specific serialisation format in XML forgiving, version aware reader Extra notation – ports & swimlanes Customisation more explicit customisation points called out generated code is easier to override Replace … with …

28 Follow-up Session Domain-Specific Languages Futures Led by Gareth Jones, Developer, DSL Tools At 12.00, after break, in Denbigh 1 (Workshop 2) Come and discuss the features you’d like to see in future versions of DSL Tools Please bring signed Design Preview Agreement form (blank forms are available if you haven’t got one)


Download ppt "Domain-Specific Development Stuart Kent, Senior Program Manager, DSL Tools, Visual Studio Team System, Microsoft."

Similar presentations


Ads by Google