Saturday, December 27, 2008

During the development of our Blueprints we can sometimes use a little extra help to understand what is really going on. It turns out that if we add a Registry setting called ‘EnableDeveloperFeatures’ under the ‘HKey_Local_Machine\Software\Microsoft\Blueprints’ key and set its value to ‘true’ we get a few extra features enabled in the Blueprint Manager that might help understand (debugging) Blueprints . In the screenshot below we can see the checkboxes that become visible after we have added the ‘EnableDeveloperFeatures’ setting to the Registry. The checkboxes are read only in the Blueprint Manager dialog but can be set through the Registry.

Settings

As we can see, the ‘Custom Menu Filter’ checkbox is checked which means custom menu filters are enabled by default for our Blueprints. We can disable this feature by adding a ‘DisableCustomMenuFilters’ setting under the ‘HKey_Local_Machine\Software\Microsoft\Blueprints’ key and set its value to ‘false’.

To enable logging in the Blueprint Manager we can add the ‘BPMLogging’ setting to the Registry and set its value to ‘true’.

In an earlier post I demonstrated how to create a custom menu filter. After adding a ‘MenuDebugging’ setting to the Registry and set its value to ‘true’ we can see that Blueprint Manager now logs (output window) that it actually detects the custom menu filter that we created and also determines if it should be visible or not.

Log

Hopefully, enabling these features help a little during the development of your Blueprints…

posted on 12/27/2008 10:24:13 PM UTC  #    Comments [0]
 Tuesday, December 23, 2008

For some (experimental) work that I am currently doing with Clemens we needed a version of Blueprints that installs on the current VS 2010 CTP. I am sure every developer already knows how to modify an .MSI package by using ‘Orca’ (part of Windows SDK) so I am not going to explain in detail how to do that. However, the good news is, that if we open the Blueprints 2.1.2 CTP in Orca, replace every occurrence of ‘Visual Studio 9.0’ by ‘Visual Studio 10.0’ and save it again we are good to go. No other changes needed. The modified installer runs without issues on VS 2010 CTP and so far we haven’t found any problems with Blueprints on VS 2010.

If you are interested in the work we are doing, I suggest to go read an introductional post that Clemens just posted which describes some early ideas. Expect some more details in the next coming days, weeks, months on both Clemens blog and/or this one.

posted on 12/23/2008 8:58:40 PM UTC  #    Comments [0]

My friend Pablo just released Sticky Notes. As one of the beta testers for this cool Visual Studio extension I had the opportunity to play with it for some time and I found this a very handy and easy to use tool for ‘managing’ comments in source code. I mentioned to Pablo it might be cool to include TFS integration so I really hope this will be a feature for Sticky Notes vNext! I suggest you take a look at the screenshots and videos and decide for yourself how this can help your development activities. Great work Pablo!

posted on 12/23/2008 8:20:50 AM UTC  #    Comments [0]
 Monday, December 22, 2008

For one of the Blueprints I am currently writing I had to add a menu item that enables the Blueprint user to execute a specific task (command). Adding menu items to a Blueprint is pretty easy by using the Blueprint configuration dialog. As we can see in the screenshot below we can also set the ‘visibility for the menu item by specifying a menu filter in the ‘Visibility box’ on the dialog.

config

The current Blueprints CTP comes with a few ‘built-in’ menu filters like: Project=roject name, FolderEndsWith=folder name, etc. (complete list can be found in de Blueprints documentation). Of course I needed a menu filter that wasn’t available out of the box. Unfortunately the documentation doesn’t say anything about adding custom menu filters but luckily a little experimenting (and Reflector ;)) was enough to get this to work.

Here are the steps to implement your own custom menu filter: 

The first thing to do is to simply add the name of your new custom menu filter in the ‘Visibility’ box of the menu item you want the custom menu filter to be applied on. In this example we also pass a custom argument (‘BlaBla’) to our custom menu filter.

con1

The second step is to actually implement the custom menu filter. This can be easily done by adding a ‘Command Extension’ project to your Blueprint solution (Blueprints menu –> Add Command Extension). This project already implements a post build event to make sure the .dll that hosts your command extension is copied to the correct location to let Blueprint Manager find it during execution of your Blueprint.

for this example we can delete all default files in the extension project and add a new class to this project that implements the ‘IMenuFilter’ interface (add a reference to the ‘Microsoft.SoftwareFactories.BASMAPI.dll’ assembly that can be found under the Blueprint installation directory).

