51
An Extensible & Automated An Extensible & Automated World World Santosh Benjamin Santosh Benjamin VSX, Shell, GAX, DSL, Factories… VSX, Shell, GAX, DSL, Factories… oh my!! oh my!! [email protected] http://santoshbenjamin.wordpress.com

An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! [email protected]

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

An Extensible & Automated WorldAn Extensible & Automated World

Santosh BenjaminSantosh Benjamin

VSX, Shell, GAX, DSL, Factories…VSX, Shell, GAX, DSL, Factories…oh my!!oh my!!

[email protected]

http://santoshbenjamin.wordpress.com

Page 2: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

AgendaAgenda

VSX 101VSX 101

Guidance AutomationGuidance Automation

Domain Specific LanguagesDomain Specific Languages

Software FactoriesSoftware Factories

RoadmapRoadmap

ResourcesResources

Page 3: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

VSX – ‘Am I Bothered?’VSX – ‘Am I Bothered?’

IDEIDE– Vast, feature richVast, feature rich– A long journey from the old days (pre A long journey from the old days (pre

VS 6.0)VS 6.0)– Extensibility is crucial Extensibility is crucial

Not possible to fulfil every single Not possible to fulfil every single developer needdeveloper need

For DevelopersFor Developers– Extensibility allows you to fit the tool Extensibility allows you to fit the tool

(IDE) to the process(IDE) to the process

For ISVsFor ISVs– Extensibility allows you to make the Extensibility allows you to make the

tool (IDE) your platformtool (IDE) your platform

……thereforetherefore– We should be bothered !!!We should be bothered !!!

(The Catherine Tate Show)

Page 4: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

VSX OptionsVSX Options

VS User CustomizationVS User Customization

MacrosMacros

Add-InsAdd-Ins

PackagesPackages

Developer Developer ReachReach

Level of

Level of

inte

gra

tion

inte

gra

tion

Cost

of

Cost

of

inte

gra

tion

inte

gra

tion

Page 5: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Visual Studio TemplatesVisual Studio Templates

Project & Item templatesProject & Item templates– Reusable and customizable project and item stubsReusable and customizable project and item stubs– ““New Project” and “Add New Item” dialog boxesNew Project” and “Add New Item” dialog boxes– Can be used to provide starter kitsCan be used to provide starter kits– Accelerate the development processAccelerate the development process

Easy deployment: just a .zip fileEasy deployment: just a .zip file– Content files: source code files, embedded resources, project files, ...Content files: source code files, embedded resources, project files, ...– Metadata stored in a “.vstemplate” file (XML)Metadata stored in a “.vstemplate” file (XML)– Copy to a predefined folder (local or on the network)Copy to a predefined folder (local or on the network)

DEMODEMO– Out of the box templates & locationsOut of the box templates & locations– Creating and customizing a templateCreating and customizing a template

LimitationsLimitations– Capabilities are limited (templates are “dumb”)Capabilities are limited (templates are “dumb”)– Can be extended using IWizard interface to make them a little more dynamicCan be extended using IWizard interface to make them a little more dynamic

Page 6: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

The VS Automation ModelThe VS Automation Model

Automation object model contains >140 objects, Automation object model contains >140 objects, allowing control of the IDE from a solution level all the allowing control of the IDE from a solution level all the way to a single parameter of a single functionway to a single parameter of a single function

The LegacyThe Legacy– Old components never die – Old components never die –

they only get wrapped in layers and buried deepthey only get wrapped in layers and buried deep

The COM has not gone away The COM has not gone away In the old days the common interface was In the old days the common interface was IUnknownIUnknown (… (…and for most of us it is still not known and for most of us it is still not known ) )

Page 7: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

MacrosMacros

Macros can leverage nearly all of the features of the .NET Framework, as well Macros can leverage nearly all of the features of the .NET Framework, as well as most of the automation modelas most of the automation model

Macros accessed via Tools Macros accessed via Tools || Macros Macros

Macros have some limitationsMacros have some limitations– Macros can only be written in VB Macros can only be written in VB – Only source code distribution – no binariesOnly source code distribution – no binaries– Macros cannot be used to implement new tool windows, commands, Tools Options Macros cannot be used to implement new tool windows, commands, Tools Options

pagespages

Page 8: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Add-InsAdd-Ins

Add-Ins also leverage the automation model. Add-Ins also leverage the automation model.

Add-ins Add-ins cancan implement new tool windows, commands, Tools Options implement new tool windows, commands, Tools Options pagespages

Seamless addition into the IDE Seamless addition into the IDE

Choice of language (VB/ C# / C++) Choice of language (VB/ C# / C++)

Simple registration using XML ( no more COM registration )Simple registration using XML ( no more COM registration )

However, Add-ins cannot implement new document types, new project However, Add-ins cannot implement new document types, new project types, new debug engines, etc. which require a packagetypes, new debug engines, etc. which require a package

Page 9: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

WizardsWizards

In VS, wizards generally ask a series of questions that solicit input from a In VS, wizards generally ask a series of questions that solicit input from a user, and then use the results to generate code. user, and then use the results to generate code. Do not always have UI. Can be programmed to invisibly generate code Do not always have UI. Can be programmed to invisibly generate code behind the scenes. behind the scenes.

3 Types3 Types– New Project wizardsNew Project wizards —to generate new code for a particular type of project,. —to generate new code for a particular type of project,.– Add New Item wizardsAdd New Item wizards —to add new items, such as Web forms, text files, —to add new items, such as Web forms, text files,

HTML pages, XML pages, and so forth, to a project.HTML pages, XML pages, and so forth, to a project.– Custom wizardsCustom wizards— Called directly from add-ins, macros, or other types of — Called directly from add-ins, macros, or other types of

code. They may or may not display a UI. In either case, they generate code. code. They may or may not display a UI. In either case, they generate code. This type of wizard is used the least often.This type of wizard is used the least often.

IDTWizard IDTWizard – the ‘original’ one. Implemented using vsz files, HTML and – the ‘original’ one. Implemented using vsz files, HTML and script codescript code

IWizard IWizard – new kid on the block in VS05 and VS08. C# and VB project – new kid on the block in VS05 and VS08. C# and VB project systems primarily use this. VSTemplates are usually extended using systems primarily use this. VSTemplates are usually extended using IWizard.IWizard.

Page 10: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

PackagesPackages

Some users need more power and flexibility than what they get via macros, Some users need more power and flexibility than what they get via macros, add-ins and wizards. They may need custom editors and so on.add-ins and wizards. They may need custom editors and so on.

To achieve this level of integration, we need to write packagesTo achieve this level of integration, we need to write packages

Actually the VB, VC#, VC++ project systems are implemented as packages Actually the VB, VC#, VC++ project systems are implemented as packages on top of the basic “IDE shell”. on top of the basic “IDE shell”.

VS Packages are created using the Visual Studio SDK in any languageVS Packages are created using the Visual Studio SDK in any language

Page 11: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Package Extensibility PointsPackage Extensibility Points

IDEIDE– Project systems, Languages, Editors, Tool Windows,Project systems, Languages, Editors, Tool Windows,

– .NET Designers, Menus & Commands, Toolbox Integration, Tools .NET Designers, Menus & Commands, Toolbox Integration, Tools Options Page, Property BrowserOptions Page, Property Browser

– Help Integration, Setup and DeploymentHelp Integration, Setup and Deployment

DebuggerDebugger– Custom Debug Engine, Expression Evaluators , Type VisualizersCustom Debug Engine, Expression Evaluators , Type Visualizers

Source ControlSource Control– Project systems enabled to participate in source controlProject systems enabled to participate in source control– Source Control Provider ( Plug-in or Package )Source Control Provider ( Plug-in or Package )

Data SourcesData Sources– Design-time Data Source Drag-n-DropDesign-time Data Source Drag-n-Drop– Data Source ProviderData Source Provider

……. and more. and more

Page 12: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Visual Studio SDKVisual Studio SDK

A developer suite, framework /platform that allows you to achiever finer A developer suite, framework /platform that allows you to achiever finer control and deeper access into the IDE control and deeper access into the IDE

With this, we now get access to the same interfaces and internals of the With this, we now get access to the same interfaces and internals of the platform as the teams who write the IDE itself. platform as the teams who write the IDE itself.

Key ConceptsKey Concepts

– Experimental HiveExperimental HiveThe SDK creates the separate registry hive to do prototyping workThe SDK creates the separate registry hive to do prototyping workSamples auto-register in Experimental HiveSamples auto-register in Experimental HiveThe new SDK enables a “reset all” for the experimental hiveThe new SDK enables a “reset all” for the experimental hive

– DLK and PLKDLK and PLKDevelopers use the Developer License Key, provided with the SDKDevelopers use the Developer License Key, provided with the SDKShipping requires Package Load KeyShipping requires Package Load KeyIf you distribute your package to other developers without a PLK, then they need to have If you distribute your package to other developers without a PLK, then they need to have the SDK to run it.the SDK to run it.

– Setup and DeploymentSetup and DeploymentFinal product needs to author a setup and deployment project that handles:Final product needs to author a setup and deployment project that handles:

– Presenting your company EULAPresenting your company EULA– Install & RegistrationInstall & Registration

Page 13: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Your Managed Package

Package ArchitecturePackage Architecture

Visual Studio 2005 is the platformVisual Studio 2005 is the platformNative Interfaces provide extensibility Native Interfaces provide extensibility pointspointsInterop Assemblies enable managed Interop Assemblies enable managed code accesscode access

Visual Studio 2005

Native Interfaces

MPF 8.0

SDK ProvidesSDK Provides– Native Interface IDLsNative Interface IDLs– Interop AssembliesInterop Assemblies– Samples, Doc, templates, etcSamples, Doc, templates, etc– Package WizardPackage Wizard

Interop Assemblies

Your Native Packageoror

Page 14: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

The Visual Studio ShellThe Visual Studio Shell

A streamlined IDE on which you can build tools etc for specific A streamlined IDE on which you can build tools etc for specific markets (like Eclipse). markets (like Eclipse).

The shell has always been there (in VS2005 it was referred to as The shell has always been there (in VS2005 it was referred to as Premier Partner Edition) but not as a separate product with its own Premier Partner Edition) but not as a separate product with its own identity as it is now.identity as it is now.

Integrated Mode: Integrated Mode: – Optimized for programming languages (e.g.) Iron Python)Optimized for programming languages (e.g.) Iron Python)– Applications built on the integrated Shell will automatically merge with Applications built on the integrated Shell will automatically merge with