code1

In this class, the ‘FilterSupported’ method is used to decide whether a  custom menu filter is supported in our Blueprints. Àll we have to do in this method is return ‘true’ for the custom menu filters (name) that we want to support in our Blueprint. (note that we can handle multiple custom filters here).

code2

The ‘Visible’ method is used to decide whether the menu item that has our custom menu filter applied should be visible or not. The screenshot below demonstrates a, not very useful (and not bulletproof), implementation of a custom menu filter that only shows the menu item in case the Blueprint user right clicks the Solution (Solution Explorer) and the name of the selected Solution starts with the parameter supplied to the custom menu filter (‘BlaBla’ in this case).  As said, not a very useful filter but it hopefuly demonstrates what can can be done here.

code3

After we finished the ‘Visible’ method, we are done implementing our custom menu filter and all we have to do is make sure the Blueprints Manager knows about our custom menu filter. How?

As we can see in the screenshot below, the menus that we define in our Blueprint configuration dialog (see above) are stored in the ‘config.xml’ file of our Blueprint (located in the properties folder in our Blueprint project).

Menu

At some point, the Blueprint Manager parses this config file, searches for custom menus, detects the ‘MyCustomMenuFilter’ that we specified in our menu item and notices it isn’t one of the ‘built-in’ menu filters. At that time the Blueprint Manager checks if any additional ‘resources’ are registered for our Blueprint that might host an implementation of the ‘IMenuFilter’ interface. To make sure the Blueprint Manager can find our extension, we register our custom menu filter by adding the following (screenshot below) to the config file of our Blueprint.

Resources

After that, if the Blueprints Manager detects a menu filter that is doesn’t recognize, it will search its additional resources and find our custom menu filter implementation. It will then call the ‘FilterSupported’ and ‘Visible’ methods on our ‘CustomMenuFilters’ class to decide whether or not the custom menu item is supported and under what circumstances display our menu item.

posted on 12/22/2008 11:40:59 PM UTC  #    Comments [0]
 Saturday, December 20, 2008

When working with a Blueprint to deliver a product, we very often start with unfolding a solution/project structure (template) that reflects some architectural guidance. When building a Blueprint, we have a few options for unfolding templates within our Blueprint (that we can set through configuration as displayed below). The option ‘None’ obviously doesn’t unfold a template at all, ‘Auto-generated’ unfolds a predefined project template (C# class library) and ‘User-supplied’ provides us with the possibility to define our own solution/project templates. (The guidance that comes with the current release of Blueprints does a pretty good job describing these three options)

configuration

However, sometimes we need even more control before, during or after template unfolding (ie create folder structures, complex dialogs, Add to source control, etc.). Luckily, there is another mechanism that we can use for this scenario that gives us full control!

We can add a ‘Command Extension’ (right click on your Blueprint and select ‘Add Command Extension’ from the Blueprints menu) and write an extension that unfolds our custom project templates. 

AddExtension

Adding a Command Extension to our Blueprint gives us a new project in our Blueprint solution. This new project already contains an example extension that we can modify to implement our custom unfolding logic.  Below, a simplyfied implementation of this modified Command Extension is given that uses the custom ‘MyTemplate.vstemplate’ template and unfolds that to a (hard coded) location.

 

Extension

After we fully implemented our extension, we can add this Command Extension to the commands collection of our Blueprint (More info on how to add commands can be found in the Blueprints documentation).

Command

The real ‘trick’ here is to name the command ‘INIT’ which will force the Blueprints Manager to execute the command automatically for us when unfolding our Blueprint to a (empty) Visual Studio solution. Also, don’t forget to set the ‘Template’ option in the Blueprint configuration dialog to ‘None’! Note that we also added a switch statement to our implementation of the Command Extension to only execute the template unfolding in case the ‘INIT’ command gets executed.

With this in place we can write complex ‘vstemplates’, that include WizardExtensions to collect user input and rely on the Blueprints Manager to execute our ‘INIT’ command to unfold these templates when developers add our Blueprint to their Visual Studio solutions.

posted on 12/20/2008 10:27:52 PM UTC  #    Comments [0]
 Friday, November 07, 2008

Apparently I wasn’t the only one with questions about the relationship between OLSO and the DSL Tools. Both Stuart Kent (DSL Tools) and Keith Short (OSLO) respond to these questions from their point of view. Although both offerings are based on a different technology stack, they both have a lifecycle in front of them, the responsible teams aligned their vision and differences will be bridged over future releases. That’s what I call good news!

posted on 11/7/2008 8:06:52 PM UTC  #    Comments [2]
 Monday, November 03, 2008

Those of you interested in software factories should check out the new Blueprints Manger and Sample Blueprint which were released on the Blueprints Codeplex site right after PDC 2008. Jack Greenfield and Michael Lehman hosted the ‘Blueprint booth’ at PDC 2008 where they demoed this latest release. Blueprints represent the next generation Software Factories and solve many of the authoring and deploying issues that we have experienced with GAT/GAX based software factories. In addition, they add some great features (some of them demonstrated in the Sample Blueprint) to the factory space like :

  • Multiple interacting Blueprints
  • Blueprint Composition
  • RSS based updates
  • WF-Process structured workflow
  • WF-Commands - workflows which can automation developer tasks within Visual Studio
  • Custom Menu Filters - allowing menus to appear when the conditions are right
  • Code generation using the T4 Template system
  • Custom extensions - assemblies which can interact with the user and Visual Studio

Details on Blueprints can be found in the ‘Introduction to Microsoft Blueprints’ paper (link currently broken but will be fixed soon!) that can be downloaded from the Blueprints homepage on MSDN.

More information, samples, screencasts on factory authoring, planning, etc. will be available in the coming period so you better make sure to get back to the Blueprints home on Codeplex reguarly! (expect some info on this blog too ;))