any other editions of Visual Studio installed on the same machine. any other editions of Visual Studio installed on the same machine.

Isolated ModeIsolated Mode– Optimized for specialised tools (e.g.) Optimized for specialised tools (e.g.) Storyboard DesignerStoryboard Designer– Applications built with the isolated Shell will run side-by-side with any Applications built with the isolated Shell will run side-by-side with any

other editions of Visual Studio installed on the same machine. other editions of Visual Studio installed on the same machine.

Page 15: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Extensibility Map - SummaryExtensibility Map - Summary

Type Benefits Limitations

CustomizationIDE / VS Templates

Simple Cannot control IDE, can only customize

Macros Full control of IDE –leverage automation model and framework

Cannot add featuresProvided in source•Only written in VB

Add-ins Full control of IDE Compiled for performance and protection of sourceSimple registrationCan implement :

•new tool windows, •commands, •Tools Options pages

Cannot implement:•new document types, •new project types, •new debug engines,

Packages Full control of IDECompiled for performance and protection of sourceFull ability to add new features

Complex development model

Page 16: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

VSX In Action - DemosVSX In Action - Demos

MacroMacro

Add-In Add-In

Add-In with WizardAdd-In with Wizard

SDK – Tool Window SDK – Tool Window

Page 17: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

AgendaAgenda

VSX 101VSX 101

Guidance AutomationGuidance Automation

Domain Specific LanguagesDomain Specific Languages

Software FactoriesSoftware Factories

RoadmapRoadmap

ResourcesResources

Page 18: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Guidance Automation 101 – What’s the big deal?Guidance Automation 101 – What’s the big deal?

We all have good intentionsWe all have good intentions– We want a consistent way of developing softwareWe want a consistent way of developing software

– We want our teams to share and follow standards and good practicesWe want our teams to share and follow standards and good practices

So what’s the problem?So what’s the problem? Doh!Is that the

architecture standards document?

!!!

‘Size’ is only 1 problem.

Arguably the more pressing problem is that its passive.

And we all know how enthusiastic we are about reading through tons of info to get to the part we want (especially if it was written by someone else )

Pages and pages of ‘guidelines’

What we need is a way to make all this carefully (sometimes painstakingly) collected material available at the point of need and even better, make it actually “executable”.

Page 19: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Enter Enter Guidance Automation Guidance Automation

The AimThe Aim– Make reusable code and pattern assets available in Visual StudioMake reusable code and pattern assets available in Visual Studio– Integrate reusable code into applicationsIntegrate reusable code into applications– Guide developers through complex proceduresGuide developers through complex procedures

Built and used by Microsoft patterns & practicesBuilt and used by Microsoft patterns & practices– Built upon Visual Studio SDKBuilt upon Visual Studio SDK– Used extensively in their various “Software Factories” Used extensively in their various “Software Factories”

Page 20: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Guidance Life CycleGuidance Life Cycle

Only the package author needs GAT. The package user (usually a developer) only needs GAX to run the package and produce source code.