posted on 11/3/2008 11:04:16 PM UTC  #    Comments [0]
 Saturday, November 01, 2008

Last week at PDC 2008, OSLO was announced as the new platform for model driven development. OSLO is composed of a language called ‘M’, a tool called ‘Quadrant’ and a repository. After the announcement of OSLO I spoke to several people asking me my opinion about the difference and/or overlap between OSLO and the Microsoft DSL Tools, which is the current toolset for building visual DSL’s. Obviously, at that moment wasn’t very clear for a lot of people including me. After some more discussing and thinking I have things more clear:

In the session of Douglas Purdy and Vijaye Raji, called ‘A lap about OSLO’, Douglas mentioned three types of modeling (models). First, we have ‘drawings’ which are primarily used to communicate with others. Perfect tools for creating drawings are whiteboard or tools like Visio. Second, we have ‘Model Assisted’ models which are used to understand or manipulate code (or other artifacts). Last, we have ‘model driven’ where models are directly executed by a runtime and drive runtime behavior of applications.

Obviously, OSLO is all about ‘Model Driven’ and driving runtime behavior. When looking at the new Team Architect (UML) diagrams in VS 2010 CTP we can see that DSL Tools fit perfectly in the ‘Model Assisted’ world. All new diagrams in Team Architect are build on the DSL Tools and especially in combination with (future) technology, often referred to as ‘designer bus’, DSL Tools are very powerful in scenarios where artifact generation is involved.

So, currently each platform supports a different approach. Possibly there are some overlaps and only Microsoft can tell how both platforms evolve, coexists and/or eventually (partially) integrate?

In the meantime, I will start experimenting with OSLO and definitely continue to work with the DSL Tools to get the best of both worlds!

 

posted on 11/1/2008 9:45:47 PM UTC  #    Comments [1]
 Thursday, October 09, 2008

Christian Weyer just announced that he decided to open up development of his very successful Web Service Contract First (WSCF) tool. The new release, named WSCF.blue, targets WCF and can be found on CodePlex. Currently, Buddhike and Benjamin are on the team and as the designated project leader I invite everybody interested in web Services and Contract First to help us further improve this tool.

If you are interested, contact me and I will be happy to add you to our team!

posted on 10/9/2008 8:14:57 AM UTC  #    Comments [0]
 Thursday, July 24, 2008

Service Factory Contrib Project is live! Yesterday, Don Smith published the site that will (hopefully) soon host a lot of community extensions for Service Factory. Hernan de Lahitte already contributed the long waited for "Import from WSDL" feature and I donated a version of Service Factory that includes VB.NET code generation from your models.

I will upload some other extensions in the coming days but for now, if you have anything to share, please read all about p&p contrib projects, follow the sign up process and we will make sure you can publish your contribution soon.

 

posted on 7/24/2008 8:41:45 PM UTC  #    Comments [1]