The end product of all this is source code. The end user only sees a web app or winforms app and doesn’t care how it was built. There are NO runtime library requirements for the end user.

Page 21: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

GAT – The Key ElementsGAT – The Key Elements

RecipesRecipes Recipes automate activities that developers would usually Recipes automate activities that developers would usually perform manually, often by following a series of instructionsperform manually, often by following a series of instructions ..

ActionsActions Actions are atomic units of work called in a defined sequence by Actions are atomic units of work called in a defined sequence by recipes. The sequence is specified in the recipe definition.recipes. The sequence is specified in the recipe definition.

““T4” templatesT4” templates A Text Template Transformation Toolkit (T4) template consists A Text Template Transformation Toolkit (T4) template consists of a combination of text and scriptlets (expressions in VB/C# of a combination of text and scriptlets (expressions in VB/C# evaluated at runtime)evaluated at runtime)

WizardsWizards Wizards are value gathering strategies used to gather values Wizards are value gathering strategies used to gather values from recipe arguments. .from recipe arguments. .

Type ConvertersType Converters Type converters validate the value of a field and convert them Type converters validate the value of a field and convert them from their user interface representation to a type representationfrom their user interface representation to a type representation

VS TemplatesVS Templates GAT allows you to associate these with recipes to make GAT allows you to associate these with recipes to make solution/project/item generation very parameterisedsolution/project/item generation very parameterised

Page 22: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Demo – GAT In ActionDemo – GAT In Action

Using the Web Service Software Factory (Dec 2006 Refresh)Using the Web Service Software Factory (Dec 2006 Refresh)

Inspecting the internals of the Service Factory Inspecting the internals of the Service Factory

Page 23: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Building A Guidance PackageBuilding A Guidance Package

So how would you build one of those things? So how would you build one of those things?

A Guidance Package is a VS solution with a specific layout and A Guidance Package is a VS solution with a specific layout and some specific artefacts in it. It is not trivial to build and easy to get some specific artefacts in it. It is not trivial to build and easy to get wrong.wrong.

To make things easier we have a “Meta Package” – a “package To make things easier we have a “Meta Package” – a “package package” package”

Page 24: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Building a GP - DemoBuilding a GP - Demo

Using the out of the box Meta PackageUsing the out of the box Meta Package

Using the Clarius Meta-factory (part of Software Factories Toolkit) Using the Clarius Meta-factory (part of Software Factories Toolkit) – Enhances the VS out of the box GP with an enhanced structure & Enhances the VS out of the box GP with an enhanced structure &

compilation settings, compilation settings,

– more context driven recipes and visual elements more context driven recipes and visual elements

– Some advanced techniques such as GAX Scripting Some advanced techniques such as GAX Scripting

– Provides a much better authoring experienceProvides a much better authoring experience

Page 25: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

VSX, SDK and GATVSX, SDK and GAT

VSX (vs.) GAX VSX (vs.) GAX – Without VSX there would be no GAT Without VSX there would be no GAT – GAX/GAT is a vertical application of VSX for a specific purpose GAX/GAT is a vertical application of VSX for a specific purpose – With VSX you can build tools & products that have nothing to do with GAX/GAT.. With VSX you can build tools & products that have nothing to do with GAX/GAT..

but then while building the tools GAT can help!!but then while building the tools GAT can help!!

GAT meets the SDKGAT meets the SDK– SDK has a steep learning curveSDK has a steep learning curve– GAX driven tooling allows a streamlined approach to developing with the SDKGAX driven tooling allows a streamlined approach to developing with the SDK– ExamplesExamples

VSSDKAssistVSSDKAssist Factory Factory – allows us to create, configure, deploy and test various items – allows us to create, configure, deploy and test various items such as Commands, Services, ToolWindows, Custom projects etcsuch as Commands, Services, ToolWindows, Custom projects etc

VSShellAssistVSShellAssist Factory Factory – allows us to create, configure and test shell setup projects, – allows us to create, configure and test shell setup projects, load keys, splash screens etc load keys, splash screens etc

Page 26: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Some Best Practices for GAT*Some Best Practices for GAT*

Use GAT whenUse GAT when– You have a specific problem with a specific solution thatYou have a specific problem with a specific solution that

Is automatableIs automatableMust be executed multiple timesMust be executed multiple timesHas a development time or risk that is too high to do manuallyHas a development time or risk that is too high to do manually

– You can’t use “dumb” Visual Studio TemplatesYou can’t use “dumb” Visual Studio Templates– You want to prepare for building a Software FactoryYou want to prepare for building a Software Factory

Do not use GAT whenDo not use GAT when– You will use the Guidance Package only once – everYou will use the Guidance Package only once – ever– You can’t/don’t want to invest time in the learning curveYou can’t/don’t want to invest time in the learning curve– You just think it’s coolYou just think it’s cool

* Jelle Druyts – Deep Dive into GAT

Page 27: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Authoring Guidance Packages Authoring Guidance Packages **

There is a learning curve *There is a learning curve *– Do not involve everyoneDo not involve everyone– Make 1 person/team responsible for GATMake 1 person/team responsible for GAT– Once the knowledge is there, investment pays off quicklyOnce the knowledge is there, investment pays off quickly

Don’t try to build everything at once *Don’t try to build everything at once *– Start automating simple scenariosStart automating simple scenarios– Incrementally increase complexityIncrementally increase complexity– Add templates, logic and guidance along the wayAdd templates, logic and guidance along the way

Borrow / Reuse / steal !!Borrow / Reuse / steal !!– Don’t reinvent the wheel Don’t reinvent the wheel – Most of the factories have source code and that’s available for non commercial Most of the factories have source code and that’s available for non commercial

reuse in your own stuff (check the license carefully)reuse in your own stuff (check the license carefully)– At the very least you can see how someone else has implemented a similar idea At the very least you can see how someone else has implemented a similar idea

to yours. to yours. – The Guidance Extensions Library (GEL) contains a collection of recipes, actions The Guidance Extensions Library (GEL) contains a collection of recipes, actions

etc used by P&P Factories and made available for us to use etc used by P&P Factories and made available for us to use

* Jelle Druyts – Deep Dive into GAT

Page 28: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

AgendaAgenda

VSX 101VSX 101

Guidance AutomationGuidance Automation

Domain Specific LanguagesDomain Specific Languages

Software FactoriesSoftware Factories

RoadmapRoadmap

ResourcesResources

Page 29: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Domain Specific LanguagesDomain Specific Languages

Domain-Specific Languages (DSLs) typically are small, highly focused Domain-Specific Languages (DSLs) typically are small, highly focused languages used to model and solve some clearly identifiable problems languages used to model and solve some clearly identifiable problems which an analyst, architect, developer, tester, or system administrator which an analyst, architect, developer, tester, or system administrator must handlemust handle. .

Some examples of traditional DSLs: Some examples of traditional DSLs: – SQL for data manipulation, SQL for data manipulation, – XSD for XML document-structure definition, etcXSD for XML document-structure definition, etc

How does it apply to us? How does it apply to us? – Most teams can talk about their software in very ‘team specific lingo’ – Most teams can talk about their software in very ‘team specific lingo’ –

using specific names for recurring types of components, patterns. using specific names for recurring types of components, patterns.

– The area the team works in is their “domain” and the terminology forms The area the team works in is their “domain” and the terminology forms their “language”. their “language”.

– There is now technology available in this area for us to build on. There is now technology available in this area for us to build on.

Page 30: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

DSL’s – The Visual ElementDSL’s – The Visual Element

Just being able to use a DSL will help teams get more consistency in Just being able to use a DSL will help teams get more consistency in system design and implementation. system design and implementation.

A DSL does not have to be visual. However, being able to put a ‘face’ to A DSL does not have to be visual. However, being able to put a ‘face’ to these things (if possible) helps in understanding and communicating the these things (if possible) helps in understanding and communicating the system better system better

Some teams use custom Visio stencils and some go a step further and use Some teams use custom Visio stencils and some go a step further and use the Visio automation model to generate code from the stencils, generate the Visio automation model to generate code from the stencils, generate documentation and so on. documentation and so on.

But there is no common framework around Visio code generation nor a But there is no common framework around Visio code generation nor a platform to make things easier platform to make things easier

This is where This is where “DSL Tools for Visual Studio”“DSL Tools for Visual Studio” comes in comes in

Page 31: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

DSL Tools For VSDSL Tools For VS

– Domain-Specific Language Tools allow Visual Studio 2005 developers Domain-Specific Language Tools allow Visual Studio 2005 developers to create their own graphical designers and code generation tools like to create their own graphical designers and code generation tools like the ones you find in Visual Studio today, such as the Class Designer, the ones you find in Visual Studio today, such as the Class Designer, Application Designer etc. Application Designer etc.

– Using DSL Tools, designers can Using DSL Tools, designers can specify the domain model (semantics) for a new language; specify the domain model (semantics) for a new language;

create a custom graphical editor that uses a domain-specific diagram create a custom graphical editor that uses a domain-specific diagram notation (syntax); and notation (syntax); and

construct custom text templates that use models created using the graphical construct custom text templates that use models created using the graphical editor, to generate source code and other files. editor, to generate source code and other files.

Page 32: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

DSL’s examples…(1)DSL’s examples…(1)

Service Factory Modelling Edition Service Factory Modelling Edition – Service Contract Model, Data Contract Model, Host ModelService Contract Model, Data Contract Model, Host Model

Page 33: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

DSL examples…(2)DSL examples…(2)

VS Team Architect VS Team Architect – Application Designer , Logical Data Center DesignerApplication Designer , Logical Data Center Designer

VS Team DeveloperVS Team Developer– Class DesignerClass Designer

Biztalk Biztalk – Orchestration Designer, Pipeline Component DesignerOrchestration Designer, Pipeline Component Designer

WFWF– Workflow DesignerWorkflow Designer

Page 34: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

DSL vs UMLDSL vs UML

UML is very general purpose. It can be considered as a DSL but the domain would be UML is very general purpose. It can be considered as a DSL but the domain would be the whole of software development.the whole of software development.

The focus of a typical DSL is much narrower. It picks on specific verticals and The focus of a typical DSL is much narrower. It picks on specific verticals and (sometimes) specific types of applications in that vertical (sometimes) specific types of applications in that vertical

Some might argue that you could achieve similar results with “UML Stereotypes” but Some might argue that you could achieve similar results with “UML Stereotypes” but that’s quite hard and tooling is not easily available to translate those stereotyped that’s quite hard and tooling is not easily available to translate those stereotyped models into your specific code AND back againmodels into your specific code AND back again

Steve Cook , a leading DSL proponent, was on the IBM board that worked on the Steve Cook , a leading DSL proponent, was on the IBM board that worked on the standardisation of UML so he is definitely an authority on what it can and cant do standardisation of UML so he is definitely an authority on what it can and cant do

However UML hasn’t gone away and it isn’t going away. However UML hasn’t gone away and it isn’t going away.

The Class Designer extends the familiar UML notation to accommodate things that The Class Designer extends the familiar UML notation to accommodate things that are unique to .NET classes (attributes etc). Some new tools in “Rosario” will allow are unique to .NET classes (attributes etc). Some new tools in “Rosario” will allow architects to reverse engineer code into sequence diagrams and other visualizations architects to reverse engineer code into sequence diagrams and other visualizations that will have many UML elements in it. that will have many UML elements in it.

Page 35: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

AgendaAgenda

VSX 101VSX 101

Guidance AutomationGuidance Automation

Domain Specific LanguagesDomain Specific Languages

Software FactoriesSoftware Factories

RoadmapRoadmap

ResourcesResources

Page 36: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

““A Software Factory is a software product line that configures A Software Factory is a software product line that configures extensible tools, processes and content using a software factory extensible tools, processes and content using a software factory template based on a software factory schema to automate the template based on a software factory schema to automate the development and maintenance of variants of an archetypical product development and maintenance of variants of an archetypical product by adapting, assembling and configuring framework-based by adapting, assembling and configuring framework-based components.” components.”

JJack Greenfield, Keith Short, Software Factoriesack Greenfield, Keith Short, Software Factories

What is a Software Factory?What is a Software Factory?

The ‘easy’ definition (PnP)The ‘easy’ definition (PnP)““A software factory is a structured collection of related software assets. When a A software factory is a structured collection of related software assets. When a software factory is installed in a development environment, it helps architects and software factory is installed in a development environment, it helps architects and developers predictably and efficiently create high-quality instances of specific developers predictably and efficiently create high-quality instances of specific types of applications.”types of applications.”

The ‘Official’ Definition

Page 37: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

A A ‘Tool’‘Tool’, to , to automate the assembly automate the assembly and configuration of solutions and configuration of solutions addressing a addressing a specific, understood problem domainspecific, understood problem domain

Runs within, and Runs within, and integrates with, integrates with, Microsoft Visual StudioMicrosoft Visual Studio

Uses models, designers, editors, wizards, etc., to Uses models, designers, editors, wizards, etc., to provideprovide abstractions abstractions of the solution domainof the solution domain

Outputs Outputs mostly generated solution mostly generated solution (product) that may require manual (product) that may require manual customizing to completecustomizing to complete

Also contains executables, readables, reusables.Also contains executables, readables, reusables.

In more concrete terms….*In more concrete terms….*

* Build Your Own Software Factories – Jezz Santos, Edward Bakker

Page 38: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

• GAX/GAT available from patterns & practices : All other tools available in Visual Studio SDK

What would we build it with ? *What would we build it with ? *

* Build Your Own Software Factories – Jezz Santos, Edward Bakker

Page 39: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Its like an umbrella…Its like an umbrella…

This SF approach brings in all the good stuffThis SF approach brings in all the good stuff– Patterns Patterns

– GuidesGuides

– Guidance Automation Guidance Automation

– Domain Specific LanguagesDomain Specific Languages

..and puts them all under one roof..and puts them all under one roof

Page 40: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

DemoDemo

Service Factory Modelling Edition Service Factory Modelling Edition

– Service Contract ModelService Contract Model

– Data Contract ModelData Contract Model

– Host ModelHost Model

Page 41: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Factories.. Things to remember *Factories.. Things to remember *

Solutions that are going to be modelled in the factory should be built Solutions that are going to be modelled in the factory should be built before the factory itself is built. before the factory itself is built.

Keep in mind that the factory-building process will take two to three Keep in mind that the factory-building process will take two to three times longer than a one-off product such as building a Web service times longer than a one-off product such as building a Web service from scratch. from scratch.

Finally, keep in mind that ROI will not come until the factory has Finally, keep in mind that ROI will not come until the factory has been put to use at least three times.been put to use at least three times.

* Build Your Own Software Factories – Jezz Santos, Edward Bakker

Page 42: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Demo …. outcomeDemo …. outcome

So what have we seen? So what have we seen?

– The DSL approach provides a higher level of abstractionThe DSL approach provides a higher level of abstraction

– This itself gives the Service Factory more value than its previous incarnation This itself gives the Service Factory more value than its previous incarnation which could be considered as “code generation on steroids”. which could be considered as “code generation on steroids”.

Page 43: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Factories…. Just the beginning Factories…. Just the beginning

What we have seen isn’t all there is to software factories… in fact its just the What we have seen isn’t all there is to software factories… in fact its just the beginningbeginning

The P&P software factories (esp Service Factory) are now moving in the The P&P software factories (esp Service Factory) are now moving in the right direction with the DSL abstraction over code generation and the in-right direction with the DSL abstraction over code generation and the in-context guidancecontext guidance

But in reality we are only scratching the surface of Software Factories as But in reality we are only scratching the surface of Software Factories as envisioned by Jack Greenfield and others. envisioned by Jack Greenfield and others.

There are advanced things like the “Software Factory Schema” , Software There are advanced things like the “Software Factory Schema” , Software Product Lines and so on.Product Lines and so on.

Page 44: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Any feelings of “déjà vu”…?Any feelings of “déjà vu”…?

A common criticism is that this like the 80’s all over again with respect to CASE ToolsA common criticism is that this like the 80’s all over again with respect to CASE Tools

As with UML , the key players here have “been there, done that”.As with UML , the key players here have “been there, done that”.

Software Factories now takes a more modular approach than the top down process Software Factories now takes a more modular approach than the top down process heavy approach that was seen with the CASE tools. You can pick and choose what heavy approach that was seen with the CASE tools. You can pick and choose what suits your development approach best and the tooling does NOT try to dictate the suits your development approach best and the tooling does NOT try to dictate the process. process.

Examples: Even in the area of “layered” VS solutions, the WSSF allows you to have a Examples: Even in the area of “layered” VS solutions, the WSSF allows you to have a single project for everything if you don’t want 8 separate assemblies. Again, you can single project for everything if you don’t want 8 separate assemblies. Again, you can use just the service interface models and do everything else in your own way , or just use just the service interface models and do everything else in your own way , or just use the Repository Factory to control the data layer and do the rest yourself. use the Repository Factory to control the data layer and do the rest yourself.

So no, its not CASE all over again.So no, its not CASE all over again.

But if you’re a die-hard cynic , perhaps it would be best to wait and watch!! But if you’re a die-hard cynic , perhaps it would be best to wait and watch!!

Page 45: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

AgendaAgenda

VSX 101VSX 101

Guidance AutomationGuidance Automation

Domain Specific LanguagesDomain Specific Languages

Software FactoriesSoftware Factories

RoadmapRoadmap

ResourcesResources

Page 46: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

RoadmapRoadmap

Visual Studio (& Team System) Visual Studio (& Team System) – In Rosario, Hawaii and beyond , Factories are going to be baked into the product.In Rosario, Hawaii and beyond , Factories are going to be baked into the product.

Edward Bakker has some posts on how this manifests itself in RosarioEdward Bakker has some posts on how this manifests itself in Rosario

– ““Team Factories” – from the initiation of the project on TFS, through to work item Team Factories” – from the initiation of the project on TFS, through to work item allocation, code generation, testing and maintenance. allocation, code generation, testing and maintenance.

Service FactoryService Factory– Guidance to encompass Biztalk, WCF, WF, Astoria etc (will start as documented Guidance to encompass Biztalk, WCF, WF, Astoria etc (will start as documented

guidance and may eventually become full fledged factories) guidance and may eventually become full fledged factories) – REST & RSS capabilitiesREST & RSS capabilities– Leverage Metadata repositoriesLeverage Metadata repositories

Page 47: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

AgendaAgenda

VSX 101VSX 101

Guidance AutomationGuidance Automation

Domain Specific LanguagesDomain Specific Languages

Software FactoriesSoftware Factories

RoadmapRoadmap

ResourcesResources

Page 48: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Resources …(1)Resources …(1)

BooksBooks– Software FactoriesSoftware Factories (2004) - (2004) - Jack Greenfield, Keith ShortJack Greenfield, Keith Short – Working With Visual Studio 2005 Working With Visual Studio 2005 – – Johnson, Skibo, YoungJohnson, Skibo, Young– Professional Visual Studio Extensibility Professional Visual Studio Extensibility (2008) - (2008) - Keyvan NayeriKeyvan Nayeri

VSX ArticlesVSX Articles– VS Templates VS Templates and and Starter KitsStarter Kits– Developing Visual Studio Wizards (Developing Visual Studio Wizards (IWizardIWizard))

GAX/GAT ArticlesGAX/GAT Articles– Introduction to GAT (MSDN) Introduction to GAT (MSDN) – Guidance Automation Series (Guidance Automation Series (JelleJelle DruytsDruyts))

Blogs (Hall Of Fame)Blogs (Hall Of Fame)– VSX: Carlos QuinteroVSX: Carlos Quintero– SF: SF: Jezz Santos Jezz Santos , , Edward Bakker Edward Bakker , , JelleJelle DruytsDruyts , , – ClariusClarius Blogs Blogs : : Pablo Pablo GalianoGaliano, , Victor GarciaVictor Garcia, , Daniel Daniel CazzulinoCazzulino

NewsgroupsNewsgroups– MSDN Forums (VSX, GAT) MSDN Forums (VSX, GAT)

Page 49: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Resources …(2)Resources …(2)

Webcasts & VideosWebcasts & Videos– Deep Dive into GAT Deep Dive into GAT – Jelle Druyts MSDN Belux– Jelle Druyts MSDN Belux– Packaging Design and Architecture GuidancePackaging Design and Architecture Guidance– Introduction to Service FactoryIntroduction to Service Factory– Build Your Own Software Factory (EMEA Spotlight TechEd 07)Build Your Own Software Factory (EMEA Spotlight TechEd 07)– Visual Studio DSL Tools – Stuart KentVisual Studio DSL Tools – Stuart Kent

SoftwareSoftware– GAX (Feb 08) and GAT (Feb 08) GAX (Feb 08) and GAT (Feb 08)

FactoriesFactories– Web Service SF , Web Client SF, Repository FactoryWeb Service SF , Web Client SF, Repository Factory– Smart Client SF, Ent Lib 3.1 Application Block Software FactorySmart Client SF, Ent Lib 3.1 Application Block Software Factory– Biztalk Solution FactoryBiztalk Solution Factory

MiscMisc– My blog – starting a series on GAT shortlyMy blog – starting a series on GAT shortly

Page 50: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

SummarySummary

Visual Studio is highly extensible and can now justifiably be considered Visual Studio is highly extensible and can now justifiably be considered more than just an IDE , it is a tools platform. This is a good time to start more than just an IDE , it is a tools platform. This is a good time to start getting into the field of VS extensibility. getting into the field of VS extensibility.

Guidance Automation leverages the extensibility of VS to allow us to Guidance Automation leverages the extensibility of VS to allow us to – Leverage common best practices in an executable formLeverage common best practices in an executable form– provide ‘active’ guidance to development teams provide ‘active’ guidance to development teams

DSL Tools provide us a platform to build visual languages and link into code DSL Tools provide us a platform to build visual languages and link into code generation etcgeneration etc

Software Factories bring everything together to help us along the road to a Software Factories bring everything together to help us along the road to a higher level of consistency and accuracy in software development. higher level of consistency and accuracy in software development.

Page 51: An Extensible & Automated World Santosh Benjamin VSX, Shell, GAX, DSL, Factories… oh my!! santosh.benjamin@yahoo.com

Q & AQ & A